Update auto_agent.py

pull/1101/head
CI-DEV 1 week ago committed by GitHub
parent debb9496ac
commit 96767d5d5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, Optional, Type, Union
from dotenv import load_dotenv from dotenv import load_dotenv
from pydantic import BaseModel, Field, ValidationError, create_model from pydantic import BaseModel, Field, ValidationError, create_model
from swarm_models.openai_function_caller import OpenAIFunctionCaller from swarms.utils.litellm_wrapper import LiteLLM
class DynamicParser: class DynamicParser:
@ -216,14 +216,13 @@ Your role is to make decisions and complete tasks independently without seeking
Always respond in a strict JSON format as described below. Ensure your responses can be parsed with Python's `json.loads`: Always respond in a strict JSON format as described below. Ensure your responses can be parsed with Python's `json.loads`:
""" """
# Initialize the OpenAIFunctionCaller # Initialize the LiteLLM
model = OpenAIFunctionCaller( model = LiteLLM(
model_name="gpt-4o",
system_prompt=SYSTEM_PROMPT, system_prompt=SYSTEM_PROMPT,
max_tokens=4000, max_tokens=4000,
temperature=0.9, temperature=0.9,
base_model=AgentResponse, # Pass the Pydantic schema as the base model response_format=AgentResponse, # Pass the Pydantic schema as the response format
parallel_tool_calls=False,
openai_api_key=os.getenv("OPENAI_API_KEY"),
) )
# Example usage # Example usage

Loading…
Cancel
Save