From 729e8f0b5d661f723db885a9e7d5388031c4c02b Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Wed, 16 Oct 2024 13:59:22 -0400 Subject: [PATCH 01/12] doc(agents-api): Add comments for the prompt-tool_call feature Signed-off-by: Diwank Singh Tomer --- .../activities/task_steps/prompt_step.py | 17 +++++++++++++++++ .../workflows/task_execution/__init__.py | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index d4d60acff..4c1761ae3 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -64,7 +64,13 @@ async def prompt_step(context: StepContext) -> StepOutcome: direction="desc", ) + ### [Function(...), ApiCall(...), Integration(...)] + ### -> [{"type": "function", "function": {...}}, {"type": "api_call", "api_call": {...}}, {"type": "integration", "integration": {...}}] + ### -> [{"type": "function", "function": {...}}] + ### -> openai + # Format agent_tools for litellm + # COMMENT(oct-16): Format the tools for openai api here (api_call | integration | system) -> function formatted_agent_tools = [ format_agent_tool(tool) for tool in agent_tools if format_agent_tool(tool) ] @@ -103,6 +109,17 @@ async def prompt_step(context: StepContext) -> StepOutcome: response = response.choices[0].message.content + ### response.choices[0].finish_reason == "tool_calls" + ### -> response.choices[0].message.tool_calls + ### -> [{"id": "call_abc", "name": "my_function", "arguments": "..."}, ...] + ### (cross-reference with original agent_tools list to get the original tool) + ### + ### -> FunctionCall(...) | ApiCall(...) | IntegrationCall(...) | SystemCall(...) + ### -> set this on response.choices[0].tool_calls + + # COMMENT(oct-16): Reference the original tool from tools passed to the activity + # if openai chooses to use a tool (finish_reason == "tool_calls") + return StepOutcome( output=response.model_dump() if hasattr(response, "model_dump") else response, next=None, diff --git a/agents-api/agents_api/workflows/task_execution/__init__.py b/agents-api/agents_api/workflows/task_execution/__init__.py index ea8b4fb22..332096145 100644 --- a/agents-api/agents_api/workflows/task_execution/__init__.py +++ b/agents-api/agents_api/workflows/task_execution/__init__.py @@ -395,6 +395,17 @@ async def run( message = response["choices"][0]["message"] tool_calls_input = message["tool_calls"] + ### COMMENT(oct-16): do a match-case on tool_calls_input.type + ### -> FunctionCall(...), ApiCall(...), IntegrationCall(...), SystemCall(...) + ### -> if api_call: + ### => execute_api_call(api_call) + ### -> if integration_call: + ### => execute_integration(integration_call) + ### -> if system_call: + ### => execute_system(system_call) + ### -> else: + ### => wait for input + # Enter a wait-for-input step to ask the developer to run the tool calls tool_calls_results = await workflow.execute_activity( task_steps.raise_complete_async, @@ -403,6 +414,8 @@ async def run( retry_policy=DEFAULT_RETRY_POLICY, ) + ### COMMENT(oct-16): Continue as usual. Feed the tool call results back to the model + # Feed the tool call results back to the model context.current_step.prompt.append(message) context.current_step.prompt.append(tool_calls_results) From 798e62d96c5f5562563bafb489b084b62af4a9fb Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Wed, 16 Oct 2024 22:54:32 +0300 Subject: [PATCH 02/12] chore: Add msgpack dependency --- agents-api/poetry.lock | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index b4c0d0d32..7c990c5a8 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -941,7 +941,10 @@ inflect = ">=4.1.0,<6.0" isort = ">=4.3.21,<6.0" jinja2 = ">=2.10.1,<4.0" packaging = "*" -pydantic = {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""} +pydantic = [ + {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""}, + {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"4.0\""}, +] pyyaml = ">=6.0.1" [package.extras] From 855a6146cd628e14f3edcb3ba6a12fedac15a7bb Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Wed, 16 Oct 2024 22:55:36 +0300 Subject: [PATCH 03/12] feat: Add support for other types of calls except of function call --- .../activities/task_steps/prompt_step.py | 102 +++++++++++++++--- 1 file changed, 86 insertions(+), 16 deletions(-) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index 4c1761ae3..e67adeb8a 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -1,8 +1,9 @@ from beartype import beartype +from litellm.types.utils import Function from temporalio import activity from temporalio.exceptions import ApplicationError -from ...autogen.Tools import Tool +from ...autogen.Tools import ApiCallDef, Tool from ...clients import ( litellm, # We dont directly import `acompletion` so we can mock it ) @@ -13,20 +14,69 @@ from ...models.tools.list_tools import list_tools -# FIXME: This shouldn't be here. -def format_agent_tool(tool: Tool) -> dict: +def make_function_call(tool: Tool) -> dict | None: + result = {"type": "function"} + if tool.function: - return { - "type": "function", - "function": { - "name": tool.name, - "description": tool.description, - "parameters": tool.function.parameters, - }, + result.update( + { + "function": { + "name": tool.name, + "description": tool.description, + "parameters": tool.function.parameters, + }, + } + ) + elif tool.api_call: + result.update( + { + "function": { + "name": tool.name, + "description": tool.description, + "parameters": { + k.rstrip("_"): getattr(tool.api_call, k) + for k in ApiCallDef.model_fields.keys() + }, + }, + } + ) + elif tool.system: + parameters = { + "resource_id": tool.system.resource_id, + "subresource": tool.system.subresource, } - # TODO: Add integration | system | api_call tool types - else: - return {} + if tool.system.arguments: + parameters.update({"arguments": tool.system.arguments}) + + result.update( + { + "function": { + "name": f"{tool.system.resource}.{tool.system.operation}", + "description": f"{tool.system.operation} a {tool.system.resource}", + "parameters": parameters, + } + } + ) + elif tool.integration: + parameters = {} + if tool.integration.method: + parameters.update({"method": tool.integration.method}) + if tool.integration.setup: + parameters.update({"setup": tool.integration.setup}) + if tool.integration.arguments: + parameters.update({"arguments": tool.integration.arguments}) + + result.update( + { + "function": { + "name": tool.name, + "description": f"{tool.integration.provider} integration", + "parameters": parameters, + } + } + ) + + return result if result.get("function") else None @activity.defn @@ -72,8 +122,12 @@ async def prompt_step(context: StepContext) -> StepOutcome: # Format agent_tools for litellm # COMMENT(oct-16): Format the tools for openai api here (api_call | integration | system) -> function formatted_agent_tools = [ - format_agent_tool(tool) for tool in agent_tools if format_agent_tool(tool) + func_call for tool in agent_tools if (func_call := make_function_call(tool)) ] + tools_mapping = { + fmt_tool["function"]["name"]: orig_tool + for fmt_tool, orig_tool in zip(formatted_agent_tools, agent_tools) + } if context.current_step.settings: passed_settings: dict = context.current_step.settings.model_dump( @@ -103,11 +157,27 @@ async def prompt_step(context: StepContext) -> StepOutcome: extra_body=extra_body, ) + choice = response.choices[0] if context.current_step.unwrap: - if response.choices[0].finish_reason == "tool_calls": + if choice.finish_reason == "tool_calls": raise ApplicationError("Tool calls cannot be unwrapped") - response = response.choices[0].message.content + response = choice.message.content + + if choice.finish_reason == "tool_calls": + choice.message.tool_calls = [ + call if isinstance(tc.function, dict) else tc.function.name + for tc in choice.message.tool_calls + if ( + call := ( + tools_mapping.get( + tc.function["name"] + if isinstance(tc.function, dict) + else tc.function.name + ) + ) + ) + ] ### response.choices[0].finish_reason == "tool_calls" ### -> response.choices[0].message.tool_calls From 355f74d9742eaa6dd0a4640cdec4310e457ffcf8 Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Thu, 17 Oct 2024 14:07:10 +0300 Subject: [PATCH 04/12] feat: Choose the activity based on tool type --- .../activities/task_steps/prompt_step.py | 36 +--- .../workflows/task_execution/__init__.py | 196 +++++++++--------- 2 files changed, 100 insertions(+), 132 deletions(-) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index e67adeb8a..624ee647b 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -1,5 +1,4 @@ from beartype import beartype -from litellm.types.utils import Function from temporalio import activity from temporalio.exceptions import ApplicationError @@ -114,13 +113,6 @@ async def prompt_step(context: StepContext) -> StepOutcome: direction="desc", ) - ### [Function(...), ApiCall(...), Integration(...)] - ### -> [{"type": "function", "function": {...}}, {"type": "api_call", "api_call": {...}}, {"type": "integration", "integration": {...}}] - ### -> [{"type": "function", "function": {...}}] - ### -> openai - - # Format agent_tools for litellm - # COMMENT(oct-16): Format the tools for openai api here (api_call | integration | system) -> function formatted_agent_tools = [ func_call for tool in agent_tools if (func_call := make_function_call(tool)) ] @@ -165,30 +157,10 @@ async def prompt_step(context: StepContext) -> StepOutcome: response = choice.message.content if choice.finish_reason == "tool_calls": - choice.message.tool_calls = [ - call if isinstance(tc.function, dict) else tc.function.name - for tc in choice.message.tool_calls - if ( - call := ( - tools_mapping.get( - tc.function["name"] - if isinstance(tc.function, dict) - else tc.function.name - ) - ) - ) - ] - - ### response.choices[0].finish_reason == "tool_calls" - ### -> response.choices[0].message.tool_calls - ### -> [{"id": "call_abc", "name": "my_function", "arguments": "..."}, ...] - ### (cross-reference with original agent_tools list to get the original tool) - ### - ### -> FunctionCall(...) | ApiCall(...) | IntegrationCall(...) | SystemCall(...) - ### -> set this on response.choices[0].tool_calls - - # COMMENT(oct-16): Reference the original tool from tools passed to the activity - # if openai chooses to use a tool (finish_reason == "tool_calls") + tc = choice.message.tool_calls[0] + choice.message.tool_calls = tools_mapping.get( + tc.function["name"] if isinstance(tc.function, dict) else tc.function.name + ) return StepOutcome( output=response.model_dump() if hasattr(response, "model_dump") else response, diff --git a/agents-api/agents_api/workflows/task_execution/__init__.py b/agents-api/agents_api/workflows/task_execution/__init__.py index 332096145..adfccbd2b 100644 --- a/agents-api/agents_api/workflows/task_execution/__init__.py +++ b/agents-api/agents_api/workflows/task_execution/__init__.py @@ -119,6 +119,82 @@ # Probably can be implemented much more efficiently +async def run_api_call(tool_call: dict, context: StepContext): + call = tool_call["api_call"] + tool_name = call["name"] + arguments = call["arguments"] + apicall_spec = next((t for t in context.tools if t.name == tool_name), None) + + if apicall_spec is None: + raise ApplicationError(f"Integration {tool_name} not found") + + api_call = ApiCallDef( + method=apicall_spec.spec["method"], + url=apicall_spec.spec["url"], + headers=apicall_spec.spec["headers"], + follow_redirects=apicall_spec.spec["follow_redirects"], + ) + + if "json_" in arguments: + arguments["json"] = arguments["json_"] + del arguments["json_"] + + return await workflow.execute_activity( + execute_api_call, + args=[ + api_call, + arguments, + ], + schedule_to_close_timeout=timedelta(seconds=30 if debug or testing else 600), + ) + + +async def run_integration_call(tool_call: dict, context: StepContext): + call = tool_call["integration"] + tool_name = call["name"] + arguments = call["arguments"] + integration_spec = next((t for t in context.tools if t.name == tool_name), None) + + if integration_spec is None: + raise ApplicationError(f"Integration {tool_name} not found") + + # FIXME: Refactor this + # Tools that are not defined in the task spec have a different format + if isinstance(integration_spec, TaskToolDef): + provider = integration_spec.spec["provider"] + setup = integration_spec.spec["setup"] + method = integration_spec.spec["method"] + else: + provider = integration_spec.integration.provider + setup = integration_spec.integration.setup.model_dump() + method = integration_spec.integration.method + + integration = BaseIntegrationDef( + provider=provider, + setup=setup, + method=method, + arguments=arguments, + ) + + return await workflow.execute_activity( + execute_integration, + args=[context, tool_name, integration, arguments], + schedule_to_close_timeout=timedelta(seconds=30 if debug or testing else 600), + retry_policy=DEFAULT_RETRY_POLICY, + ) + + +async def run_system_call(tool_call: dict, context: StepContext): + call = tool_call.get("system") + + system_call = SystemDef(**call) + return await workflow.execute_activity( + execute_system, + args=[context, system_call], + schedule_to_close_timeout=timedelta(seconds=30 if debug or testing else 600), + ) + + # Main workflow definition @workflow.defn class TaskExecutionWorkflow: @@ -395,26 +471,23 @@ async def run( message = response["choices"][0]["message"] tool_calls_input = message["tool_calls"] - ### COMMENT(oct-16): do a match-case on tool_calls_input.type - ### -> FunctionCall(...), ApiCall(...), IntegrationCall(...), SystemCall(...) - ### -> if api_call: - ### => execute_api_call(api_call) - ### -> if integration_call: - ### => execute_integration(integration_call) - ### -> if system_call: - ### => execute_system(system_call) - ### -> else: - ### => wait for input - - # Enter a wait-for-input step to ask the developer to run the tool calls - tool_calls_results = await workflow.execute_activity( - task_steps.raise_complete_async, - args=[context, tool_calls_input], - schedule_to_close_timeout=timedelta(days=31), - retry_policy=DEFAULT_RETRY_POLICY, - ) - - ### COMMENT(oct-16): Continue as usual. Feed the tool call results back to the model + if tool_calls_input.get("api_call"): + tool_calls_results = await run_api_call(tool_calls_input, context) + elif tool_calls_input.get("integration"): + tool_calls_results = await run_integration_call( + tool_calls_input, context + ) + elif tool_calls_input.get("system"): + tool_calls_results = await run_system_call( + tool_calls_input, context + ) + else: + tool_calls_results = await workflow.execute_activity( + task_steps.raise_complete_async, + args=[context, tool_calls_input], + schedule_to_close_timeout=timedelta(days=31), + retry_policy=DEFAULT_RETRY_POLICY, + ) # Feed the tool call results back to the model context.current_step.prompt.append(message) @@ -466,96 +539,19 @@ async def run( case ToolCallStep(), StepOutcome(output=tool_call) if tool_call[ "type" ] == "integration": - call = tool_call["integration"] - tool_name = call["name"] - arguments = call["arguments"] - integration_spec = next( - (t for t in context.tools if t.name == tool_name), None - ) - - if integration_spec is None: - raise ApplicationError(f"Integration {tool_name} not found") - - # FIXME: Refactor this - # Tools that are not defined in the task spec have a different format - if isinstance(integration_spec, TaskToolDef): - provider = integration_spec.spec["provider"] - setup = integration_spec.spec["setup"] - method = integration_spec.spec["method"] - else: - provider = integration_spec.integration.provider - setup = integration_spec.integration.setup.model_dump() - method = integration_spec.integration.method - - integration = BaseIntegrationDef( - provider=provider, - setup=setup, - method=method, - arguments=arguments, - ) - - tool_call_response = await workflow.execute_activity( - execute_integration, - args=[context, tool_name, integration, arguments], - schedule_to_close_timeout=timedelta( - seconds=30 if debug or testing else 600 - ), - retry_policy=DEFAULT_RETRY_POLICY, - ) - + tool_call_response = await run_integration_call(tool_call, context) state = PartialTransition(output=tool_call_response) case ToolCallStep(), StepOutcome(output=tool_call) if tool_call[ "type" ] == "api_call": - call = tool_call["api_call"] - tool_name = call["name"] - arguments = call["arguments"] - apicall_spec = next( - (t for t in context.tools if t.name == tool_name), None - ) - - if apicall_spec is None: - raise ApplicationError(f"Integration {tool_name} not found") - - api_call = ApiCallDef( - method=apicall_spec.spec["method"], - url=apicall_spec.spec["url"], - headers=apicall_spec.spec["headers"], - follow_redirects=apicall_spec.spec["follow_redirects"], - ) - - if "json_" in arguments: - arguments["json"] = arguments["json_"] - del arguments["json_"] - - # Execute the API call using the `execute_api_call` function - tool_call_response = await workflow.execute_activity( - execute_api_call, - args=[ - api_call, - arguments, - ], - schedule_to_close_timeout=timedelta( - seconds=30 if debug or testing else 600 - ), - ) - + tool_call_response = await run_api_call(tool_call, context) state = PartialTransition(output=tool_call_response) case ToolCallStep(), StepOutcome(output=tool_call) if tool_call[ "type" ] == "system": - call = tool_call.get("system") - - system_call = SystemDef(**call) - tool_call_response = await workflow.execute_activity( - execute_system, - args=[context, system_call], - schedule_to_close_timeout=timedelta( - seconds=30 if debug or testing else 600 - ), - ) + tool_call_response = await run_system_call(tool_call, context) state = PartialTransition(output=tool_call_response) From 7bd7bedfc1130dae53131ffd82cb39f982b81117 Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Thu, 17 Oct 2024 21:13:26 +0300 Subject: [PATCH 05/12] fix: Use correct objects for parameters --- .../activities/task_steps/prompt_step.py | 116 +++++++++++++++--- 1 file changed, 96 insertions(+), 20 deletions(-) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index 624ee647b..936ba99f9 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -2,7 +2,7 @@ from temporalio import activity from temporalio.exceptions import ApplicationError -from ...autogen.Tools import ApiCallDef, Tool +from ...autogen.Tools import Tool from ...clients import ( litellm, # We dont directly import `acompletion` so we can mock it ) @@ -33,44 +33,120 @@ def make_function_call(tool: Tool) -> dict | None: "name": tool.name, "description": tool.description, "parameters": { - k.rstrip("_"): getattr(tool.api_call, k) - for k in ApiCallDef.model_fields.keys() + "type": "object", + "properties": { + "method": { + "type": "string", + "description": "The HTTP method to use", + }, + "url": { + "type": "string", + "description": "The URL to call", + }, + "headers": { + "type": "object", + "description": "The headers to send with the request", + }, + "content": { + "type": "string", + "description": "The content as base64 to send with the request", + }, + "data": { + "type": "object", + "description": "The data to send as form data", + }, + "json": { + "type": "object", + "description": "JSON body to send with the request", + }, + "cookies": { + "type": "object", + "description": "Cookies", + }, + "params": { + "type": "object", + "description": "The parameters to send with the request", + }, + "follow_redirects": { + "type": "bool", + "description": "Follow redirects", + }, + "timeout": { + "type": "int", + "description": "The timeout for the request", + }, + }, + "required": ["method", "url"], + "additionalProperties": False, }, }, } ) elif tool.system: - parameters = { - "resource_id": tool.system.resource_id, - "subresource": tool.system.subresource, - } - if tool.system.arguments: - parameters.update({"arguments": tool.system.arguments}) - result.update( { "function": { "name": f"{tool.system.resource}.{tool.system.operation}", "description": f"{tool.system.operation} a {tool.system.resource}", - "parameters": parameters, + "parameters": { + "type": "object", + "properties": { + "resource": { + "type": "string", + "description": "Resource is the name of the resource to use, one of: agent, user, task, execution, doc, session, job", + }, + "operation": { + "type": "string", + "description": "Operation is the name of the operation to perform, one of: create, update, patch, create_or_update, embed, change_status, search, chat, history, delete, get, list", + }, + "resource_id": { + "type": "string", + "description": "Resource id", + }, + "subresource": { + "type": "string", + "description": "Sub-resource type, one of: tool, doc, execution, transition", + }, + "arguments": { + "type": "object", + "description": "The arguments to pre-apply to the system call", + }, + }, + "required": ["resource", "operation"], + "additionalProperties": False, + }, } } ) elif tool.integration: - parameters = {} - if tool.integration.method: - parameters.update({"method": tool.integration.method}) - if tool.integration.setup: - parameters.update({"setup": tool.integration.setup}) - if tool.integration.arguments: - parameters.update({"arguments": tool.integration.arguments}) - result.update( { "function": { "name": tool.name, "description": f"{tool.integration.provider} integration", - "parameters": parameters, + "parameters": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "The provider of the integration", + }, + "method": { + "type": "string", + "description": "The specific method of the integration to call", + }, + "setup": { + "type": "object", + "description": "The setup parameters the integration accepts", + }, + "arguments": { + "type": "object", + "description": "The arguments to pre-apply to the integration call", + }, + }, + "required": ["provider"], + "additionalProperties": False, + }, } } ) From d0d672381f47e339add7b1668589c510607f8c9a Mon Sep 17 00:00:00 2001 From: whiterabbit1983 <786754+whiterabbit1983@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:42:22 +0000 Subject: [PATCH 06/12] chore(readme): translate README.md --- README-CN.md | 69 ++++++++++++++++++++++++++----------------------- README-FR.md | 68 ++++++++++++++++++++++++------------------------ README-JA.md | 73 +++++++++++++++++++++++++++------------------------- 3 files changed, 109 insertions(+), 101 deletions(-) diff --git a/README-CN.md b/README-CN.md index e39a65bcc..301681124 100644 --- a/README-CN.md +++ b/README-CN.md @@ -6,7 +6,7 @@


