feat(core): move context docs to user prompt (#10162)

Fix issue [BS-2522](https://linear.app/affine-design/issue/BS-2522).

### Why make this change?
If the user data contains illegal content, carrying the user data in the system prompt will run the risk of having the account banned.

### What Changed?
- Move the `Context Documents` to the user prompt.
- Add `withPrompt` in `QueryChatHistoriesInput` options.
- Get chat histories without prompt messages.
- Omit document context when saving messages to the `aiSessionMessage` db.
This commit is contained in:
akumatus
2025-02-13 12:08:12 +00:00
parent 3ff721abe8
commit 79d5f55471
10 changed files with 37 additions and 22 deletions

View File

@@ -1298,6 +1298,7 @@ export interface QueryChatHistoriesInput {
sessionId?: InputMaybe<Scalars['String']['input']>;
sessionOrder?: InputMaybe<ChatHistoryOrder>;
skip?: InputMaybe<Scalars['Int']['input']>;
withPrompt?: InputMaybe<Scalars['Boolean']['input']>;
}
export interface QueryTooLongDataType {