2025-02-02 14:17:55.915 | ERROR | planner_agent:generate_test_case:155 - Failed to generate test case: Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'developer' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}
2025-02-02 14:17:55.916 | ERROR | planner_agent:run:230 - Failed to process messages: Failed to generate test case: Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'developer' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}
2025-02-02 14:17:55.916 | ERROR | __main__:run_async:106 - Error during orchestration process: PlannerAgent failed: Failed to process messages: Failed to generate test case: Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'developer' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}
Hi @jeremy_of_course
Thanks for reaching out and for using Agno! Iāve looped in the right engineers to help with your question. We usually respond within 24 hours, but if this is urgent, just let us know, and weāll do our best to prioritize it.
Appreciate your patienceāweāll get back to you soon!
Hey @jeremy_of_course! I wanted to confirm with you if you are using Agno or Phidata right now. If you are using Phidata then what version of it are you running? If you are using Agno then I was able to run o1-mini with this small script
from agno.agent import Agent
from agno.models.openai import OpenAIChat
agent = Agent(model=OpenAIChat(id="o1-mini"))
# Print the response in the terminal
agent.print_response("What is the closest galaxy to milky way?", stream=True)
import os
from dotenv import load_dotenv
import logging
from agno.agent import Agent, AgentKnowledge
from agno.models.openai import OpenAIChat
from agno.vectordb.pgvector import PgVector, SearchType
from agno.embedder.openai import OpenAIEmbedder
from agno.tools.sql import SQLTools # Import SQL Tools
from pydantic import BaseModel
from typing import List, Any
# Load environment variables from .env file
load_dotenv()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Define the database URL using the value from the .env file.
db_url = os.getenv("DATABASE_URL")
# Fetch OpenAI API key from environment variables.
openai_api_key = os.getenv("OPENAI_API_KEY")
# Initialize PgVector instance for the 'articles' table.
logger.info("Configuring PgVector with correct article schema.")
vector_db = PgVector(
db_url=db_url,
table_name="articles", # This is the table that holds your articles.
schema="public", # Specify the correct schema (public) so the query uses public.articles.
embedder=OpenAIEmbedder(api_key=openai_api_key), # Using the OpenAI embedder with API key from .env.
search_type=SearchType.vector, # Hybrid search mixes vector and keyword matching.
)
logger.info("PgVector instance configured with fields: %s", ["id", "title", "content", "embedding"])
class ArticleSearchResult(BaseModel):
articles: List[dict] = [] # Provide a default value so 'articles' is not treated as required
## Wrap PgVector with AgentKnowledge for proper search handling.
knowledge_base = AgentKnowledge(vector_db=vector_db)
# Instantiate SQL tool for retrieving table schema information.
sql_tool = SQLTools(db_url=db_url, schema="public", describe_table=True)
# Create the Agno agent with the integrated knowledge base.
agent = Agent(
model=OpenAIChat(id="o1-mini", structured_outputs=False), # Disable structured outputs.
knowledge=knowledge_base, # Use AgentKnowledge for proper handling of search parameters.
search_knowledge=True, # Enable the search tool for the knowledge base.
tools=[sql_tool], # Add SQL tool so that the agent can query for the schema details.
description="Agent that answers questions using relevant articles from the database.",
instructions=(
"Whenever a question is provided, the agent will retrieve the top 4 most "
"related articles from the database using PgVector as its knowledge base, "
"and these results are then used to form the answer. "
"Note: The 'articles' table schema is as follows - created_at: timestamp, "
"title: text, embedding: vector, content: text, published_date: date, "
"authors: text, id: uuid. If you need further details about the table columns, "
"you can use the SQL tool's 'describe_table' function. "
"Refer to the [SQL Toolkits docs](https://docs.agno.com/tools/toolkits/sql) for guidance."
),
markdown=True,
debug_mode=True,
show_tool_calls=True,
)
agno.exceptions.ModelProviderError: Error code: 400 - {āerrorā: {āmessageā: āUnsupported value: āmessages[0].roleā does not support ādeveloperā with this model.ā, ātypeā: āinvalid_request_errorā, āparamā: āmessages[0].roleā, ācodeā: āunsupported_valueā}}
Hi Jeremy
OpenAI decided to only make o1-mini and o1-preview not match their expected schema of rolesā¦ all models before and after that work.
That being said, tool-use doesnāt work with those models, a limitation from OpenAI, so I would not recommend using them for this kind of application.
I tested on our latest version and it was working for me, so I can recommend upgrading to 1.1.0