diff --git a/llm_agents/openai_agent/src/openai_agent.ts b/llm_agents/openai_agent/src/openai_agent.ts index da81bdbb..76d5359c 100644 --- a/llm_agents/openai_agent/src/openai_agent.ts +++ b/llm_agents/openai_agent/src/openai_agent.ts @@ -69,13 +69,10 @@ export const openAIAgent: AgentFunction | 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: [ diff --git a/llm_agents/openai_agent/tests/run_openai.ts b/llm_agents/openai_agent/tests/run_openai.ts index 5143c914..49e78f63 100644 --- a/llm_agents/openai_agent/tests/run_openai.ts +++ b/llm_agents/openai_agent/tests/run_openai.ts @@ -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?"] };