- 探索文档 + 探索文档(正在开发中) · 不和谐 · @@ -62,34 +62,39 @@ -

📖 Table of Contents

- -- [主要特点](#%E4%B8%BB%E8%A6%81%E7%89%B9%E7%82%B9) -- [Python 快速入门🐍](#python-%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8) -- [Node.js Quick Start 🟩](#nodejs-quick-start-) - - [Step 1: Create an Agent](#step-1-create-an-agent) -- [Components](#components) - - [Mental Model](#mental-model) -- [Concepts](#concepts) -- [Understanding Tasks](#understanding-tasks) - - [Lifecycle of a Task](#lifecycle-of-a-task) - - [Types of Workflow Steps](#types-of-workflow-steps) -- [Tool Types](#tool-types) - - [User-defined `functions`](#user-defined-functions) - - [`system` tools](#system-tools) - - [Built-in `integrations`](#built-in-integrations) - - [Direct `api_calls`](#direct-api_calls) -- [Integrations](#integrations) -- [Other Features](#other-features) - - [Adding Tools to Agents](#adding-tools-to-agents) - - [Managing Sessions and Users](#managing-sessions-and-users) - - [Document Integration and Search](#document-integration-and-search) - - [SDK 参考](#sdk-%E5%8F%82%E8%80%83) - - [API 参考](#api-%E5%8F%82%E8%80%83) -- [本地快速启动](#%E6%9C%AC%E5%9C%B0%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8) -- [Julep 和 LangChain 等有什么区别?](#julep-%E5%92%8C-langchain-%E7%AD%89%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB) - - [不同的用例](#%E4%B8%8D%E5%90%8C%E7%9A%84%E7%94%A8%E4%BE%8B) - - [不同的外形尺寸](#%E4%B8%8D%E5%90%8C%E7%9A%84%E5%A4%96%E5%BD%A2%E5%B0%BA%E5%AF%B8) +

📖 目录

+ +- [简介](#introduction) +- [主要特点](#key-features) +- [快速示例](#quick-example) +- [安装](#安装) +- [Python 快速入门 🐍](#python-quick-start-) +- [Node.js 快速入门🟩](#nodejs-quick-start-) +- [步骤 1:创建代理](#step-1-create-an-agent) +- [组件](#components) +- [心智模型](#mental-model) +- [概念](#concepts) +- [理解任务](#understanding-tasks) +- [任务的生命周期](#lifecycle-of-a-task) +- [工作流步骤的类型](#types-of-workflow-steps) +- [工具类型](#tool-types) +- [用户定义的`函数`](#user-defined-functions) +- [`系统` 工具](#system-tools) +- [内置 `integrations`](#built-in-integrations) +-[直接`api_calls`](#direct-api_calls) +- [集成](#integrations) +- [其他功能](#other-features) +- [向代理添加工具](#adding-tools-to-agents) +- [管理会话和用户](#managing-sessions-and-users) +- [文档集成与搜索](#document-integration-and-search) +- [参考](#reference) +- [SDK 参考](#sdk-reference) +- [API 参考](#api-reference) +- [本地快速启动](#local-quickstart) +- [Julep 和 LangChain 等有什么区别?](#julep 和 langchain 等之间有什么区别) +- [不同用例](#different-use-cases) +- [不同的外形尺寸](#different-form-factor) +- [总结](#in-summary) @@ -232,7 +237,7 @@ main: > **人工智能研究摘要** > ->###人工智能(AI)研究成果摘要 +> ### 人工智能(AI)研究成果摘要 > > #### 简介 > @@ -1297,7 +1302,7 @@ result: string # Brave Search 的结果 设置: api_key: string # BrowserBase 的 API 密钥 project_id: string # BrowserBase 的项目 ID -session_id: string # (可选)BrowserBase 的会话 ID +session_id: string #(可选)BrowserBase 的会话 ID 参数: urls: list[string] # 使用 BrowserBase 加载的 URL @@ -1352,7 +1357,7 @@ mode: string # 爬虫的类型(默认值:“scrape”) params: dict # (可选)Spider API 的参数 输出: -documents: list # 蜘蛛返回的文档 +documents: list # 从蜘蛛返回的文档 ``` diff --git a/README-FR.md b/README-FR.md index 2848a2637..2a5254c03 100644 --- a/README-FR.md +++ b/README-FR.md @@ -6,7 +6,7 @@


- Explorer les documents + Explorer les documents (en cours) · Discorde · @@ -62,39 +62,39 @@ Des nouvelles passionnantes ! Nous participons au DevFest.AI tout au long du moi -

📖 Table of Contents

+

📖 Table des matières

-- [Introduction](#introduction) -- [Principales caractéristiques](#principales-caract%C3%A9ristiques) -- [Exemple rapide](#exemple-rapide) +- [Présentation](#introduction) +- [Caractéristiques principales](#key-features) +- [Exemple rapide](#quick-example) - [Installation](#installation) -- [Démarrage rapide de Python 🐍](#d%C3%A9marrage-rapide-de-python-) -- [Node.js Quick Start 🟩](#nodejs-quick-start-) - - [Step 1: Create an Agent](#step-1-create-an-agent) -- [Components](#components) - - [Mental Model](#mental-model) +- [Démarrage rapide de Python 🐍](#python-quick-start-) +- [Démarrage rapide de Node.js 🟩](#nodejs-quick-start-) +- [Étape 1 : Créer un agent](#step-1-create-an-agent) +- [Composants](#composants) +- [Modèle mental](#mental-model) - [Concepts](#concepts) -- [Understanding Tasks](#understanding-tasks) - - [Lifecycle of a Task](#lifecycle-of-a-task) - - [Types of Workflow Steps](#types-of-workflow-steps) -- [Tool Types](#tool-types) - - [User-defined `functions`](#user-defined-functions) - - [`system` tools](#system-tools) - - [Built-in `integrations`](#built-in-integrations) - - [Direct `api_calls`](#direct-api_calls) -- [Integrations](#integrations) -- [Other Features](#other-features) - - [Adding Tools to Agents](#adding-tools-to-agents) - - [Managing Sessions and Users](#managing-sessions-and-users) - - [Document Integration and Search](#document-integration-and-search) -- [Référence](#r%C3%A9f%C3%A9rence) - - [Référence du SDK](#r%C3%A9f%C3%A9rence-du-sdk) - - [Référence API](#r%C3%A9f%C3%A9rence-api) -- [Démarrage rapide local](#d%C3%A9marrage-rapide-local) -- [Quelle est la différence entre Julep et LangChain etc ?](#quelle-est-la-diff%C3%A9rence-entre-julep-et-langchain-etc-) - - [Différents cas d'utilisation](#diff%C3%A9rents-cas-dutilisation) - - [Facteur de forme différent](#facteur-de-forme-diff%C3%A9rent) - - [En résumé](#en-r%C3%A9sum%C3%A9) +- [Comprendre les tâches](#understanding-tasks) +- [Cycle de vie d'une tâche](#cycle-de-vie-d-une-tâche) +- [Types d'étapes de flux de travail](#types-of-workflow-steps) +- [Types d'outils](#types-d'outils) +- [`Fonctions` définies par l'utilisateur](#user-defined-functions) +- [outils système](#outils-système) +- [`Intégrations` intégrées](#integrations-integrées) +- [Appels directs `api_calls`](#appels directs-api_calls) +- [Intégrations](#intégrations) +- [Autres fonctionnalités](#other-features) +- [Ajout d'outils aux agents](#adding-tools-to-agents) +- [Gestion des sessions et des utilisateurs](#managing-sessions-and-users) +- [Intégration et recherche de documents](#document-integration-and-search) +- [Référence](#référence) +- [Référence SDK](#sdk-reference) +- [Référence API](#api-reference) +- [Démarrage rapide local](#local-quickstart) +- [Quelle est la différence entre Julep et LangChain etc ?](#quelle-est-la-différence-entre-julep-et-langchain-etc) +- [Différents cas d'utilisation](#different-use-cases) +- [Facteur de forme différent](#different-form-factor) +- [En résumé](#en-resumé) @@ -429,11 +429,11 @@ agent_id=agent.id, ### Étape 3 : Exécuter la tâche exécution = client.executions.create( -task_id=task.id, +task_id=tâche.id, input={"idea": "Un chat qui apprend à voler"} ) -# 🎉 Regardez l'histoire et les panneaux de bande dessinée se générer +# 🎉 Regardez l'histoire et les panneaux de bandes dessinées se générer while (result := client.executions.get(execution.id)).status n'est pas dans ['réussi', 'échec'] : print(résultat.statut, résultat.sortie) heure.sommeil(1) @@ -1561,7 +1561,7 @@ Julep, en revanche, s'intéresse davantage à la création d'agents d'IA persist Utilisez Julep si vous imaginez créer un assistant IA complexe qui doit : - Suivez les interactions des utilisateurs sur plusieurs jours ou semaines. -- Exécutez des tâches planifiées, comme l'envoi de résumés quotidiens ou la surveillance des sources de données. +- Exécutez des tâches planifiées, comme l'envoi de résumés quotidiens ou la surveillance de sources de données. - Prendre des décisions basées sur des interactions antérieures ou des données stockées. - Interagir avec plusieurs services externes dans le cadre de son flux de travail. diff --git a/README-JA.md b/README-JA.md index 116df51ef..d22750547 100644 --- a/README-JA.md +++ b/README-JA.md @@ -6,7 +6,7 @@


- ドキュメントを見る + ドキュメントを探索 (wip) · 不和 · @@ -62,36 +62,39 @@ Julep プロジェクトに新しい貢献者を迎えられることを嬉し -

📖 Table of Contents

- -- [主な特徴](#%E4%B8%BB%E3%81%AA%E7%89%B9%E5%BE%B4) -- [簡単な例](#%E7%B0%A1%E5%8D%98%E3%81%AA%E4%BE%8B) -- [インストール](#%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB) -- [Python クイックスタート 🐍](#python-%E3%82%AF%E3%82%A4%E3%83%83%E3%82%AF%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88-) -- [Node.js Quick Start 🟩](#nodejs-quick-start-) - - [Step 1: Create an Agent](#step-1-create-an-agent) -- [Components](#components) - - [Mental Model](#mental-model) -- [Concepts](#concepts) -- [Understanding Tasks](#understanding-tasks) - - [Lifecycle of a Task](#lifecycle-of-a-task) - - [Types of Workflow Steps](#types-of-workflow-steps) -- [Tool Types](#tool-types) - - [User-defined `functions`](#user-defined-functions) - - [`system` tools](#system-tools) - - [Built-in `integrations`](#built-in-integrations) - - [Direct `api_calls`](#direct-api_calls) -- [Integrations](#integrations) -- [Other Features](#other-features) - - [Adding Tools to Agents](#adding-tools-to-agents) - - [Managing Sessions and Users](#managing-sessions-and-users) - - [Document Integration and Search](#document-integration-and-search) - - [SDK リファレンス](#sdk-%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9) - - [API リファレンス](#api-%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9) -- [ローカルクイックスタート](#%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%82%AF%E3%82%A4%E3%83%83%E3%82%AF%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88) -- [Julep と LangChain などの違いは何ですか?](#julep-%E3%81%A8-langchain-%E3%81%AA%E3%81%A9%E3%81%AE%E9%81%95%E3%81%84%E3%81%AF%E4%BD%95%E3%81%A7%E3%81%99%E3%81%8B) - - [さまざまなユースケース](#%E3%81%95%E3%81%BE%E3%81%96%E3%81%BE%E3%81%AA%E3%83%A6%E3%83%BC%E3%82%B9%E3%82%B1%E3%83%BC%E3%82%B9) - - [異なるフォームファクタ](#%E7%95%B0%E3%81%AA%E3%82%8B%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%83%95%E3%82%A1%E3%82%AF%E3%82%BF) +

📖 目次

+ +- [はじめに](#introduction) +- [主な特徴](#key-features) +- [簡単な例](#quick-example) +- [インストール](#installation) +- [Python クイックスタート 🐍](#python-quick-start-) +- [Node.js クイック スタート 🟩](#nodejs-quick-start-) +- [ステップ 1: エージェントを作成する](#step-1-create-an-agent) +- [コンポーネント](#components) +- [メンタルモデル](#mental-model) +- [コンセプト](#concepts) +- [タスクの理解](#understanding-tasks) +- [タスクのライフサイクル](#lifecycle-of-a-task) +- [ワークフロー ステップの種類](#types-of-workflow-steps) +- [ツールの種類](#tool-types) +- [ユーザー定義の `functions`](#user-defined-functions) +- [`システム` ツール](#system-tools) +- [組み込みの `integrations`](#built-in-integrations) +- [直接の `api_calls`](#direct-api_calls) +- [統合](#integrations) +- [その他の機能](#other-features) +- [エージェントへのツールの追加](#adding-tools-to-agents) +- [セッションとユーザーの管理](#managing-sessions-and-users) +- [ドキュメントの統合と検索](#document-integration-and-search) +- [参考](#reference) +- [SDKリファレンス](#sdk-reference) +- [APIリファレンス](#api-reference) +- [ローカルクイックスタート](#local-quickstart) +- [Julep と LangChain などの違いは何ですか?](#whats-the-difference-between-julep-and-langchain-etc) +- [さまざまなユースケース](#different-use-cases) +- [異なるフォームファクター](#different-form-factor) +- [要約](#in-summary) @@ -107,7 +110,7 @@ Julep を使用すると、意思決定、ループ、並列処理、多数の - モデルの出力に基づいて意思決定を行う - 平行枝を生成し、 - たくさんのツールを使い、 -- 長時間走る。 +- 長時間実行します。 > [!ヒント] > 単純な質問に答えるだけでなく、複雑なタスクを処理し、過去のやり取りを記憶し、場合によっては他のツールや API も使用できる AI エージェントを構築したいとします。そこで Julep の出番です。詳細については、[タスクの理解](#understanding-tasks) をお読みください。 @@ -119,7 +122,7 @@ Julep を使用すると、意思決定、ループ、並列処理、多数の 3. 🔄 **複数ステップのタスク**: ループと意思決定を含む複雑な複数ステップのプロセスを構築します。 4. ⏳ **タスク管理**: 無期限に実行される可能性のある長時間実行タスクを処理します。 5. 🛠️ **組み込みツール**: タスクで組み込みツールと外部 API を使用します。 -6. 🔧 **自己修復**: Julep は失敗したステップを自動的に再試行し、メッセージを再送信し、タスクがスムーズに実行されるようにします。 +6. 🔧 **自己修復**: Julep は失敗したステップを自動的に再試行し、メッセージを再送信し、一般的にタスクがスムーズに実行されるようにします。 7. 📚 **RAG**: Julep のドキュメント ストアを使用して、独自のデータを取得して使用するためのシステムを構築します。 ![機能](https://github.com/user-attachments/assets/4355cbae-fcbd-4510-ac0d-f8f77b73af70) @@ -394,7 +397,7 @@ plot_ideas: load_yaml(_.split('```yaml')[1].split('```')[0].ストリップ()) Think about the plot ideas critically. Combine the plot ideas with the results from Wikipedia to create a detailed plot for a story. Write down all your notes and thoughts. - Then finally write the plot as a yaml object inside ```レスポンスの最後に yaml タグを追加します。yaml オブジェクトの構造は次のようになります。 + Then finally write the plot as a yaml object inside ```応答の最後に yaml タグを追加します。yaml オブジェクトの構造は次のようになります。 ```yaml title: "" @@ -1457,7 +1460,7 @@ context_overflow="適応型" # 同じセッションで会話を続ける レスポンス = client.sessions.chat( -セッションID=セッションID、 +session_id=セッションID、 メッセージ=[ { 「役割」: 「ユーザー」、 From 7aec8fd8eb5dfdcd2842b3827e5e8c44ffd89c8c Mon Sep 17 00:00:00 2001 From: Dmitry Paramonov Date: Wed, 30 Oct 2024 14:56:55 +0300 Subject: [PATCH 07/12] chore: Re-generate lockfile --- agents-api/poetry.lock | 62 ++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/agents-api/poetry.lock b/agents-api/poetry.lock index 7c990c5a8..70ed468ac 100644 --- a/agents-api/poetry.lock +++ b/agents-api/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -415,21 +415,20 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "bleach" -version = "6.1.0" +version = "6.2.0" description = "An easy safelist-based HTML-sanitizing tool." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "bleach-6.1.0-py3-none-any.whl", hash = "sha256:3225f354cfc436b9789c66c4ee030194bee0568fbf9cbdad3bc8b5c26c5f12b6"}, - {file = "bleach-6.1.0.tar.gz", hash = "sha256:0a31f1837963c41d46bbf1331b8778e1308ea0791db03cc4e7357b97cf42a8fe"}, + {file = "bleach-6.2.0-py3-none-any.whl", hash = "sha256:117d9c6097a7c3d22fd578fcd8d35ff1e125df6736f554da4e432fdd63f31e5e"}, + {file = "bleach-6.2.0.tar.gz", hash = "sha256:123e894118b8a599fd80d3ec1a6d4cc7ce4e5882b1317a7e1ba69b56e95f991f"}, ] [package.dependencies] -six = ">=1.9.0" webencodings = "*" [package.extras] -css = ["tinycss2 (>=1.1.0,<1.3)"] +css = ["tinycss2 (>=1.1.0,<1.5)"] [[package]] name = "blis" @@ -474,17 +473,17 @@ numpy = ">=2.0.0,<3.0.0" [[package]] name = "boto3" -version = "1.35.50" +version = "1.35.51" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.35.50-py3-none-any.whl", hash = "sha256:14724b905fd13f26d9d8f7cdcea0fa65a9acad79f60f41f7662667f4e233d97c"}, - {file = "boto3-1.35.50.tar.gz", hash = "sha256:4f15d1ccb481d66f6925b8c91c970ce41b956b6ecf7c479f23e2159531b37eec"}, + {file = "boto3-1.35.51-py3-none-any.whl", hash = "sha256:c922f6a18958af9d8af0489d6d8503b517029d8159b26aa4859a8294561c72e9"}, + {file = "boto3-1.35.51.tar.gz", hash = "sha256:a57c6c7012ecb40c43e565a6f7a891f39efa990ff933eab63cd456f7501c2731"}, ] [package.dependencies] -botocore = ">=1.35.50,<1.36.0" +botocore = ">=1.35.51,<1.36.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -493,13 +492,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.35.50" +version = "1.35.51" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.35.50-py3-none-any.whl", hash = "sha256:965d3b99179ac04aa98e4c4baf4a970ebce77a5e02bb2a0a21cb6304e2bc0955"}, - {file = "botocore-1.35.50.tar.gz", hash = "sha256:136ecef8d5a1088f1ba485c0bbfca40abd42b9f9fe9e11d8cde4e53b4c05b188"}, + {file = "botocore-1.35.51-py3-none-any.whl", hash = "sha256:4d65b00111bd12b98e9f920ecab602cf619cc6a6d0be6e5dd53f517e4b92901c"}, + {file = "botocore-1.35.51.tar.gz", hash = "sha256:a9b3d1da76b3e896ad74605c01d88f596324a3337393d4bfbfa0d6c35822ca9c"}, ] [package.dependencies] @@ -941,10 +940,7 @@ inflect = ">=4.1.0,<6.0" isort = ">=4.3.21,<6.0" jinja2 = ">=2.10.1,<4.0" packaging = "*" -pydantic = [ - {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""}, - {version = ">=1.10.0,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"4.0\""}, -] +pydantic = {version = ">=1.10.0,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.4.0 || >2.4.0,<3.0", extras = ["email"], markers = "python_version >= \"3.12\" and python_version < \"4.0\""} pyyaml = ">=6.0.1" [package.extras] @@ -1907,13 +1903,13 @@ referencing = ">=0.31.0" [[package]] name = "julep" -version = "1.21.0" +version = "1.24.0" description = "The official Python library for the julep API" optional = false python-versions = ">=3.7" files = [ - {file = "julep-1.21.0-py3-none-any.whl", hash = "sha256:83a26ca5ce4517660e956d0ad6cf636882c7dc2a95c167ce11ae37670c86f3b3"}, - {file = "julep-1.21.0.tar.gz", hash = "sha256:72c7b24833a1fd59a073eec4c59071bc68af4879210d7c27a8a48f8e74cc07a3"}, + {file = "julep-1.24.0-py3-none-any.whl", hash = "sha256:6f9b12fcb5bda6bb6f390463e803b8bfbdbb46a05b581f8e74ceace7522a70e5"}, + {file = "julep-1.24.0.tar.gz", hash = "sha256:89e461af7c65b0a53c91ad40accee1d1d5204a932a482be0135e6b6f6496b41e"}, ] [package.dependencies] @@ -2226,13 +2222,13 @@ dev = ["Sphinx (>=5.1.1)", "black (==24.8.0)", "build (>=0.10.0)", "coverage[tom [[package]] name = "litellm" -version = "1.51.0" +version = "1.51.1" description = "Library to easily interface with LLM API providers" optional = false python-versions = "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8" files = [ - {file = "litellm-1.51.0-py3-none-any.whl", hash = "sha256:0b2c20d116834166c8440e5698d7d927dbcc78fcaa08ce0c5cbea2d0de55ec6c"}, - {file = "litellm-1.51.0.tar.gz", hash = "sha256:8bf648677ee145a8fe5054a2e3f3a34895b9ab65a6015e4b94efca7ef406f466"}, + {file = "litellm-1.51.1-py3-none-any.whl", hash = "sha256:1a389ca5b8ddd7a98d97ad229118d8323caeaaf9c1c5b79b1072edc2a18e773d"}, + {file = "litellm-1.51.1.tar.gz", hash = "sha256:ef9019bdd8bbad927e49696a300d03ea00b86721ebe7b62621c923f728e50d18"}, ] [package.dependencies] @@ -4723,23 +4719,23 @@ tornado = ["tornado (>=6)"] [[package]] name = "setuptools" -version = "75.2.0" +version = "75.3.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-75.2.0-py3-none-any.whl", hash = "sha256:a7fcb66f68b4d9e8e66b42f9876150a3371558f98fa32222ffaa5bced76406f8"}, - {file = "setuptools-75.2.0.tar.gz", hash = "sha256:753bb6ebf1f465a1912e19ed1d41f403a79173a9acf66a42e7e6aec45c3c16ec"}, + {file = "setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd"}, + {file = "setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686"}, ] [package.extras] check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.5.2)"] -core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.collections", "jaraco.functools", "jaraco.text (>=3.7)", "more-itertools", "more-itertools (>=8.8)", "packaging", "packaging (>=24)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.11.*)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test (>=5.5)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib-metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.12.*)", "pytest-mypy"] [[package]] name = "shellingham" @@ -5477,13 +5473,13 @@ typing-extensions = ">=3.7.4.3" [[package]] name = "types-protobuf" -version = "5.28.0.20240924" +version = "5.28.3.20241030" description = "Typing stubs for protobuf" optional = false python-versions = ">=3.8" files = [ - {file = "types-protobuf-5.28.0.20240924.tar.gz", hash = "sha256:d181af8a256e5a91ce8d5adb53496e880efd9144c7d54483e3653332b60296f0"}, - {file = "types_protobuf-5.28.0.20240924-py3-none-any.whl", hash = "sha256:5cecf612ccdefb7dc95f7a51fb502902f20fc2e6681cd500184aaa1b3931d6a7"}, + {file = "types-protobuf-5.28.3.20241030.tar.gz", hash = "sha256:f7e6b45845d75393fb41c0b3ce82c46d775f9771fae2097414a1dbfe5b51a988"}, + {file = "types_protobuf-5.28.3.20241030-py3-none-any.whl", hash = "sha256:f3dae16adf342d4fb5bb3673cabb22549a6252e5dd66fc52d8310b1a39c64ba9"}, ] [[package]] From f221b087f133baca582d5452132f604c79ee6d27 Mon Sep 17 00:00:00 2001 From: whiterabbit1983 Date: Wed, 30 Oct 2024 12:35:09 +0000 Subject: [PATCH 08/12] refactor: Lint agents-api (CI) --- agents-api/agents_api/workflows/task_execution/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents-api/agents_api/workflows/task_execution/__init__.py b/agents-api/agents_api/workflows/task_execution/__init__.py index adfccbd2b..520ae9c37 100644 --- a/agents-api/agents_api/workflows/task_execution/__init__.py +++ b/agents-api/agents_api/workflows/task_execution/__init__.py @@ -157,7 +157,7 @@ async def run_integration_call(tool_call: dict, context: StepContext): if integration_spec is None: raise ApplicationError(f"Integration {tool_name} not found") - + # FIXME: Refactor this # Tools that are not defined in the task spec have a different format if isinstance(integration_spec, TaskToolDef): From dce5988c9ec5cbe8ac794ddbb9c4aa3704bbe7c4 Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Wed, 30 Oct 2024 23:51:21 +0530 Subject: [PATCH 09/12] Update agents-api/agents_api/activities/task_steps/prompt_step.py Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- agents-api/agents_api/activities/task_steps/prompt_step.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index 936ba99f9..8f950626c 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -68,7 +68,7 @@ def make_function_call(tool: Tool) -> dict | None: "description": "The parameters to send with the request", }, "follow_redirects": { - "type": "bool", + "type": "boolean", "description": "Follow redirects", }, "timeout": { From 679b7e98c5d7e18aa85739055675d5c563d1d29d Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Wed, 30 Oct 2024 23:51:31 +0530 Subject: [PATCH 10/12] Update README-CN.md Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- README-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-CN.md b/README-CN.md index 301681124..c0290845f 100644 --- a/README-CN.md +++ b/README-CN.md @@ -81,7 +81,7 @@ - [用户定义的`函数`](#user-defined-functions) - [`系统` 工具](#system-tools) - [内置 `integrations`](#built-in-integrations) --[直接`api_calls`](#direct-api_calls) +- [直接`api_calls`](#direct-api_calls) - [集成](#integrations) - [其他功能](#other-features) - [向代理添加工具](#adding-tools-to-agents) From 3bc9911be6ca360b8b1e926092d43c21f30d243a Mon Sep 17 00:00:00 2001 From: Diwank Singh Tomer Date: Wed, 30 Oct 2024 20:26:12 -0400 Subject: [PATCH 11/12] chore: Ignore gaga files Signed-off-by: Diwank Singh Tomer --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d1d2ca75..749d94bea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store +*gaga* *.swp ngrok* .env* From d23d7b9bece844eff21c40f1c65d48f5dfa2e9d2 Mon Sep 17 00:00:00 2001 From: creatorrr Date: Thu, 31 Oct 2024 00:26:51 +0000 Subject: [PATCH 12/12] refactor: Lint agents-api (CI) --- agents-api/agents_api/activities/task_steps/prompt_step.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index b917b7ac9..1c8810427 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -1,5 +1,5 @@ -from datetime import datetime import os +from datetime import datetime from anthropic import Anthropic from anthropic.types.beta.beta_message import BetaMessage @@ -357,4 +357,4 @@ async def prompt_step(context: StepContext) -> StepOutcome: return StepOutcome( output=response_as_dict, next=None, - ) \ No newline at end of file + )