ProposeChatTitle requests the server to generate a suggested chat title without persisting it.
(ctx context.Context, chatID uuid.UUID)
| 3248 | |
| 3249 | // ProposeChatTitle requests the server to generate a suggested chat title without persisting it. |
| 3250 | func (c *ExperimentalClient) ProposeChatTitle(ctx context.Context, chatID uuid.UUID) (ProposeChatTitleResponse, error) { |
| 3251 | res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/experimental/chats/%s/title/propose", chatID), nil) |
| 3252 | if err != nil { |
| 3253 | return ProposeChatTitleResponse{}, err |
| 3254 | } |
| 3255 | defer res.Body.Close() |
| 3256 | if res.StatusCode != http.StatusOK { |
| 3257 | return ProposeChatTitleResponse{}, readBodyAsChatUsageLimitError(res) |
| 3258 | } |
| 3259 | var resp ProposeChatTitleResponse |
| 3260 | return resp, json.NewDecoder(res.Body).Decode(&resp) |
| 3261 | } |
| 3262 | |
| 3263 | // GetChatDiffContents returns resolved diff contents for a chat. |
| 3264 | func (c *ExperimentalClient) GetChatDiffContents(ctx context.Context, chatID uuid.UUID) (ChatDiffContents, error) { |