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

Method EditChatMessage

codersdk/chats.go:3192–3213  ·  view source on GitHub ↗

EditChatMessage edits an existing user message in a chat and re-runs from there.

(
	ctx context.Context,
	chatID uuid.UUID,
	messageID int64,
	req EditChatMessageRequest,
)

Source from the content-addressed store, hash-verified

3190
3191// EditChatMessage edits an existing user message in a chat and re-runs from there.
3192func (c *ExperimentalClient) EditChatMessage(
3193 ctx context.Context,
3194 chatID uuid.UUID,
3195 messageID int64,
3196 req EditChatMessageRequest,
3197) (EditChatMessageResponse, error) {
3198 res, err := c.Request(
3199 ctx,
3200 http.MethodPatch,
3201 fmt.Sprintf("/api/experimental/chats/%s/messages/%d", chatID, messageID),
3202 req,
3203 )
3204 if err != nil {
3205 return EditChatMessageResponse{}, err
3206 }
3207 if res.StatusCode != http.StatusOK {
3208 return EditChatMessageResponse{}, readBodyAsChatUsageLimitError(res)
3209 }
3210 defer res.Body.Close()
3211 var resp EditChatMessageResponse
3212 return resp, json.NewDecoder(res.Body).Decode(&resp)
3213}
3214
3215// InterruptChat cancels an in-flight chat run and leaves it waiting.
3216func (c *ExperimentalClient) InterruptChat(ctx context.Context, chatID uuid.UUID) (Chat, error) {

Callers 3

TestPatchChatMessageFunction · 0.80

Calls 3

CloseMethod · 0.65
RequestMethod · 0.45

Tested by 3

TestPatchChatMessageFunction · 0.64