adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

An error occurred when deploying a private OpenAI-compatible model

Open 944386136 opened this issue 1 year ago • 3 comments

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'

944386136 avatar Oct 11 '25 08:10 944386136

@speedstorm1 - I can tackle this

speedstorm1 avatar Oct 28 '25 22:10 speedstorm1

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

klateefa avatar Feb 24 '26 06:02 klateefa

Closing this issue since it has been stale for more than 14 days.

llalitkumarrr avatar Apr 29 '26 07:04 llalitkumarrr