@graphai/openai_fetch_agent
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@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
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @graphai/openai_fetch_agent

Weekly Downloads

10

Version

0.2.1

License

MIT

Unpacked Size

167 kB

Total Files

16

Last publish

Collaborators

  • isamu
  • snakajima