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

Method GetChatSystemPrompt

codersdk/chats.go:2363–2374  ·  view source on GitHub ↗

GetChatSystemPrompt returns the deployment-wide chat system prompt.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2361
2362// GetChatSystemPrompt returns the deployment-wide chat system prompt.
2363func (c *ExperimentalClient) GetChatSystemPrompt(ctx context.Context) (ChatSystemPromptResponse, error) {
2364 res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/system-prompt", nil)
2365 if err != nil {
2366 return ChatSystemPromptResponse{}, err
2367 }
2368 defer res.Body.Close()
2369 if res.StatusCode != http.StatusOK {
2370 return ChatSystemPromptResponse{}, ReadBodyAsError(res)
2371 }
2372 var resp ChatSystemPromptResponse
2373 return resp, json.NewDecoder(res.Body).Decode(&resp)
2374}
2375
2376// UpdateChatSystemPrompt updates the deployment-wide chat system prompt.
2377func (c *ExperimentalClient) UpdateChatSystemPrompt(ctx context.Context, req UpdateChatSystemPromptRequest) error {

Callers 1

TestChatSystemPromptFunction · 0.95

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1

TestChatSystemPromptFunction · 0.76