RegenerateChatTitle requests the server to regenerate the chat's title using richer conversation context.
(ctx context.Context, chatID uuid.UUID)
| 3229 | // RegenerateChatTitle requests the server to regenerate the chat's |
| 3230 | // title using richer conversation context. |
| 3231 | func (c *ExperimentalClient) RegenerateChatTitle(ctx context.Context, chatID uuid.UUID) (Chat, error) { |
| 3232 | res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/experimental/chats/%s/title/regenerate", chatID), nil) |
| 3233 | if err != nil { |
| 3234 | return Chat{}, err |
| 3235 | } |
| 3236 | defer res.Body.Close() |
| 3237 | if res.StatusCode != http.StatusOK { |
| 3238 | return Chat{}, readBodyAsChatUsageLimitError(res) |
| 3239 | } |
| 3240 | var chat Chat |
| 3241 | return chat, json.NewDecoder(res.Body).Decode(&chat) |
| 3242 | } |
| 3243 | |
| 3244 | // ProposeChatTitleResponse is returned by the propose-title endpoint. |
| 3245 | type ProposeChatTitleResponse struct { |