An error occurred when deploying a private OpenAI-compatible model
from google.adk.agents.llm_agent import Agent, LlmAgent from google.adk.models.lite_llm import LiteLlm from google.genai import types from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService
def get_current_time(city: str) -> dict: """Returns the current time in a specified city.""" return {"status": "success", "city": city, "time": "10:30 AM"}
root_agent = LlmAgent( model=LiteLlm( model="openai/xxxxxx", api_key="xxxxxxxxxxxxxxxxxxxxx", api_base="https://xxxxxxxxxxxxxx/v1", drop_params=True, stream=False ), name='root_agent', description="Tells the current time in a specified city.", instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.", tools=[get_current_time], )
An error will be reported when using adk web to test the agent: {"error": "litellm.InternalServerError: InternalServerError: OpenAIException - 'str' object has no attribute 'model_dump'"}
litellm.exceptions.InternalServerError: litellm.InternalServerError: InternalServerError: OpenAIException - 'str' object has no attribute 'model_dump'
@speedstorm1 - I can tackle this
@944386136 Thanks for reporting!
Could you please share the version of google-adk you’re currently using? Also, please try upgrading to the latest version of google-adk and let us know if the issue still occurs.
Thank you.
Closing this issue since it has been stale for more than 14 days.