Skip to content

Commit

Permalink
feat(prompts): create prompt mutation (#5812)
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy authored Jan 3, 2025
1 parent 1d3919d commit 20a3d0a
Show file tree
Hide file tree
Showing 20 changed files with 620 additions and 177 deletions.
30 changes: 28 additions & 2 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ input CreateDatasetInput {
metadata: JSON
}

input CreatePromptInput {
name: String!
description: String = null
promptVersion: PromptVersionInput!
}

input CreateSpanAnnotationInput {
spanId: GlobalID!
name: String!
Expand Down Expand Up @@ -1092,7 +1098,11 @@ type JSONPromptMessage {
}

type JSONSchema {
schema: JSON!
definition: JSON!
}

input JSONSchemaInput {
definition: JSON!
}

type LabelFraction {
Expand Down Expand Up @@ -1169,6 +1179,7 @@ type Mutation {
exportClusters(clusters: [ClusterInput!]!, fileName: String): ExportedFile!
deleteProject(id: GlobalID!): Query!
clearProject(input: ClearProjectInput!): Query!
createPrompt(input: CreatePromptInput!): Prompt!
createSpanAnnotations(input: [CreateSpanAnnotationInput!]!): SpanAnnotationMutationPayload!
patchSpanAnnotations(input: [PatchAnnotationInput!]!): SpanAnnotationMutationPayload!
deleteSpanAnnotations(input: DeleteAnnotationsInput!): SpanAnnotationMutationPayload!
Expand Down Expand Up @@ -1387,7 +1398,6 @@ type Prompt implements Node {
}

type PromptChatTemplate {
Version: String!
messages: [PromptTemplateMessage!]!
}

Expand Down Expand Up @@ -1477,6 +1487,18 @@ type PromptVersionEdge {
node: PromptVersion!
}

input PromptVersionInput {
description: String = null
templateType: PromptTemplateType!
templateFormat: PromptTemplateFormat!
template: JSON!
invocationParameters: JSON! = {}
tools: [ToolDefinitionInput!]! = []
outputSchema: JSONSchemaInput = null
modelProvider: String!
modelName: String!
}

type PromptVersionTag implements Node {
"""The Globally Unique ID of this object"""
id: GlobalID!
Expand Down Expand Up @@ -1858,6 +1880,10 @@ type ToolDefinition {
definition: JSON!
}

input ToolDefinitionInput {
definition: JSON!
}

type Trace implements Node {
"""The Globally Unique ID of this object"""
id: GlobalID!
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/prompt/PromptCodeExportCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function PromptCodeExportCard({
modelName
modelProvider
outputSchema {
schema
definition
}
tools {
definition
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 18 additions & 25 deletions app/src/pages/prompt/__generated__/promptLoaderQuery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 20a3d0a

Please sign in to comment.