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

Method GetChatUserPromptsByChatID

coderd/database/querier.go:436–436  ·  view source on GitHub ↗

Returns the concatenated text of each user-visible user prompt in a chat, newest first. Used by the composer to populate the up/down arrow prompt-history cycle. Non-text parts (tool calls, files, attachments, ...) are excluded; messages whose text payload is entirely whitespace are dropped so cyclin

(ctx context.Context, arg GetChatUserPromptsByChatIDParams)

Source from the content-addressed store, hash-verified

434 // jsonb_array_elements never raises "cannot extract elements from a
435 // scalar". Backed by idx_chat_messages_user_prompts.
436 GetChatUserPromptsByChatID(ctx context.Context, arg GetChatUserPromptsByChatIDParams) ([]GetChatUserPromptsByChatIDRow, error)
437 // Returns the global TTL for chat workspaces as a Go duration string.
438 // Returns "0s" (disabled) when no value has been configured.
439 GetChatWorkspaceTTL(ctx context.Context) (string, error)

Callers 4

getChatUserPromptsMethod · 0.65
TestChatsMethod · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 1

TestChatsMethod · 0.52