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

Method ClearChatContext

codersdk/agentsdk/agentsdk.go:1015–1028  ·  view source on GitHub ↗

ClearChatContext soft-deletes context-file and skill messages from an active chat.

(ctx context.Context, req ClearChatContextRequest)

Source from the content-addressed store, hash-verified

1013
1014// ClearChatContext soft-deletes context-file and skill messages from an active chat.
1015func (c *Client) ClearChatContext(ctx context.Context, req ClearChatContextRequest) (ClearChatContextResponse, error) {
1016 res, err := c.SDK.Request(ctx, http.MethodDelete, "/api/v2/workspaceagents/me/experimental/chat-context", req)
1017 if err != nil {
1018 return ClearChatContextResponse{}, xerrors.Errorf("execute request: %w", err)
1019 }
1020 defer res.Body.Close()
1021
1022 if res.StatusCode != http.StatusOK {
1023 return ClearChatContextResponse{}, codersdk.ReadBodyAsError(res)
1024 }
1025
1026 var resp ClearChatContextResponse
1027 return resp, json.NewDecoder(res.Body).Decode(&resp)
1028}

Callers 2

TestAgentChatContextFunction · 0.80

Calls 4

ReadBodyAsErrorFunction · 0.92
CloseMethod · 0.65
RequestMethod · 0.45
ErrorfMethod · 0.45

Tested by 1

TestAgentChatContextFunction · 0.64