Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Change async func to sync
Tomas Valentab49579fa310c
diff --git a/api-service/app.py b/api-service/app.pyindex 9c6bd3e49..37ab5f0d4 100644--- a/api-service/app.py+++ b/api-service/app.py@@ -74,7 +74,7 @@ async def generate():human_tools = create_human_tools(run_id=run_id, playground=playground)# Create a new instance of code generator- cg = await Codegen.from_tools_and_database(+ cg = Codegen.from_tools_and_database(# The order in which we pass tools HAS an effect on the LLM behaviour.custom_tools=[*playground_tools,diff --git a/api-service/codegen/codegen.py b/api-service/codegen/codegen.pyindex fc03f92ad..009afec90 100644--- a/api-service/codegen/codegen.py+++ b/api-service/codegen/codegen.py@@ -65,7 +65,7 @@ class Codegen(BaseModel):return [tool.name for tool in self._tools]@classmethod- async def from_tools_and_database(+ def from_tools_and_database(cls,custom_tools: List[BaseTool],model_config: ModelConfig,@@ -82,7 +82,7 @@ class Codegen(BaseModel):tool.callback_manager = callback_manager# Create the LLM- llm = await get_model(model_config, callback_manager)+ llm = get_model(model_config, callback_manager)print(f"Using LLM '{model_config['provider']}' with args:\n{model_config['args']}"diff --git a/api-service/models/base.py b/api-service/models/base.pyindex 160fbb4e5..6b46ba554 100644--- a/api-service/models/base.py+++ b/api-service/models/base.py@@ -19,7 +19,7 @@ class ModelConfig(TypedDict):args: Dict[str, Any]-async def get_model(+def get_model(config: ModelConfig,callback_manager: BaseCallbackManager,) -> BaseLanguageModel: