I’m trying to follow the agent engine deployment quickstart, but it doesn’t work as expected.
Here is the code I’m running:
import vertexai
client = vertexai.Client(project="my-project", location="us-central1")
def get_exchange_rate(
currency_from: str = "USD",
currency_to: str = "EUR",
currency_date: str = "latest",
):
"""Retrieves the exchange rate between two currencies on a specified date."""
import requests
response = requests.get(
f"https://api.frankfurter.app/{currency_date}",
params={"from": currency_from, "to": currency_to},
)
return response.json()
from vertexai import agent_engines
agent = agent_engines.LangchainAgent(
model="gemini-2.0-flash",
tools=[get_exchange_rate],
model_kwargs={
"temperature": 0.28,
"max_output_tokens": 1000,
"top_p": 0.95,
},
)
remote_agent = client.agent_engines.create(
agent=agent,
config={
"display_name": "test-agent-engine",
"requirements": ["google-cloud-aiplatform[agent_engines,langchain]"],
"staging_bucket": "gs://sample",
},
)
=== result===
아래 로그와 함께 배포는 성공하지만, 배포된 agent engine은 query와 stram_query 함수가 없습니다.
failed to generate schema for query: `query` is not fully defined; you should define `RunnableConfig`, then call `query.model_rebuild()`.
failed to generate schema for stream_query: `stream_query` is not fully defined; you should define `RunnableConfig`, then call `stream_query.model_rebuild()`.