feat(server): add copilot prompts management api (#7082)

This commit is contained in:
forehalo
2024-05-28 13:14:16 +00:00
parent 1a269a4b52
commit 4b30fbc1e2
5 changed files with 173 additions and 5 deletions

View File

@@ -34,6 +34,44 @@ type CopilotHistories {
tokens: Int!
}
enum CopilotModels {
DallE3
Gpt4Omni
Gpt4TurboPreview
Gpt4VisionPreview
Gpt35Turbo
TextEmbedding3Large
TextEmbedding3Small
TextEmbeddingAda002
TextModerationLatest
TextModerationStable
}
input CopilotPromptMessageInput {
content: String!
params: JSON
role: CopilotPromptMessageRole!
}
enum CopilotPromptMessageRole {
assistant
system
user
}
type CopilotPromptMessageType {
content: String!
params: JSON
role: CopilotPromptMessageRole!
}
type CopilotPromptType {
action: String
messages: [CopilotPromptMessageType!]!
model: CopilotModels!
name: String!
}
type CopilotQuota {
limit: SafeInt
used: SafeInt!
@@ -63,6 +101,13 @@ input CreateCheckoutSessionInput {
successCallbackLink: String!
}
input CreateCopilotPromptInput {
action: String
messages: [CopilotPromptMessageInput!]!
model: CopilotModels!
name: String!
}
type CredentialsRequirementType {
password: PasswordLimitsType!
}
@@ -206,6 +251,9 @@ type Mutation {
"""Create a chat message"""
createCopilotMessage(options: CreateChatMessageInput!): String!
"""Create a copilot prompt"""
createCopilotPrompt(input: CreateCopilotPromptInput!): CopilotPromptType!
"""Create a chat session"""
createCopilotSession(options: CreateChatSessionInput!): String!
@@ -238,6 +286,9 @@ type Mutation {
setBlob(blob: Upload!, workspaceId: String!): String!
setWorkspaceExperimentalFeature(enable: Boolean!, feature: FeatureType!, workspaceId: String!): Boolean!
sharePage(pageId: String!, workspaceId: String!): Boolean! @deprecated(reason: "renamed to publishPage")
"""Update a copilot prompt"""
updateCopilotPrompt(messages: [CopilotPromptMessageInput!]!, name: String!): CopilotPromptType!
updateProfile(input: UpdateUserInput!): UserType!
"""update server runtime configurable setting"""
@@ -296,6 +347,9 @@ type Query {
"""List blobs of workspace"""
listBlobs(workspaceId: String!): [String!]! @deprecated(reason: "use `workspace.blobs` instead")
"""List all copilot prompts"""
listCopilotPrompts: [CopilotPromptType!]!
listWorkspaceFeatures(feature: FeatureType!): [WorkspaceType!]!
prices: [SubscriptionPrice!]!