Skip to content

Commit

Permalink
Merge pull request #855 from isamu/gpt-4-vision-preview-deprecated
Browse files Browse the repository at this point in the history
deprecated gpt-4-vision-preview
  • Loading branch information
snakajima authored Dec 29, 2024
2 parents efaacb5 + 972c9ea commit 3afb559
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 4 additions & 7 deletions llm_agents/openai_agent/src/openai_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,10 @@ export const openAIAgent: AgentFunction<OpenAIInputs, Record<string, any> | stri
});
}
if (images) {
const image_url =
params.model === "gpt-4-vision-preview"
? images[0]
: {
url: images[0],
detail: "high",
};
const image_url = {
url: images[0],
detail: "high",
};
messagesCopy.push({
role: "user",
content: [
Expand Down
11 changes: 11 additions & 0 deletions llm_agents/openai_agent/tests/run_openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ test("test openai", async () => {
assert.deepStrictEqual(true, true);
});

test("test openai images", async () => {
const namedInputs = { prompt: ["hello, let me know the answer 1 + 1"], images: ["https://raw.githubusercontent.com/receptron/graphai/refs/heads/main/packages/samples/src/llm/fish001.jpg"] };
const params = { model: "gpt-4o"};
const res = (await openAIAgent({ namedInputs, params, filterParams: {}, debugInfo: { verbose: false, nodeId: "test", retry: 5 } })) as any;

if (res) {
console.log(res.choices[0].message["content"]);
}
assert.deepStrictEqual(true, true);
});

test("test openai tools", async () => {
const namedInputs = { prompt: ["I would like to return the item, what should I do?"] };

Expand Down

0 comments on commit 3afb559

Please sign in to comment.