We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Standalone client with security created for giphy API works but it fails when running it with fastagency run
fastagency run
How to reproduce Include source code:
import os import requests from autogen.agentchat import ConversableAgent from autogen import UserProxyAgent from fastagency.core import Chatable from fastagency.core.runtimes.autogen.base import AutoGenWorkflows from fastagency.core.io.console import ConsoleIO from fastagency.openapi.client import Client from fastagency.openapi.security import APIKeyQuery from fastagency import FastAgency llm_config = { "config_list": [ { "model": "gpt-4o-mini", "api_key": os.getenv("OPENAI_API_KEY"), } ], "temperature": 0.8, } GIPHY_OPENAPI_URL = "https://raw.githubusercontent.com/airtai/fastagency/main/examples/openapi/giphy_openapi.json" with requests.get(GIPHY_OPENAPI_URL, timeout=10) as response: response.raise_for_status() openapi_json = response.text # print(openapi_json) print(type(openapi_json)) wf = AutoGenWorkflows() @wf.register(name="simple_gif_search", description="Giphy gif chat") def gif_workflow(io: Chatable, initial_message: str, session_id: str) -> str: giphy_client = Client.create(openapi_json=openapi_json) giphy_client.set_security_params(APIKeyQuery.Parameters(value="ASK_KUMARAN")) user_agent = UserProxyAgent( name="User_Agent", system_message="You are a user agent", llm_config=llm_config, human_input_mode="NEVER", ) giphy_agent = ConversableAgent( name="Giphy_Agent", system_message="You are a gif agent who search for random gifs on Giphy", llm_config=llm_config, human_input_mode="NEVER", ) giphy_client.register_for_llm(giphy_agent) giphy_client.register_for_execution(user_agent) chat_result = user_agent.initiate_chat( giphy_agent, message=initial_message, summary_method="reflection_with_llm", max_turns=3, ) return chat_result.summary app = FastAgency(wf=wf, io=ConsoleIO())
Get an API key from giphy, update it in the above code and run it
Expected behavior Agents should fetch a gif url using giphy api
Observed behavior Fails with TypeError: Object of type Path is not JSON serializable
TypeError: Object of type Path is not JSON serializable
Full traceback Full traceback is available with @kumaranvpl if needed. Too many lines to paste it here.
The text was updated successfully, but these errors were encountered:
davorrunje
Successfully merging a pull request may close this issue.
Describe the bug
Standalone client with security created for giphy API works but it fails when running it with
fastagency run
How to reproduce
Include source code:
Get an API key from giphy, update it in the above code and run it
Expected behavior
Agents should fetch a gif url using giphy api
Observed behavior
Fails with
TypeError: Object of type Path is not JSON serializable
Full traceback
Full traceback is available with @kumaranvpl if needed. Too many lines to paste it here.
The text was updated successfully, but these errors were encountered: