MCPcopy Index your code
hub / github.com/coder/coder / ChatDebugRunDetail

Function ChatDebugRunDetail

coderd/database/db2sdk/db2sdk.go:1927–1950  ·  view source on GitHub ↗

ChatDebugRunDetail converts a database.ChatDebugRun and its steps to a codersdk.ChatDebugRun.

(r database.ChatDebugRun, steps []database.ChatDebugStep)

Source from the content-addressed store, hash-verified

1925// ChatDebugRunDetail converts a database.ChatDebugRun and its steps
1926// to a codersdk.ChatDebugRun.
1927func ChatDebugRunDetail(r database.ChatDebugRun, steps []database.ChatDebugStep) codersdk.ChatDebugRun {
1928 sdkSteps := make([]codersdk.ChatDebugStep, 0, len(steps))
1929 for _, s := range steps {
1930 sdkSteps = append(sdkSteps, ChatDebugStep(s))
1931 }
1932 return codersdk.ChatDebugRun{
1933 ID: r.ID,
1934 ChatID: r.ChatID,
1935 RootChatID: nullUUIDPtr(r.RootChatID),
1936 ParentChatID: nullUUIDPtr(r.ParentChatID),
1937 ModelConfigID: nullUUIDPtr(r.ModelConfigID),
1938 TriggerMessageID: nullInt64Ptr(r.TriggerMessageID),
1939 HistoryTipMessageID: nullInt64Ptr(r.HistoryTipMessageID),
1940 Kind: codersdk.ChatDebugRunKind(r.Kind),
1941 Status: codersdk.ChatDebugStatus(r.Status),
1942 Provider: nullStringPtr(r.Provider),
1943 Model: nullStringPtr(r.Model),
1944 Summary: rawJSONObject(r.Summary),
1945 StartedAt: r.StartedAt,
1946 UpdatedAt: r.UpdatedAt,
1947 FinishedAt: nullTimePtr(r.FinishedAt),
1948 Steps: sdkSteps,
1949 }
1950}
1951
1952// ChildChatRows converts child chat rows to codersdk.Chat values,
1953// resolving diff statuses from the shared map. When diffStatuses

Callers 3

getChatDebugRunMethod · 0.92
TestChatDebugRunDetailFunction · 0.92

Calls 8

ChatDebugRunKindTypeAlias · 0.92
ChatDebugStatusTypeAlias · 0.92
nullUUIDPtrFunction · 0.85
nullStringPtrFunction · 0.85
rawJSONObjectFunction · 0.85
nullTimePtrFunction · 0.85
ChatDebugStepFunction · 0.70
nullInt64PtrFunction · 0.70

Tested by 2

TestChatDebugRunDetailFunction · 0.74