feat: copilot controller (#6272)

fix CLOUD-27
This commit is contained in:
darkskygit
2024-04-10 11:58:40 +00:00
parent e6a576551a
commit 7c38a54f81
18 changed files with 729 additions and 179 deletions
+26 -50
View File
@@ -35,9 +35,10 @@ export interface Scalars {
}
export interface CreateChatSessionInput {
action: Scalars['Boolean']['input'];
/** An mark identifying which view to use to display the session */
action: InputMaybe<Scalars['String']['input']>;
docId: Scalars['String']['input'];
model: Scalars['String']['input'];
/** The prompt name to use for the session */
promptName: Scalars['String']['input'];
workspaceId: Scalars['String']['input'];
}
@@ -333,43 +334,6 @@ export type PasswordLimitsFragment = {
maxLength: number;
};
export type GetCopilotAnonymousHistoriesQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
docId: InputMaybe<Scalars['String']['input']>;
options: InputMaybe<QueryChatHistoriesInput>;
}>;
export type GetCopilotAnonymousHistoriesQuery = {
__typename?: 'Query';
copilotAnonymous: {
__typename?: 'Copilot';
histories: Array<{
__typename?: 'CopilotHistories';
sessionId: string;
tokens: number;
messages: Array<{
__typename?: 'ChatMessage';
role: string;
content: string;
attachments: Array<string> | null;
}>;
}>;
};
};
export type GetCopilotAnonymousSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
}>;
export type GetCopilotAnonymousSessionsQuery = {
__typename?: 'Query';
copilotAnonymous: {
__typename?: 'Copilot';
chats: Array<string>;
actions: Array<string>;
};
};
export type GetCopilotHistoriesQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
docId: InputMaybe<Scalars['String']['input']>;
@@ -391,12 +355,29 @@ export type GetCopilotHistoriesQuery = {
role: string;
content: string;
attachments: Array<string> | null;
createdAt: string | null;
}>;
}>;
};
} | null;
};
export type GetCopilotQuotaQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
docId: Scalars['String']['input'];
}>;
export type GetCopilotQuotaQuery = {
__typename?: 'Query';
currentUser: {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
quota: { __typename?: 'CopilotQuota'; limit: number; used: number };
};
} | null;
};
export type GetCopilotSessionsQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
}>;
@@ -407,8 +388,8 @@ export type GetCopilotSessionsQuery = {
__typename?: 'UserType';
copilot: {
__typename?: 'Copilot';
chats: Array<string>;
actions: Array<string>;
chats: Array<string>;
};
} | null;
};
@@ -1057,21 +1038,16 @@ export type Queries =
variables: EarlyAccessUsersQueryVariables;
response: EarlyAccessUsersQuery;
}
| {
name: 'getCopilotAnonymousHistoriesQuery';
variables: GetCopilotAnonymousHistoriesQueryVariables;
response: GetCopilotAnonymousHistoriesQuery;
}
| {
name: 'getCopilotAnonymousSessionsQuery';
variables: GetCopilotAnonymousSessionsQueryVariables;
response: GetCopilotAnonymousSessionsQuery;
}
| {
name: 'getCopilotHistoriesQuery';
variables: GetCopilotHistoriesQueryVariables;
response: GetCopilotHistoriesQuery;
}
| {
name: 'getCopilotQuotaQuery';
variables: GetCopilotQuotaQueryVariables;
response: GetCopilotQuotaQuery;
}
| {
name: 'getCopilotSessionsQuery';
variables: GetCopilotSessionsQueryVariables;