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

View File

@@ -2,6 +2,51 @@
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type ChatMessage {
attachments: [String!]
content: String!
createdAt: DateTime
role: String!
}
type Copilot {
"""Get the session list of actions in the workspace"""
actions: [String!]!
"""Get the session list of chats in the workspace"""
chats: [String!]!
histories(docId: String, options: QueryChatHistoriesInput): [CopilotHistories!]!
"""Get the quota of the user in the workspace"""
quota: CopilotQuota!
workspaceId: ID
}
type CopilotHistories {
"""An mark identifying which view to use to display the session"""
action: String!
messages: [ChatMessage!]!
sessionId: String!
"""The number of tokens used in the session"""
tokens: Int!
}
type CopilotQuota {
limit: SafeInt!
used: SafeInt!
}
input CreateChatSessionInput {
"""An mark identifying which view to use to display the session"""
action: String
docId: String!
"""The prompt name to use for the session"""
promptName: String!
workspaceId: String!
}
input CreateCheckoutSessionInput {
coupon: String
idempotencyKey: String!
@@ -122,6 +167,9 @@ type Mutation {
"""Create a subscription checkout link of stripe"""
createCheckoutSession(input: CreateCheckoutSessionInput!): String!
"""Create a chat session"""
createCopilotSession(options: CreateChatSessionInput!): String!
"""Create a stripe customer portal to manage payment methods"""
createCustomerPortal: String!
@@ -223,6 +271,13 @@ type Query {
workspaces: [WorkspaceType!]!
}
input QueryChatHistoriesInput {
action: Boolean
limit: Int
sessionId: String
skip: Int
}
type QuotaQueryType {
blobLimit: SafeInt!
copilotActionLimit: SafeInt
@@ -380,6 +435,7 @@ type UserSubscription {
type UserType {
"""User avatar url"""
avatarUrl: String
copilot(workspaceId: String): Copilot!
"""User email verified"""
createdAt: DateTime @deprecated(reason: "useless")