Add generate image tool
This commit is contained in:
parent
c3469c78e3
commit
7b364bce7d
1 changed files with 24 additions and 0 deletions
|
|
@ -121,6 +121,20 @@ const tools: FunctionDeclaration[] = [
|
|||
required: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "generateImage",
|
||||
description: "Generates an image or a picture based on the prompt",
|
||||
parametersJsonSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
prompt: {
|
||||
type: "string",
|
||||
description: "a very detailed prompt to generate an image",
|
||||
},
|
||||
},
|
||||
required: ["prompt"],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const toolFunctions: AIToolFunction[] = [
|
||||
|
|
@ -276,6 +290,16 @@ const toolFunctions: AIToolFunction[] = [
|
|||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "generateImage",
|
||||
function: (matrix, args) => {
|
||||
matrix.client.sendTextMessage(matrix.roomId, `!img ${args.prompt}`);
|
||||
|
||||
return {
|
||||
message: "trying to generate...",
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export { tools, toolFunctions };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue