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

Method fetchChatFileMetadata

coderd/exp_chats.go:6397–6407  ·  view source on GitHub ↗

fetchChatFileMetadata returns metadata for all files linked to the given chat. Errors are logged and result in a nil return (callers treat file metadata as best-effort).

(ctx context.Context, chatID uuid.UUID)

Source from the content-addressed store, hash-verified

6395// the given chat. Errors are logged and result in a nil return
6396// (callers treat file metadata as best-effort).
6397func (api *API) fetchChatFileMetadata(ctx context.Context, chatID uuid.UUID) []database.GetChatFileMetadataByChatIDRow {
6398 rows, err := api.Database.GetChatFileMetadataByChatID(ctx, chatID)
6399 if err != nil {
6400 api.Logger.Error(ctx, "failed to fetch chat file metadata",
6401 slog.F("chat_id", chatID),
6402 slog.Error(err),
6403 )
6404 return nil
6405 }
6406 return rows
6407}
6408
6409func convertChatCostModelBreakdown(model database.GetChatCostPerModelRow) codersdk.ChatCostModelBreakdown {
6410 displayName := strings.TrimSpace(model.DisplayName)

Callers 2

postChatsMethod · 0.95
getChatMethod · 0.95

Calls 2

ErrorMethod · 0.45

Tested by

no test coverage detected