agent-squad icon indicating copy to clipboard operation
agent-squad copied to clipboard

Bug: open AI agents and the docs are off sync

Open dm-8thblock opened this issue 1 year ago • 0 comments

Expected Behaviour

systemPrompt property is part of OpenAIAgentOptions

Current Behaviour

systemPrompot is not part of OpenAIAgentOptions

Neither does it have agent.setSystemPrompt(...)

Code snippet

import { OpenAIAgent, OpenAIClassifier } from "multi-agent-orchestrator";
import { MultiAgentOrchestrator } from "multi-agent-orchestrator";

const agent = new OpenAIAgent({
  name: 'OpenAI Assistant',
  description: 'A versatile AI assistant powered by OpenAI models',
  apiKey: 'your-openai-api-key',
  model: 'gpt-4o',
  streaming: true,
  inferenceConfig: {
    maxTokens: 500,
    temperature: 0.7,
    topP: 0.9,
    stopSequences: ['Human:', 'AI:']
  },
  systemPrompt: 'You are a helpful AI assistant specialized in answering questions about technology.'
});

Possible Solution

Update your docs

Steps to Reproduce

  1. npm install multi-agent-orchestrator
  2. Add your own Open AI code
import { OpenAIAgent} from "multi-agent-orchestrator";

const agent = new OpenAIAgent({
  name: 'OpenAI Assistant',
  description: 'A versatile AI assistant powered by OpenAI models',
  apiKey: 'your-openai-api-key',
  model: 'gpt-4o',
  streaming: true,
  inferenceConfig: {
    maxTokens: 500,
    temperature: 0.7,
    topP: 0.9,
    stopSequences: ['Human:', 'AI:']
  },
  systemPrompt: 'You are a helpful AI assistant specialized in answering questions about technology.'
});
  1. Observe TS errors about systemPrompt. Examine your own TS and note it is indeed not there https://github.com/awslabs/multi-agent-orchestrator/blob/97b5e909a5037c6a03931fe58c8862a1c0a251ed/typescript/src/agents/openAIAgent.ts#L6

dm-8thblock avatar Nov 29 '24 23:11 dm-8thblock