@graphai/openai_fetch_agent
v0.2.1
Published
OpenAI fetch agents for GraphAI and browser.
Downloads
114
Readme
@graphai/openai_fetch_agent for GraphAI
OpenAI fetch agents for GraphAI and browser.
Install
yarn add @graphai/openai_fetch_agent
This agent is used when referencing openai agent directly from codepen or index.html in js. Normally, use openai_agent.
Usage
import { GraphAI } from "graphai";
import { openAIFetchAgent } from "@graphai/openai_fetch_agent";
const agents = { openAIFetchAgent };
const graph = new GraphAI(graph_data, agents);
const result = await graph.run();
Agents description
- openAIFetchAgent - OpenAI Fetch Agent
Input/Output/Params Schema & samples
Input/Params example
- openAIFetchAgent
{
"inputs": {
"prompt": "this is response result"
},
"params": {}
}
GraphData Example
graphDataOpenAIMath
{
"version": 0.5,
"nodes": {
"inputData": {
"value": "hello, let me know the answer 1 + 1"
},
"llm": {
"agent": "openAIFetchAgent",
"inputs": {
"prompt": ":inputData"
}
}
}
}
graphDataOpenAIImageDescription
{
"version": 0.5,
"nodes": {
"inputData": {
"value": "what is this"
},
"llm": {
"agent": "openAIFetchAgent",
"inputs": {
"prompt": ":inputData"
},
"params": {
"model": "gpt-4o-mini",
"system": "Describe the given image",
"images": [
"https://upload.wikimedia.org/wikipedia/commons/thumb/f/ff/Kumamoto_Castle_Keep_Tower_20221022-3.jpg/1920px-Kumamoto_Castle_Keep_Tower_20221022-3.jpg"
]
},
"isResult": true
}
}
}