Skip to content

Commit

Permalink
Improve function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco committed Aug 20, 2024
1 parent ca5d67e commit 355e886
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/functions/describe-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RunnerResponse, defaultModel, Tool } from "../functions";
export class describeModel extends Tool {
static definition = {
name: "describe_model",
description: "Describes a model.",
description: "Describes a specific model.",
parameters: {
type: "object",
properties: {
Expand Down
13 changes: 9 additions & 4 deletions src/functions/list-models.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import OpenAI from "openai";
import { RunnerResponse, defaultModel, Tool } from "../functions";
import * as modelsAPI from "../models-api";

export class listModels extends Tool {
static definition = {
name: "list_models",
description: "Lists the available models.",
parameters: { type: "object", properties: {} },
description:
"This function lists the AI models available in GitHub Models.",
parameters: {
type: "object",
properties: {},
description:
"This function does not require any input parameters. It simply returns a list of models.",
},
};

async execute(
Expand All @@ -20,7 +25,7 @@ export class listModels extends Tool {
"Use markdown formatting to make each description more readable.",
"Begin each model's description with a header consisting of the model's registry and name",
"The header must be formatted as `<registry>/<name>`.",
"That list is as follows:",
"That list of models is as follows:",
];

for (const model of models) {
Expand Down
10 changes: 7 additions & 3 deletions src/functions/recommend-model.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import OpenAI from "openai";
import { RunnerResponse, defaultModel, Tool } from "../functions";
import { ModelsAPI } from "../models-api";

export class recommendModel extends Tool {
static definition = {
name: "recommend_model",
description:
"Recommends the best model according to the user's use-case, using the available models.",
parameters: { type: "object", properties: {} },
"Determines and recommends the most appropriate machine learning model based on the provided use-case. This function uses the available list of models to make the recommendation.",
parameters: {
type: "object",
properties: {},
description:
"This function does not require any input parameters. It uses internal logic to recommend the best model based on the provided use-case.",
},
};

async execute(
Expand Down

0 comments on commit 355e886

Please sign in to comment.