mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: add action field in histories gql (#6558)
This commit is contained in:
@@ -89,7 +89,14 @@ export class CopilotClient {
|
||||
if (message) {
|
||||
url.searchParams.set('message', message);
|
||||
}
|
||||
return fetch(url.toString());
|
||||
|
||||
return new Promise(resolve => {
|
||||
fetch(url.toString())
|
||||
.then(res => {
|
||||
resolve(res.text());
|
||||
})
|
||||
.catch(console.error);
|
||||
});
|
||||
}
|
||||
|
||||
// Text or image to text
|
||||
|
||||
@@ -8,6 +8,7 @@ query getCopilotHistories(
|
||||
histories(docId: $docId, options: $options) {
|
||||
sessionId
|
||||
tokens
|
||||
action
|
||||
messages {
|
||||
role
|
||||
content
|
||||
|
||||
@@ -274,6 +274,7 @@ query getCopilotHistories($workspaceId: String!, $docId: String, $options: Query
|
||||
histories(docId: $docId, options: $options) {
|
||||
sessionId
|
||||
tokens
|
||||
action
|
||||
messages {
|
||||
role
|
||||
content
|
||||
|
||||
@@ -366,6 +366,7 @@ export type GetCopilotHistoriesQuery = {
|
||||
__typename?: 'CopilotHistories';
|
||||
sessionId: string;
|
||||
tokens: number;
|
||||
action: string | null;
|
||||
messages: Array<{
|
||||
__typename?: 'ChatMessage';
|
||||
role: string;
|
||||
|
||||
Reference in New Issue
Block a user