mutation {
graphite {
insertAssistant(object: {
name: "awesome-assistant-for-my-users",
description: "My Awesome assistant for my users",
instructions: "You are a useful assistant for this demo application. You are an expert on movies. You also know a bit about deep questions.",
model: "gpt-3.5-turbo-1106",
graphql: [
{
description: "get movies with higher score than the input"
name: "GetMoviesWithScoreHigherThan",
query: "query ($score: numeric!) { movies(where: {score: {_gt: $score}}) { name overview score }}",
arguments: [
{
name: "score",
description: "score to compare against",
type: "number",
required: true,
}
]
},
{
description: "search movies using natural language",
name: "SearchMovies",
query: "query GraphiteSearchMovies($query: String!) { graphiteSearchMovies(args: {query: $query, amount: 5}) { id name overview genre } }",
arguments: [
{
name: "query",
description: "Text to search",
type: "string",
required: true,
}
]
}
{
description: "insert a movie into the database",
name: "InsertMovie",
query: "mutation InsertMovie($name: String, $overview: String, $genre: String, $crew: String, $budget: bigint, $revenue: bigint, $country: String, $score: numeric) { insertMovie(object: {name: $name, overview: $overview, score: $score, genre: $genre, crew: $crew, budget: $budget, revenue: $revenue, country: $country}) {id}}",
arguments: [
{
name: "name",
description: "Name of the movie",
type: "string",
required: true,
},
{
name: "overview",
description: "Overview of the movie",
type: "string",
required: true,
},
{
name: "genre",
description: "Genre of the movie",
type: "string",
required: true,
},
{
name: "crew",
description: "Crew of the movie",
type: "string",
required: true,
},
{
name: "budget",
description: "Budget of the movie",
type: "number",
required: true,
},
{
name: "revenue",
description: "Revenue generated by the movie",
type: "number",
required: true,
},
{
name: "country",
description: "Country of origin for the movie",
type: "string",
required: true,
},
{
name: "score",
description: "Score of the movie",
type: "number",
required: true,
},
]
}
],
webhooks: [
{
name: "answer_deep_questions",
description: "Answers deep questions about life, the universe and everything",
URL: "https://local.functions.nhost.run/v1/meaning",
arguments: [
{
name: "question",
description: "question that needs answer",
type: "string",
required: true,
}
],
}
]
}) {
assistantID
}
}
}