ChatDebugRunDetail converts a database.ChatDebugRun and its steps to a codersdk.ChatDebugRun.
(r database.ChatDebugRun, steps []database.ChatDebugStep)
| 1925 | // ChatDebugRunDetail converts a database.ChatDebugRun and its steps |
| 1926 | // to a codersdk.ChatDebugRun. |
| 1927 | func 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 |