mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-03-15 08:18:19 +00:00
Compare commits
3 Commits
gl/chore/r
...
fix/unsafe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1c2572dd1 | ||
|
|
3e2ff5a9b3 | ||
|
|
fb2323b3de |
@@ -1,13 +1,27 @@
|
||||
# CodeInterpreterTool
|
||||
|
||||
## Description
|
||||
This tool is used to give the Agent the ability to run code (Python3) from the code generated by the Agent itself. The code is executed in a sandboxed environment, so it is safe to run any code.
|
||||
This tool is used to give the Agent the ability to run code (Python3) from the code generated by the Agent itself. The code is executed in a Docker container for secure isolation.
|
||||
|
||||
It is incredible useful since it allows the Agent to generate code, run it in the same environment, get the result and use it to make decisions.
|
||||
It is incredibly useful since it allows the Agent to generate code, run it in an isolated environment, get the result and use it to make decisions.
|
||||
|
||||
## ⚠️ Security Requirements
|
||||
|
||||
**Docker is REQUIRED** for safe code execution. The tool will refuse to execute code without Docker to prevent security vulnerabilities.
|
||||
|
||||
### Why Docker is Required
|
||||
|
||||
Previous versions included a "restricted sandbox" fallback when Docker was unavailable. This has been **removed** due to critical security vulnerabilities:
|
||||
|
||||
- The Python-based sandbox could be escaped via object introspection
|
||||
- Attackers could recover the original `__import__` function and access any module
|
||||
- This allowed arbitrary command execution on the host system
|
||||
|
||||
**Docker provides real process isolation** and is the only secure way to execute untrusted code.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Docker
|
||||
- **Docker (REQUIRED)** - Install from [docker.com](https://docs.docker.com/get-docker/)
|
||||
|
||||
## Installation
|
||||
Install the crewai_tools package
|
||||
@@ -17,7 +31,9 @@ pip install 'crewai[tools]'
|
||||
|
||||
## Example
|
||||
|
||||
Remember that when using this tool, the code must be generated by the Agent itself. The code must be a Python3 code. And it will take some time for the first time to run because it needs to build the Docker image.
|
||||
Remember that when using this tool, the code must be generated by the Agent itself. The code must be Python3 code. It will take some time the first time to run because it needs to build the Docker image.
|
||||
|
||||
### Basic Usage (Docker Container - Recommended)
|
||||
|
||||
```python
|
||||
from crewai_tools import CodeInterpreterTool
|
||||
@@ -28,7 +44,9 @@ Agent(
|
||||
)
|
||||
```
|
||||
|
||||
Or if you need to pass your own Dockerfile just do this
|
||||
### Custom Dockerfile
|
||||
|
||||
If you need to pass your own Dockerfile:
|
||||
|
||||
```python
|
||||
from crewai_tools import CodeInterpreterTool
|
||||
@@ -39,15 +57,39 @@ Agent(
|
||||
)
|
||||
```
|
||||
|
||||
If it is difficult to connect to docker daemon automatically (especially for macOS users), you can do this to setup docker host manually
|
||||
### Manual Docker Host Configuration
|
||||
|
||||
If it is difficult to connect to the Docker daemon automatically (especially for macOS users), you can set up the Docker host manually:
|
||||
|
||||
```python
|
||||
from crewai_tools import CodeInterpreterTool
|
||||
|
||||
Agent(
|
||||
...
|
||||
tools=[CodeInterpreterTool(user_docker_base_url="<Docker Host Base Url>",
|
||||
user_dockerfile_path="<Dockerfile_path>")],
|
||||
tools=[CodeInterpreterTool(
|
||||
user_docker_base_url="<Docker Host Base Url>",
|
||||
user_dockerfile_path="<Dockerfile_path>"
|
||||
)],
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
### Unsafe Mode (NOT RECOMMENDED)
|
||||
|
||||
If you absolutely cannot use Docker and **fully trust the code source**, you can use unsafe mode:
|
||||
|
||||
```python
|
||||
from crewai_tools import CodeInterpreterTool
|
||||
|
||||
# WARNING: Only use with fully trusted code!
|
||||
Agent(
|
||||
...
|
||||
tools=[CodeInterpreterTool(unsafe_mode=True)],
|
||||
)
|
||||
```
|
||||
|
||||
**⚠️ SECURITY WARNING:** `unsafe_mode=True` executes code directly on the host without any isolation. Only use this if:
|
||||
- You completely trust the code being executed
|
||||
- You understand the security risks
|
||||
- You cannot install Docker in your environment
|
||||
|
||||
For production use, **always use Docker** (the default mode).
|
||||
|
||||
@@ -8,6 +8,7 @@ potentially unsafe operations and importing restricted modules.
|
||||
import importlib.util
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from typing import Any, ClassVar, TypedDict
|
||||
|
||||
@@ -50,11 +51,16 @@ class CodeInterpreterSchema(BaseModel):
|
||||
|
||||
|
||||
class SandboxPython:
|
||||
"""A restricted Python execution environment for running code safely.
|
||||
"""INSECURE: A restricted Python execution environment with known vulnerabilities.
|
||||
|
||||
This class provides methods to safely execute Python code by restricting access to
|
||||
potentially dangerous modules and built-in functions. It creates a sandboxed
|
||||
environment where harmful operations are blocked.
|
||||
WARNING: This class does NOT provide real security isolation and is vulnerable to
|
||||
sandbox escape attacks via Python object introspection. Attackers can recover the
|
||||
original __import__ function and bypass all restrictions.
|
||||
|
||||
DO NOT USE for untrusted code execution. Use Docker containers instead.
|
||||
|
||||
This class attempts to restrict access to dangerous modules and built-in functions
|
||||
but provides no real security boundary against a motivated attacker.
|
||||
"""
|
||||
|
||||
BLOCKED_MODULES: ClassVar[set[str]] = {
|
||||
@@ -299,8 +305,8 @@ class CodeInterpreterTool(BaseTool):
|
||||
def run_code_safety(self, code: str, libraries_used: list[str]) -> str:
|
||||
"""Runs code in the safest available environment.
|
||||
|
||||
Attempts to run code in Docker if available, falls back to a restricted
|
||||
sandbox if Docker is not available.
|
||||
Requires Docker to be available for secure code execution. Fails closed
|
||||
if Docker is not available to prevent sandbox escape vulnerabilities.
|
||||
|
||||
Args:
|
||||
code: The Python code to execute as a string.
|
||||
@@ -308,10 +314,24 @@ class CodeInterpreterTool(BaseTool):
|
||||
|
||||
Returns:
|
||||
The output of the executed code as a string.
|
||||
|
||||
Raises:
|
||||
RuntimeError: If Docker is not available, as the restricted sandbox
|
||||
is vulnerable to escape attacks and should not be used
|
||||
for untrusted code execution.
|
||||
"""
|
||||
if self._check_docker_available():
|
||||
return self.run_code_in_docker(code, libraries_used)
|
||||
return self.run_code_in_restricted_sandbox(code)
|
||||
|
||||
error_msg = (
|
||||
"Docker is required for safe code execution but is not available. "
|
||||
"The restricted sandbox fallback has been removed due to security vulnerabilities "
|
||||
"that allow sandbox escape via Python object introspection. "
|
||||
"Please install Docker (https://docs.docker.com/get-docker/) or use unsafe_mode=True "
|
||||
"if you trust the code source and understand the security risks."
|
||||
)
|
||||
Printer.print(error_msg, color="bold_red")
|
||||
raise RuntimeError(error_msg)
|
||||
|
||||
def run_code_in_docker(self, code: str, libraries_used: list[str]) -> str:
|
||||
"""Runs Python code in a Docker container for safe isolation.
|
||||
@@ -342,10 +362,19 @@ class CodeInterpreterTool(BaseTool):
|
||||
|
||||
@staticmethod
|
||||
def run_code_in_restricted_sandbox(code: str) -> str:
|
||||
"""Runs Python code in a restricted sandbox environment.
|
||||
"""DEPRECATED AND INSECURE: Runs Python code in a restricted sandbox environment.
|
||||
|
||||
Executes the code with restricted access to potentially dangerous modules and
|
||||
built-in functions for basic safety when Docker is not available.
|
||||
WARNING: This method is vulnerable to sandbox escape attacks via Python object
|
||||
introspection and should NOT be used for untrusted code execution. It has been
|
||||
deprecated and is only kept for backward compatibility with trusted code.
|
||||
|
||||
The "restricted" environment can be bypassed by attackers who can:
|
||||
- Use object graph introspection to recover the original __import__ function
|
||||
- Access any Python module including os, subprocess, sys, etc.
|
||||
- Execute arbitrary commands on the host system
|
||||
|
||||
Use run_code_in_docker() for secure code execution, or run_code_unsafe()
|
||||
if you explicitly acknowledge the security risks.
|
||||
|
||||
Args:
|
||||
code: The Python code to execute as a string.
|
||||
@@ -354,7 +383,10 @@ class CodeInterpreterTool(BaseTool):
|
||||
The value of the 'result' variable from the executed code,
|
||||
or an error message if execution failed.
|
||||
"""
|
||||
Printer.print("Running code in restricted sandbox", color="yellow")
|
||||
Printer.print(
|
||||
"WARNING: Running code in INSECURE restricted sandbox (vulnerable to escape attacks)",
|
||||
color="bold_red"
|
||||
)
|
||||
exec_locals: dict[str, Any] = {}
|
||||
try:
|
||||
SandboxPython.exec(code=code, locals_=exec_locals)
|
||||
@@ -380,7 +412,7 @@ class CodeInterpreterTool(BaseTool):
|
||||
Printer.print("WARNING: Running code in unsafe mode", color="bold_magenta")
|
||||
# Install libraries on the host machine
|
||||
for library in libraries_used:
|
||||
os.system(f"pip install {library}") # noqa: S605
|
||||
subprocess.run([sys.executable, "-m", "pip", "install", library], check=False) # noqa: S603
|
||||
|
||||
# Execute the code
|
||||
try:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from unittest.mock import patch
|
||||
|
||||
from crewai_tools.tools.code_interpreter_tool.code_interpreter_tool import (
|
||||
@@ -76,24 +77,22 @@ print("This is line 2")"""
|
||||
)
|
||||
|
||||
|
||||
def test_restricted_sandbox_basic_code_execution(printer_mock, docker_unavailable_mock):
|
||||
"""Test basic code execution."""
|
||||
def test_docker_unavailable_raises_error(printer_mock, docker_unavailable_mock):
|
||||
"""Test that execution fails when Docker is unavailable in safe mode."""
|
||||
tool = CodeInterpreterTool()
|
||||
code = """
|
||||
result = 2 + 2
|
||||
print(result)
|
||||
"""
|
||||
result = tool.run(code=code, libraries_used=[])
|
||||
printer_mock.assert_called_with(
|
||||
"Running code in restricted sandbox", color="yellow"
|
||||
)
|
||||
assert result == 4
|
||||
with pytest.raises(RuntimeError) as exc_info:
|
||||
tool.run(code=code, libraries_used=[])
|
||||
|
||||
assert "Docker is required for safe code execution" in str(exc_info.value)
|
||||
assert "sandbox escape" in str(exc_info.value)
|
||||
|
||||
|
||||
def test_restricted_sandbox_running_with_blocked_modules(
|
||||
printer_mock, docker_unavailable_mock
|
||||
):
|
||||
"""Test that restricted modules cannot be imported."""
|
||||
def test_restricted_sandbox_running_with_blocked_modules():
|
||||
"""Test that restricted modules cannot be imported when using the deprecated sandbox directly."""
|
||||
tool = CodeInterpreterTool()
|
||||
restricted_modules = SandboxPython.BLOCKED_MODULES
|
||||
|
||||
@@ -102,18 +101,15 @@ def test_restricted_sandbox_running_with_blocked_modules(
|
||||
import {module}
|
||||
result = "Import succeeded"
|
||||
"""
|
||||
result = tool.run(code=code, libraries_used=[])
|
||||
printer_mock.assert_called_with(
|
||||
"Running code in restricted sandbox", color="yellow"
|
||||
)
|
||||
|
||||
# Note: run_code_in_restricted_sandbox is deprecated and insecure
|
||||
# This test verifies the old behavior but should not be used in production
|
||||
result = tool.run_code_in_restricted_sandbox(code)
|
||||
|
||||
assert f"An error occurred: Importing '{module}' is not allowed" in result
|
||||
|
||||
|
||||
def test_restricted_sandbox_running_with_blocked_builtins(
|
||||
printer_mock, docker_unavailable_mock
|
||||
):
|
||||
"""Test that restricted builtins are not available."""
|
||||
def test_restricted_sandbox_running_with_blocked_builtins():
|
||||
"""Test that restricted builtins are not available when using the deprecated sandbox directly."""
|
||||
tool = CodeInterpreterTool()
|
||||
restricted_builtins = SandboxPython.UNSAFE_BUILTINS
|
||||
|
||||
@@ -122,25 +118,23 @@ def test_restricted_sandbox_running_with_blocked_builtins(
|
||||
{builtin}("test")
|
||||
result = "Builtin available"
|
||||
"""
|
||||
result = tool.run(code=code, libraries_used=[])
|
||||
printer_mock.assert_called_with(
|
||||
"Running code in restricted sandbox", color="yellow"
|
||||
)
|
||||
# Note: run_code_in_restricted_sandbox is deprecated and insecure
|
||||
# This test verifies the old behavior but should not be used in production
|
||||
result = tool.run_code_in_restricted_sandbox(code)
|
||||
assert f"An error occurred: name '{builtin}' is not defined" in result
|
||||
|
||||
|
||||
def test_restricted_sandbox_running_with_no_result_variable(
|
||||
printer_mock, docker_unavailable_mock
|
||||
):
|
||||
"""Test behavior when no result variable is set."""
|
||||
"""Test behavior when no result variable is set in deprecated sandbox."""
|
||||
tool = CodeInterpreterTool()
|
||||
code = """
|
||||
x = 10
|
||||
"""
|
||||
result = tool.run(code=code, libraries_used=[])
|
||||
printer_mock.assert_called_with(
|
||||
"Running code in restricted sandbox", color="yellow"
|
||||
)
|
||||
# Note: run_code_in_restricted_sandbox is deprecated and insecure
|
||||
# This test verifies the old behavior but should not be used in production
|
||||
result = tool.run_code_in_restricted_sandbox(code)
|
||||
assert result == "No result variable found."
|
||||
|
||||
|
||||
@@ -159,6 +153,44 @@ x = 10
|
||||
assert result == "No result variable found."
|
||||
|
||||
|
||||
@patch("crewai_tools.tools.code_interpreter_tool.code_interpreter_tool.subprocess.run")
|
||||
def test_unsafe_mode_installs_libraries_without_shell(
|
||||
subprocess_run_mock, printer_mock, docker_unavailable_mock
|
||||
):
|
||||
"""Test that library installation uses subprocess.run with shell=False, not os.system."""
|
||||
tool = CodeInterpreterTool(unsafe_mode=True)
|
||||
code = "result = 1"
|
||||
libraries_used = ["numpy", "pandas"]
|
||||
|
||||
tool.run(code=code, libraries_used=libraries_used)
|
||||
|
||||
assert subprocess_run_mock.call_count == 2
|
||||
for call, library in zip(subprocess_run_mock.call_args_list, libraries_used):
|
||||
args, kwargs = call
|
||||
# Must be list form (no shell expansion possible)
|
||||
assert args[0] == [sys.executable, "-m", "pip", "install", library]
|
||||
# shell= must not be True (defaults to False)
|
||||
assert kwargs.get("shell", False) is False
|
||||
|
||||
|
||||
@patch("crewai_tools.tools.code_interpreter_tool.code_interpreter_tool.subprocess.run")
|
||||
def test_unsafe_mode_library_name_with_shell_metacharacters_does_not_invoke_shell(
|
||||
subprocess_run_mock, printer_mock, docker_unavailable_mock
|
||||
):
|
||||
"""Test that a malicious library name cannot inject shell commands."""
|
||||
tool = CodeInterpreterTool(unsafe_mode=True)
|
||||
code = "result = 1"
|
||||
malicious_library = "numpy; rm -rf /"
|
||||
|
||||
tool.run(code=code, libraries_used=[malicious_library])
|
||||
|
||||
subprocess_run_mock.assert_called_once()
|
||||
args, kwargs = subprocess_run_mock.call_args
|
||||
# The entire malicious string is passed as a single argument — no shell parsing
|
||||
assert args[0] == [sys.executable, "-m", "pip", "install", malicious_library]
|
||||
assert kwargs.get("shell", False) is False
|
||||
|
||||
|
||||
def test_unsafe_mode_running_unsafe_code(printer_mock, docker_unavailable_mock):
|
||||
"""Test behavior when no result variable is set."""
|
||||
tool = CodeInterpreterTool(unsafe_mode=True)
|
||||
@@ -172,3 +204,50 @@ result = eval("5/1")
|
||||
"WARNING: Running code in unsafe mode", color="bold_magenta"
|
||||
)
|
||||
assert 5.0 == result
|
||||
|
||||
|
||||
@pytest.mark.xfail(
|
||||
reason=(
|
||||
"run_code_in_restricted_sandbox is known to be vulnerable to sandbox "
|
||||
"escape via object introspection. This test encodes the desired secure "
|
||||
"behavior (no escape possible) and will start passing once the "
|
||||
"vulnerability is fixed or the function is removed."
|
||||
)
|
||||
)
|
||||
def test_sandbox_escape_vulnerability_demonstration(printer_mock):
|
||||
"""Demonstrate that the restricted sandbox is vulnerable to escape attacks.
|
||||
|
||||
This test shows that an attacker can use Python object introspection to bypass
|
||||
the restricted sandbox and access blocked modules like 'os'. This is why the
|
||||
sandbox should never be used for untrusted code execution.
|
||||
|
||||
NOTE: This test uses the deprecated run_code_in_restricted_sandbox directly
|
||||
to demonstrate the vulnerability. In production, Docker is now required.
|
||||
"""
|
||||
tool = CodeInterpreterTool()
|
||||
|
||||
# Classic Python sandbox escape via object introspection
|
||||
escape_code = """
|
||||
# Recover the real __import__ function via object introspection
|
||||
for cls in ().__class__.__bases__[0].__subclasses__():
|
||||
if cls.__name__ == 'catch_warnings':
|
||||
# Get the real builtins module
|
||||
real_builtins = cls()._module.__builtins__
|
||||
real_import = real_builtins['__import__']
|
||||
# Now we can import os and execute commands
|
||||
os = real_import('os')
|
||||
# Demonstrate we have escaped the sandbox
|
||||
result = "SANDBOX_ESCAPED" if hasattr(os, 'system') else "FAILED"
|
||||
break
|
||||
"""
|
||||
|
||||
# The deprecated sandbox is vulnerable to this attack
|
||||
result = tool.run_code_in_restricted_sandbox(escape_code)
|
||||
|
||||
# Desired behavior: the restricted sandbox should prevent this escape.
|
||||
# If this assertion fails, run_code_in_restricted_sandbox remains vulnerable.
|
||||
assert result != "SANDBOX_ESCAPED", (
|
||||
"The restricted sandbox was bypassed via object introspection. "
|
||||
"This indicates run_code_in_restricted_sandbox is still vulnerable and "
|
||||
"is why Docker is now required for safe code execution."
|
||||
)
|
||||
|
||||
@@ -1,104 +1,109 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Researcher. You''re
|
||||
love to sey howdy.\nYour personal goal is: Be super empathetic.\nTo give my
|
||||
best complete final answer to the task use the exact following format:\n\nThought:
|
||||
I now can give a great answer\nFinal Answer: Your final answer must be the great
|
||||
and the most complete as possible, it must be outcome described.\n\nI MUST use
|
||||
these formats, my job depends on it!"}, {"role": "user", "content": "\nCurrent
|
||||
Task: say howdy\n\nThis is the expect criteria for your final answer: Howdy!\nyou
|
||||
MUST return the actual complete content as the final answer, not a summary.\n\nBegin!
|
||||
This is VERY important to you, use the tools available and give your best Final
|
||||
Answer, your job depends on it!\n\nThought:"}], "model": "gpt-4o"}'
|
||||
body: '{"messages":[{"role":"system","content":"You are Researcher. You''re love
|
||||
to sey howdy.\nYour personal goal is: Be super empathetic."},{"role":"user","content":"\nCurrent
|
||||
Task: say howdy\n\nThis is the expected criteria for your final answer: Howdy!\nyou
|
||||
MUST return the actual complete content as the final answer, not a summary.\n\nProvide
|
||||
your complete response:"}],"model":"gpt-4.1-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '784'
|
||||
- '391'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- __cf_bm=9.8sBYBkvBR8R1K_bVF7xgU..80XKlEIg3N2OBbTSCU-1727214102-1.0.1.1-.qiTLXbPamYUMSuyNsOEB9jhGu.jOifujOrx9E2JZvStbIZ9RTIiE44xKKNfLPxQkOi6qAT3h6htK8lPDGV_5g;
|
||||
_cfuvid=lbRdAddVWV6W3f5Dm9SaOPWDUOxqtZBSPr_fTW26nEA-1727213194587-0.0.1.1-604800000
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.47.0
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 1.47.0
|
||||
x-stainless-raw-response:
|
||||
- 'true'
|
||||
- 1.83.0
|
||||
x-stainless-read-timeout:
|
||||
- X-STAINLESS-READ-TIMEOUT-XXX
|
||||
x-stainless-retry-count:
|
||||
- '0'
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.11.7
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-AB7cCuywn5zE7q0S8IXWVnXoVE81Y\",\n \"object\"\
|
||||
: \"chat.completion\",\n \"created\": 1727214244,\n \"model\": \"gpt-4o-2024-05-13\"\
|
||||
,\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \
|
||||
\ \"role\": \"assistant\",\n \"content\": \"I now can give a great\
|
||||
\ answer \\nFinal Answer: Howdy!\",\n \"refusal\": null\n },\n\
|
||||
\ \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n\
|
||||
\ \"usage\": {\n \"prompt_tokens\": 159,\n \"completion_tokens\": 14,\n\
|
||||
\ \"total_tokens\": 173,\n \"completion_tokens_details\": {\n \"\
|
||||
reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_a2ff031fb5\"\
|
||||
\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-DJVU3yUdUSuW0vgTcxubm9K2Q2cT6\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541627,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Howdy!\",\n \"refusal\": null,\n
|
||||
\ \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\":
|
||||
\"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 75,\n \"completion_tokens\":
|
||||
2,\n \"total_tokens\": 77,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
|
||||
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_db58fd2815\"\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 8c85f41ffdb81cf3-GRU
|
||||
CF-Ray:
|
||||
- 9dc813a23bf323dd-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 24 Sep 2024 21:44:04 GMT
|
||||
- Sun, 15 Mar 2026 02:27:07 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- X-Request-ID
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-organization:
|
||||
- crewai-iuxna1
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '243'
|
||||
- '366'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
set-cookie:
|
||||
- SET-COOKIE-XXX
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- '30000000'
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '29999815'
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- 0s
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- req_50ed3333fd70ce8e32abd43dbe7f9362
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
|
||||
@@ -39,13 +39,13 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-DIqrxbdWncBetSyqX8P36UUXoil9d\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773385505,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
string: "{\n \"id\": \"chatcmpl-DJVXy6jcneOpe2GdSSGfNO4TkB6np\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541870,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Test expected output\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
@@ -54,18 +54,18 @@ interactions:
|
||||
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_5e793402c9\"\n}\n"
|
||||
\"default\",\n \"system_fingerprint\": \"fp_db58fd2815\"\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-Ray:
|
||||
- 9db9302f7f411efc-EWR
|
||||
- 9dc819af5cbb8ce8-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Fri, 13 Mar 2026 07:05:06 GMT
|
||||
- Sun, 15 Mar 2026 02:31:10 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
@@ -81,7 +81,7 @@ interactions:
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '376'
|
||||
- '351'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
|
||||
@@ -7,22 +7,22 @@ interactions:
|
||||
Task: Produce and amazing 1 paragraph draft of an article about AI Agents.\n\nThis
|
||||
is the expected criteria for your final answer: A 4 paragraph article about
|
||||
AI.\nyou MUST return the actual complete content as the final answer, not a
|
||||
summary.\n\nThis is VERY important to you, your job depends on it!"}],"model":"gpt-4.1-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"Delegate_work_to_coworker","description":"Delegate
|
||||
summary."}],"model":"gpt-4.1-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"delegate_work_to_coworker","description":"Delegate
|
||||
a specific task to one of the following coworkers: Senior Writer\nThe input
|
||||
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
||||
context to execute the task, they know nothing about the task, so share absolutely
|
||||
everything you know, don''t reference things but instead explain them.","parameters":{"properties":{"task":{"description":"The
|
||||
everything you know, don''t reference things but instead explain them.","strict":true,"parameters":{"properties":{"task":{"description":"The
|
||||
task to delegate","title":"Task","type":"string"},"context":{"description":"The
|
||||
context for the task","title":"Context","type":"string"},"coworker":{"description":"The
|
||||
role/name of the coworker to delegate to","title":"Coworker","type":"string"}},"required":["task","context","coworker"],"type":"object"}}},{"type":"function","function":{"name":"Ask_question_to_coworker","description":"Ask
|
||||
role/name of the coworker to delegate to","title":"Coworker","type":"string"}},"required":["task","context","coworker"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"ask_question_to_coworker","description":"Ask
|
||||
a specific question to one of the following coworkers: Senior Writer\nThe input
|
||||
to this tool should be the coworker, the question you have for them, and ALL
|
||||
necessary context to ask the question properly, they know nothing about the
|
||||
question, so share absolutely everything you know, don''t reference things but
|
||||
instead explain them.","parameters":{"properties":{"question":{"description":"The
|
||||
instead explain them.","strict":true,"parameters":{"properties":{"question":{"description":"The
|
||||
question to ask","title":"Question","type":"string"},"context":{"description":"The
|
||||
context for the question","title":"Context","type":"string"},"coworker":{"description":"The
|
||||
role/name of the coworker to ask","title":"Coworker","type":"string"}},"required":["question","context","coworker"],"type":"object"}}}]}'
|
||||
role/name of the coworker to ask","title":"Coworker","type":"string"}},"required":["question","context","coworker"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -35,7 +35,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '2270'
|
||||
- '2298'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -57,48 +57,46 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D0uJLGWT3ELLQ84FugHD30N0rap1d\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1769108831,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
string: "{\n \"id\": \"chatcmpl-DJVUF1zvo6c1aeolU4hCgOK2XeUEK\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541639,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_j5vDsg6M6N1UbDUrQTZnwKia\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"Delegate_work_to_coworker\",\n
|
||||
\ \"arguments\": \"{\\\"coworker\\\":\\\"Senior Writer\\\",\\\"task\\\":\\\"Produce
|
||||
a 4-paragraph article about AI focusing on AI Agents, starting with a 1-paragraph
|
||||
draft. The article should be engaging, informative, and demonstrate a deep
|
||||
understanding of the topic, highlighting how AI Agents function, their applications,
|
||||
benefits and potential future developments.\\\",\\\"context\\\":\\\"The task
|
||||
is to produce an amazing 4-paragraph article about AI with a focus on AI Agents.
|
||||
The first deliverable is a 1-paragraph draft that sets the tone for the full
|
||||
article, emphasizing the significance and capabilities of AI Agents in modern
|
||||
technology. The final article should be coherent, seamlessly cover the topic,
|
||||
and be suitable for publication on a technology-focused platform.\\\"}\"\n
|
||||
\ }\n }\n ],\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 399,\n \"completion_tokens\":
|
||||
159,\n \"total_tokens\": 558,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
|
||||
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
\ \"id\": \"call_wi7jZ8PKxWMadJufpDtwfLF3\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"delegate_work_to_coworker\",\n
|
||||
\ \"arguments\": \"{\\\"task\\\":\\\"Produce an amazing 1 paragraph
|
||||
draft of an article about AI Agents. This paragraph should be engaging, informative,
|
||||
and provide a clear introduction to the topic of AI Agents, capturing the
|
||||
readers' interest and setting the stage for a longer article.\\\",\\\"context\\\":\\\"The
|
||||
article on AI Agents will be a 4 paragraph piece aiming to explain what AI
|
||||
Agents are, their functionalities, importance, and potential future developments.
|
||||
The draft paragraph should serve as a compelling introduction that hooks the
|
||||
audience and introduces the subject matter effectively.\\\",\\\"coworker\\\":\\\"Senior
|
||||
Writer\\\"}\"\n }\n }\n ],\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
386,\n \"completion_tokens\": 124,\n \"total_tokens\": 510,\n \"prompt_tokens_details\":
|
||||
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_376a7ccef1\"\n}\n"
|
||||
\"default\",\n \"system_fingerprint\": \"fp_5e793402c9\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-Ray:
|
||||
- 9dc8140db9f85f83-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Thu, 22 Jan 2026 19:07:14 GMT
|
||||
- Sun, 15 Mar 2026 02:27:20 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
@@ -109,18 +107,16 @@ interactions:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '2967'
|
||||
- '1331'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '2989'
|
||||
set-cookie:
|
||||
- SET-COOKIE-XXX
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
@@ -144,25 +140,18 @@ interactions:
|
||||
body: '{"messages":[{"role":"system","content":"You are Senior Writer. You''re
|
||||
a senior writer, specialized in technology, software engineering, AI and startups.
|
||||
You work as a freelancer and are now working on writing content for a new customer.\nYour
|
||||
personal goal is: Write the best content about AI and AI agents.\nTo give my
|
||||
best complete final answer to the task respond using the exact following format:\n\nThought:
|
||||
I now can give a great answer\nFinal Answer: Your final answer must be the great
|
||||
and the most complete as possible, it must be outcome described.\n\nI MUST use
|
||||
these formats, my job depends on it!"},{"role":"user","content":"\nCurrent Task:
|
||||
Produce a 4-paragraph article about AI focusing on AI Agents, starting with
|
||||
a 1-paragraph draft. The article should be engaging, informative, and demonstrate
|
||||
a deep understanding of the topic, highlighting how AI Agents function, their
|
||||
applications, benefits and potential future developments.\n\nThis is the expected
|
||||
criteria for your final answer: Your best answer to your coworker asking you
|
||||
this, accounting for the context shared.\nyou MUST return the actual complete
|
||||
content as the final answer, not a summary.\n\nThis is the context you''re working
|
||||
with:\nThe task is to produce an amazing 4-paragraph article about AI with a
|
||||
focus on AI Agents. The first deliverable is a 1-paragraph draft that sets the
|
||||
tone for the full article, emphasizing the significance and capabilities of
|
||||
AI Agents in modern technology. The final article should be coherent, seamlessly
|
||||
cover the topic, and be suitable for publication on a technology-focused platform.\n\nBegin!
|
||||
This is VERY important to you, use the tools available and give your best Final
|
||||
Answer, your job depends on it!\n\nThought:"}],"model":"gpt-4.1-mini"}'
|
||||
personal goal is: Write the best content about AI and AI agents."},{"role":"user","content":"\nCurrent
|
||||
Task: Produce an amazing 1 paragraph draft of an article about AI Agents. This
|
||||
paragraph should be engaging, informative, and provide a clear introduction
|
||||
to the topic of AI Agents, capturing the readers'' interest and setting the
|
||||
stage for a longer article.\n\nThis is the expected criteria for your final
|
||||
answer: Your best answer to your coworker asking you this, accounting for the
|
||||
context shared.\nyou MUST return the actual complete content as the final answer,
|
||||
not a summary.\n\nThis is the context you''re working with:\nThe article on
|
||||
AI Agents will be a 4 paragraph piece aiming to explain what AI Agents are,
|
||||
their functionalities, importance, and potential future developments. The draft
|
||||
paragraph should serve as a compelling introduction that hooks the audience
|
||||
and introduces the subject matter effectively.\n\nProvide your complete response:"}],"model":"gpt-4.1-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -175,7 +164,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1766'
|
||||
- '1228'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -197,53 +186,46 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D0uJOvgyklVDFe1l4S0ty6oMuhfak\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1769108834,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
string: "{\n \"id\": \"chatcmpl-DJVUHEhPlZEKRnV2LXW33Z2y5jZB6\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541641,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Thought: I now can give a great answer\\nFinal
|
||||
Answer: \\n\\nArtificial Intelligence (AI) agents have emerged as a transformative
|
||||
force in modern technology, redefining how machines interact with the world
|
||||
and assist humans in complex tasks. These autonomous systems are designed
|
||||
to perceive their environment, make decisions, and execute actions to achieve
|
||||
specific goals, often adapting in real-time to changing conditions. Unlike
|
||||
traditional software that follows pre-programmed instructions without deviation,
|
||||
AI agents exhibit a level of intelligence akin to decision-making entities,
|
||||
leveraging advanced algorithms in machine learning, natural language processing,
|
||||
and computer vision. From virtual assistants like Siri and Alexa to sophisticated
|
||||
industrial robots and predictive analytics systems, AI agents are not only
|
||||
enhancing efficiency but also opening new frontiers in automation and human-computer
|
||||
interaction. Their capacity to learn, reason, and self-improve positions them
|
||||
as pivotal enablers in sectors ranging from healthcare and finance to autonomous
|
||||
vehicles and smart cities, heralding a future where intelligent agents will
|
||||
seamlessly augment daily life and enterprise operations. This article delves
|
||||
into the inner workings of AI agents, explores their diverse applications,
|
||||
underscores their benefits, and envisions their evolving role in shaping the
|
||||
technological landscape.\",\n \"refusal\": null,\n \"annotations\":
|
||||
\"assistant\",\n \"content\": \"In the rapidly evolving landscape of
|
||||
artificial intelligence, AI agents stand out as transformative entities capable
|
||||
of perceiving their environment, making decisions, and autonomously executing
|
||||
tasks to achieve specific goals. Far beyond simple algorithms, these agents
|
||||
act as intelligent intermediaries that can range from virtual assistants managing
|
||||
our schedules to complex systems driving autonomous vehicles or optimizing
|
||||
supply chains. As AI agents increasingly integrate into daily life and business
|
||||
operations, understanding their core principles and potential impact is essential\u2014not
|
||||
just for tech enthusiasts but for anyone interested in how intelligent automation
|
||||
is reshaping our future. This article will explore what AI agents are, how
|
||||
they function, their growing significance across industries, and the exciting
|
||||
possibilities they hold on the horizon.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 340,\n \"completion_tokens\":
|
||||
233,\n \"total_tokens\": 573,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 222,\n \"completion_tokens\":
|
||||
137,\n \"total_tokens\": 359,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
|
||||
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_2191215734\"\n}\n"
|
||||
\"default\",\n \"system_fingerprint\": \"fp_5e793402c9\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-Ray:
|
||||
- 9dc814182b1c281b-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Thu, 22 Jan 2026 19:07:18 GMT
|
||||
- Sun, 15 Mar 2026 02:27:22 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
@@ -254,18 +236,16 @@ interactions:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3760'
|
||||
- '1582'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '3776'
|
||||
set-cookie:
|
||||
- SET-COOKIE-XXX
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
@@ -286,57 +266,50 @@ interactions:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are CEO. You''re an long time
|
||||
CEO of a content creation agency with a Senior Writer on the team. You''re now
|
||||
working on a new project and want to make sure the content produced is amazing.\nYour
|
||||
personal goal is: Make sure the writers in your company produce amazing content."},{"role":"user","content":"\nCurrent
|
||||
Task: Produce and amazing 1 paragraph draft of an article about AI Agents.\n\nThis
|
||||
is the expected criteria for your final answer: A 4 paragraph article about
|
||||
AI.\nyou MUST return the actual complete content as the final answer, not a
|
||||
summary.\n\nThis is VERY important to you, your job depends on it!"},{"role":"assistant","content":null,"tool_calls":[{"id":"call_j5vDsg6M6N1UbDUrQTZnwKia","type":"function","function":{"name":"Delegate_work_to_coworker","arguments":"{\"coworker\":\"Senior
|
||||
Writer\",\"task\":\"Produce a 4-paragraph article about AI focusing on AI Agents,
|
||||
starting with a 1-paragraph draft. The article should be engaging, informative,
|
||||
and demonstrate a deep understanding of the topic, highlighting how AI Agents
|
||||
function, their applications, benefits and potential future developments.\",\"context\":\"The
|
||||
task is to produce an amazing 4-paragraph article about AI with a focus on AI
|
||||
Agents. The first deliverable is a 1-paragraph draft that sets the tone for
|
||||
the full article, emphasizing the significance and capabilities of AI Agents
|
||||
in modern technology. The final article should be coherent, seamlessly cover
|
||||
the topic, and be suitable for publication on a technology-focused platform.\"}"}}]},{"role":"tool","tool_call_id":"call_j5vDsg6M6N1UbDUrQTZnwKia","content":"Artificial
|
||||
Intelligence (AI) agents have emerged as a transformative force in modern technology,
|
||||
redefining how machines interact with the world and assist humans in complex
|
||||
tasks. These autonomous systems are designed to perceive their environment,
|
||||
make decisions, and execute actions to achieve specific goals, often adapting
|
||||
in real-time to changing conditions. Unlike traditional software that follows
|
||||
pre-programmed instructions without deviation, AI agents exhibit a level of
|
||||
intelligence akin to decision-making entities, leveraging advanced algorithms
|
||||
in machine learning, natural language processing, and computer vision. From
|
||||
virtual assistants like Siri and Alexa to sophisticated industrial robots and
|
||||
predictive analytics systems, AI agents are not only enhancing efficiency but
|
||||
also opening new frontiers in automation and human-computer interaction. Their
|
||||
capacity to learn, reason, and self-improve positions them as pivotal enablers
|
||||
in sectors ranging from healthcare and finance to autonomous vehicles and smart
|
||||
cities, heralding a future where intelligent agents will seamlessly augment
|
||||
daily life and enterprise operations. This article delves into the inner workings
|
||||
of AI agents, explores their diverse applications, underscores their benefits,
|
||||
and envisions their evolving role in shaping the technological landscape."},{"role":"user","content":"Analyze
|
||||
body: "{\"messages\":[{\"role\":\"system\",\"content\":\"You are CEO. You're an
|
||||
long time CEO of a content creation agency with a Senior Writer on the team.
|
||||
You're now working on a new project and want to make sure the content produced
|
||||
is amazing.\\nYour personal goal is: Make sure the writers in your company produce
|
||||
amazing content.\"},{\"role\":\"user\",\"content\":\"\\nCurrent Task: Produce
|
||||
and amazing 1 paragraph draft of an article about AI Agents.\\n\\nThis is the
|
||||
expected criteria for your final answer: A 4 paragraph article about AI.\\nyou
|
||||
MUST return the actual complete content as the final answer, not a summary.\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"call_wi7jZ8PKxWMadJufpDtwfLF3\",\"type\":\"function\",\"function\":{\"name\":\"delegate_work_to_coworker\",\"arguments\":\"{\\\"task\\\":\\\"Produce
|
||||
an amazing 1 paragraph draft of an article about AI Agents. This paragraph should
|
||||
be engaging, informative, and provide a clear introduction to the topic of AI
|
||||
Agents, capturing the readers' interest and setting the stage for a longer article.\\\",\\\"context\\\":\\\"The
|
||||
article on AI Agents will be a 4 paragraph piece aiming to explain what AI Agents
|
||||
are, their functionalities, importance, and potential future developments. The
|
||||
draft paragraph should serve as a compelling introduction that hooks the audience
|
||||
and introduces the subject matter effectively.\\\",\\\"coworker\\\":\\\"Senior
|
||||
Writer\\\"}\"}}]},{\"role\":\"tool\",\"tool_call_id\":\"call_wi7jZ8PKxWMadJufpDtwfLF3\",\"name\":\"delegate_work_to_coworker\",\"content\":\"In
|
||||
the rapidly evolving landscape of artificial intelligence, AI agents stand out
|
||||
as transformative entities capable of perceiving their environment, making decisions,
|
||||
and autonomously executing tasks to achieve specific goals. Far beyond simple
|
||||
algorithms, these agents act as intelligent intermediaries that can range from
|
||||
virtual assistants managing our schedules to complex systems driving autonomous
|
||||
vehicles or optimizing supply chains. As AI agents increasingly integrate into
|
||||
daily life and business operations, understanding their core principles and
|
||||
potential impact is essential\u2014not just for tech enthusiasts but for anyone
|
||||
interested in how intelligent automation is reshaping our future. This article
|
||||
will explore what AI agents are, how they function, their growing significance
|
||||
across industries, and the exciting possibilities they hold on the horizon.\"},{\"role\":\"user\",\"content\":\"Analyze
|
||||
the tool result. If requirements are met, provide the Final Answer. Otherwise,
|
||||
call the next tool. Deliver only the answer without meta-commentary."}],"model":"gpt-4.1-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"Delegate_work_to_coworker","description":"Delegate
|
||||
a specific task to one of the following coworkers: Senior Writer\nThe input
|
||||
call the next tool. Deliver only the answer without meta-commentary.\"}],\"model\":\"gpt-4.1-mini\",\"tool_choice\":\"auto\",\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"delegate_work_to_coworker\",\"description\":\"Delegate
|
||||
a specific task to one of the following coworkers: Senior Writer\\nThe input
|
||||
to this tool should be the coworker, the task you want them to do, and ALL necessary
|
||||
context to execute the task, they know nothing about the task, so share absolutely
|
||||
everything you know, don''t reference things but instead explain them.","parameters":{"properties":{"task":{"description":"The
|
||||
task to delegate","title":"Task","type":"string"},"context":{"description":"The
|
||||
context for the task","title":"Context","type":"string"},"coworker":{"description":"The
|
||||
role/name of the coworker to delegate to","title":"Coworker","type":"string"}},"required":["task","context","coworker"],"type":"object"}}},{"type":"function","function":{"name":"Ask_question_to_coworker","description":"Ask
|
||||
a specific question to one of the following coworkers: Senior Writer\nThe input
|
||||
everything you know, don't reference things but instead explain them.\",\"strict\":true,\"parameters\":{\"properties\":{\"task\":{\"description\":\"The
|
||||
task to delegate\",\"title\":\"Task\",\"type\":\"string\"},\"context\":{\"description\":\"The
|
||||
context for the task\",\"title\":\"Context\",\"type\":\"string\"},\"coworker\":{\"description\":\"The
|
||||
role/name of the coworker to delegate to\",\"title\":\"Coworker\",\"type\":\"string\"}},\"required\":[\"task\",\"context\",\"coworker\"],\"type\":\"object\",\"additionalProperties\":false}}},{\"type\":\"function\",\"function\":{\"name\":\"ask_question_to_coworker\",\"description\":\"Ask
|
||||
a specific question to one of the following coworkers: Senior Writer\\nThe input
|
||||
to this tool should be the coworker, the question you have for them, and ALL
|
||||
necessary context to ask the question properly, they know nothing about the
|
||||
question, so share absolutely everything you know, don''t reference things but
|
||||
instead explain them.","parameters":{"properties":{"question":{"description":"The
|
||||
question to ask","title":"Question","type":"string"},"context":{"description":"The
|
||||
context for the question","title":"Context","type":"string"},"coworker":{"description":"The
|
||||
role/name of the coworker to ask","title":"Coworker","type":"string"}},"required":["question","context","coworker"],"type":"object"}}}]}'
|
||||
question, so share absolutely everything you know, don't reference things but
|
||||
instead explain them.\",\"strict\":true,\"parameters\":{\"properties\":{\"question\":{\"description\":\"The
|
||||
question to ask\",\"title\":\"Question\",\"type\":\"string\"},\"context\":{\"description\":\"The
|
||||
context for the question\",\"title\":\"Context\",\"type\":\"string\"},\"coworker\":{\"description\":\"The
|
||||
role/name of the coworker to ask\",\"title\":\"Coworker\",\"type\":\"string\"}},\"required\":[\"question\",\"context\",\"coworker\"],\"type\":\"object\",\"additionalProperties\":false}}}]}"
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -349,7 +322,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '4785'
|
||||
- '4241'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
@@ -373,81 +346,67 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D0uJShynrNj5AQsUdLGMcR3mi57nv\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1769108838,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
string: "{\n \"id\": \"chatcmpl-DJVUIWVgzE4ZVBGyKaXO2HDAhJvSL\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541642,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Artificial Intelligence (AI) agents
|
||||
have emerged as a transformative force in modern technology, redefining how
|
||||
machines interact with the world and assist humans in complex tasks. These
|
||||
autonomous systems are designed to perceive their environment, make decisions,
|
||||
and execute actions to achieve specific goals, often adapting in real-time
|
||||
to changing conditions. Unlike traditional software that follows pre-programmed
|
||||
instructions without deviation, AI agents exhibit a level of intelligence
|
||||
akin to decision-making entities, leveraging advanced algorithms in machine
|
||||
learning, natural language processing, and computer vision. From virtual assistants
|
||||
like Siri and Alexa to sophisticated industrial robots and predictive analytics
|
||||
systems, AI agents are not only enhancing efficiency but also opening new
|
||||
frontiers in automation and human-computer interaction. Their capacity to
|
||||
learn, reason, and self-improve positions them as pivotal enablers in sectors
|
||||
ranging from healthcare and finance to autonomous vehicles and smart cities,
|
||||
heralding a future where intelligent agents will seamlessly augment daily
|
||||
life and enterprise operations. This article delves into the inner workings
|
||||
of AI agents, explores their diverse applications, underscores their benefits,
|
||||
and envisions their evolving role in shaping the technological landscape.
|
||||
\\n\\nAt the core, AI agents function by integrating sensory data with algorithms
|
||||
that mimic human cognition, enabling them to interpret complex inputs and
|
||||
make autonomous decisions. These agents operate through a cycle of perception,
|
||||
reasoning, and action: perceiving their environment via sensors or input data;
|
||||
processing this information through models that predict outcomes and strategize
|
||||
moves; and finally, executing actions that influence or interact with the
|
||||
external world. Machine learning plays a critical role, allowing agents to
|
||||
improve their performance based on experience without explicit reprogramming.
|
||||
Reinforcement learning, a subset of machine learning, teaches agents to learn
|
||||
optimal behaviors by rewarding desirable outcomes. This intelligent adaptability
|
||||
makes AI agents valuable in dynamic and unpredictable environments, where
|
||||
rules and conditions continuously evolve.\\n\\nThe applications of AI agents
|
||||
are vast and growing rapidly, spanning various industries and daily life realms.
|
||||
In healthcare, AI agents support diagnostics, personalized treatment plans,
|
||||
and patient monitoring, aiding doctors with data-driven insights. In finance,
|
||||
they power algorithmic trading, fraud detection, and customer service chatbots.
|
||||
Autonomous vehicles rely heavily on AI agents to navigate, interpret traffic
|
||||
signals, and ensure passenger safety. Smart homes use these agents for energy
|
||||
management and security, while industries deploy them in robotics for assembly
|
||||
lines and quality control. These agents' ability to automate routine and complex
|
||||
tasks leads to significant cost savings, higher precision, and scalability,
|
||||
improving overall productivity and opening innovative business models.\\n\\nLooking
|
||||
ahead, the evolution of AI agents promises even more profound impacts, with
|
||||
advances in explainability, ethics, and collaboration between human and machine
|
||||
intelligence. Future agents will likely be more transparent, offering clearer
|
||||
reasoning for their decisions, which builds trust and accountability. Enhanced
|
||||
multi-agent systems could coordinate complex tasks by sharing knowledge and
|
||||
collaborating seamlessly. Moreover, ongoing research aims to ensure ethical
|
||||
considerations are embedded from the ground up, addressing biases and safeguarding
|
||||
privacy. As AI agents become increasingly integrated into society, they will
|
||||
not only augment human abilities but also inspire new forms of creativity,
|
||||
problem-solving, and interaction, ultimately shaping a more intelligent and
|
||||
adaptive world.\",\n \"refusal\": null,\n \"annotations\": []\n
|
||||
\ },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n
|
||||
\ ],\n \"usage\": {\n \"prompt_tokens\": 825,\n \"completion_tokens\":
|
||||
625,\n \"total_tokens\": 1450,\n \"prompt_tokens_details\": {\n \"cached_tokens\":
|
||||
0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
\"assistant\",\n \"content\": \"AI Agents: Transforming the Future
|
||||
with Intelligent Automation\\n\\nIn the rapidly evolving landscape of artificial
|
||||
intelligence, AI agents stand out as transformative entities capable of perceiving
|
||||
their environment, making decisions, and autonomously executing tasks to achieve
|
||||
specific goals. Far beyond simple algorithms, these agents act as intelligent
|
||||
intermediaries that can range from virtual assistants managing our schedules
|
||||
to complex systems driving autonomous vehicles or optimizing supply chains.
|
||||
As AI agents increasingly integrate into daily life and business operations,
|
||||
understanding their core principles and potential impact is essential\u2014not
|
||||
just for tech enthusiasts but for anyone interested in how intelligent automation
|
||||
is reshaping our future. This article will explore what AI agents are, how
|
||||
they function, their growing significance across industries, and the exciting
|
||||
possibilities they hold on the horizon.\\n\\nAI agents operate by utilizing
|
||||
a combination of machine learning, natural language processing, and decision-making
|
||||
algorithms to interpret data, recognize patterns, and perform actions based
|
||||
on their programming and learning experiences. These intelligent entities
|
||||
can adapt to new information, improve their performance over time, and interact
|
||||
with humans or other systems in a meaningful way. From customer service chatbots
|
||||
that provide personalized support to AI-powered diagnostics in healthcare,
|
||||
the versatility of AI agents highlights their capacity to enhance efficiency
|
||||
and innovation across countless fields.\\n\\nThe importance of AI agents extends
|
||||
beyond automation. They hold the promise of solving complex problems, augmenting
|
||||
human capabilities, and making real-time decisions in environments where speed
|
||||
and accuracy are critical. Industries such as finance, logistics, manufacturing,
|
||||
and entertainment are experiencing disruptive changes driven by AI agents
|
||||
that help optimize resources, reduce costs, and create new value propositions.
|
||||
Moreover, ethical considerations and responsible development practices are
|
||||
crucial to ensure these technologies benefit society while minimizing risks
|
||||
and biases.\\n\\nLooking ahead, the future of AI agents is brimming with potential.
|
||||
Advances in explainability, generalization, and collaboration between multiple
|
||||
agents could lead to even more sophisticated systems capable of tackling challenges
|
||||
that were once thought to be exclusively human domains. As AI agents continue
|
||||
to evolve, their integration into everyday life will deepen, transforming
|
||||
how we work, communicate, and solve problems\u2014ushering in a new era of
|
||||
intelligent technology that empowers individuals and organizations alike.\",\n
|
||||
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
|
||||
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
695,\n \"completion_tokens\": 428,\n \"total_tokens\": 1123,\n \"prompt_tokens_details\":
|
||||
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_376a7ccef1\"\n}\n"
|
||||
\"default\",\n \"system_fingerprint\": \"fp_5e793402c9\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-Ray:
|
||||
- 9dc814239fb65f83-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Thu, 22 Jan 2026 19:07:28 GMT
|
||||
- Sun, 15 Mar 2026 02:27:28 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
@@ -460,18 +419,14 @@ interactions:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '9924'
|
||||
- '4942'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '9940'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,247 +1,123 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Researcher. You''re
|
||||
an expert researcher, specialized in technology, software engineering, AI and
|
||||
startups. You work as a freelancer and is now working on doing research and
|
||||
analysis for a new customer.\nYour personal goal is: Make the best research
|
||||
and analysis on content about AI and AI agents\nYou ONLY have access to the
|
||||
following tools, and should NEVER make up tools that are not listed here:\n\nTool
|
||||
Name: Another Test Tool\nTool Arguments: {''query'': {''description'': ''Query
|
||||
to process'', ''type'': ''str''}}\nTool Description: Another test tool\n\nUse
|
||||
the following format:\n\nThought: you should always think about what to do\nAction:
|
||||
the action to take, only one name of [Another Test Tool], just the name, exactly
|
||||
as it''s written.\nAction Input: the input to the action, just a simple python
|
||||
dictionary, enclosed in curly braces, using \" to wrap keys and values.\nObservation:
|
||||
the result of the action\n\nOnce all necessary information is gathered:\n\nThought:
|
||||
I now know the final answer\nFinal Answer: the final answer to the original
|
||||
input question"}, {"role": "user", "content": "\nCurrent Task: Write a test
|
||||
task\n\nThis is the expect criteria for your final answer: Test output\nyou
|
||||
MUST return the actual complete content as the final answer, not a summary.\n\nBegin!
|
||||
This is VERY important to you, use the tools available and give your best Final
|
||||
Answer, your job depends on it!\n\nThought:"}], "model": "gpt-4o", "stop": ["\nObservation:"],
|
||||
"stream": false}'
|
||||
body: '{"messages":[{"role":"system","content":"You are Researcher. You''re an
|
||||
expert researcher, specialized in technology, software engineering, AI and startups.
|
||||
You work as a freelancer and is now working on doing research and analysis for
|
||||
a new customer.\nYour personal goal is: Make the best research and analysis
|
||||
on content about AI and AI agents"},{"role":"user","content":"\nCurrent Task:
|
||||
Write a test task\n\nThis is the expected criteria for your final answer: Test
|
||||
output\nyou MUST return the actual complete content as the final answer, not
|
||||
a summary."}],"model":"gpt-4.1-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"another_test_tool","description":"Another
|
||||
test tool","strict":true,"parameters":{"properties":{"query":{"description":"Query
|
||||
to process","title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1525'
|
||||
- '892'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- _cfuvid=eQzzWvIXDS8Me1OIBdCG5F1qFyVfAo3sumvYRE7J41E-1734965710778-0.0.1.1-604800000
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.52.1
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 1.52.1
|
||||
x-stainless-raw-response:
|
||||
- 'true'
|
||||
- 1.83.0
|
||||
x-stainless-read-timeout:
|
||||
- X-STAINLESS-READ-TIMEOUT-XXX
|
||||
x-stainless-retry-count:
|
||||
- '0'
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.12.7
|
||||
- 3.13.12
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-AmjYyKbTn42DzaLVOjDvJpLubTjSq\",\n \"object\"\
|
||||
: \"chat.completion\",\n \"created\": 1736178252,\n \"model\": \"gpt-4o-2024-08-06\"\
|
||||
,\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \
|
||||
\ \"role\": \"assistant\",\n \"content\": \"Action: Another Test\
|
||||
\ Tool\\nAction Input: {\\\"query\\\": \\\"AI and AI agents\\\"}\",\n \
|
||||
\ \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\"\
|
||||
: \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 295,\n \
|
||||
\ \"completion_tokens\": 18,\n \"total_tokens\": 313,\n \"prompt_tokens_details\"\
|
||||
: {\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"\
|
||||
completion_tokens_details\": {\n \"reasoning_tokens\": 0,\n \"audio_tokens\"\
|
||||
: 0,\n \"accepted_prediction_tokens\": 0,\n \"rejected_prediction_tokens\"\
|
||||
: 0\n }\n },\n \"system_fingerprint\": \"fp_5f20662549\"\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-DJVYArMj7gxUpliUsjoQOzDxaw0Ta\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1773541882,\n \"model\": \"gpt-4.1-mini-2025-04-14\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Test Task: \\n\\nWrite a program in
|
||||
your preferred programming language that accomplishes the following:\\n\\n1.
|
||||
Accepts a list of integers as input.\\n2. Filters the list to include only
|
||||
prime numbers.\\n3. Sorts the filtered prime numbers in ascending order.\\n4.
|
||||
Outputs the sorted list of prime numbers.\\n\\nRequirements:\\n- Provide the
|
||||
complete source code.\\n- Include comments explaining the logic.\\n- Ensure
|
||||
the code handles invalid inputs gracefully.\\n- Test the program with at least
|
||||
three different input sets and show the outputs.\\n\\nExample:\\n\\nInput:
|
||||
[12, 7, 5, 18, 11, 3, 20]\\nOutput: [3, 5, 7, 11]\\n\\nPlease provide the
|
||||
full code along with sample input and output for verification.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
147,\n \"completion_tokens\": 157,\n \"total_tokens\": 304,\n \"prompt_tokens_details\":
|
||||
{\n \"cached_tokens\": 0,\n \"audio_tokens\": 0\n },\n \"completion_tokens_details\":
|
||||
{\n \"reasoning_tokens\": 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\":
|
||||
0,\n \"rejected_prediction_tokens\": 0\n }\n },\n \"service_tier\":
|
||||
\"default\",\n \"system_fingerprint\": \"fp_e76a310957\"\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 8fdcd3fc9a56bf66-ATL
|
||||
CF-Ray:
|
||||
- 9dc819faed93433f-EWR
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Mon, 06 Jan 2025 15:44:12 GMT
|
||||
- Sun, 15 Mar 2026 02:31:26 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- __cf_bm=X1fuDKrQrN8tU.uxjB0murgJXWXcPtlNLnD7xUrAKTs-1736178252-1.0.1.1-AME9VZZVtEpqX9.BEN_Kj9pI9uK3sIJc2LdbuPsP3wULKxF4Il6r8ghX0to2wpcYsGWbJXSqWP.dQz4vGf_Gbw;
|
||||
path=/; expires=Mon, 06-Jan-25 16:14:12 GMT; domain=.api.openai.com; HttpOnly;
|
||||
Secure; SameSite=None
|
||||
- _cfuvid=mv42xOepGYaNopc5ovT9Ajamw5rJrze8tlWTik8lfrk-1736178252935-0.0.1.1-604800000;
|
||||
path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- X-Request-ID
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-organization:
|
||||
- crewai-iuxna1
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '632'
|
||||
- '3681'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
set-cookie:
|
||||
- SET-COOKIE-XXX
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- '30000000'
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '29999644'
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- 0s
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- req_9276753b2200fc95c74fc43c9d7d84a6
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Researcher. You''re
|
||||
an expert researcher, specialized in technology, software engineering, AI and
|
||||
startups. You work as a freelancer and is now working on doing research and
|
||||
analysis for a new customer.\nYour personal goal is: Make the best research
|
||||
and analysis on content about AI and AI agents\nYou ONLY have access to the
|
||||
following tools, and should NEVER make up tools that are not listed here:\n\nTool
|
||||
Name: Another Test Tool\nTool Arguments: {''query'': {''description'': ''Query
|
||||
to process'', ''type'': ''str''}}\nTool Description: Another test tool\n\nUse
|
||||
the following format:\n\nThought: you should always think about what to do\nAction:
|
||||
the action to take, only one name of [Another Test Tool], just the name, exactly
|
||||
as it''s written.\nAction Input: the input to the action, just a simple python
|
||||
dictionary, enclosed in curly braces, using \" to wrap keys and values.\nObservation:
|
||||
the result of the action\n\nOnce all necessary information is gathered:\n\nThought:
|
||||
I now know the final answer\nFinal Answer: the final answer to the original
|
||||
input question"}, {"role": "user", "content": "\nCurrent Task: Write a test
|
||||
task\n\nThis is the expect criteria for your final answer: Test output\nyou
|
||||
MUST return the actual complete content as the final answer, not a summary.\n\nBegin!
|
||||
This is VERY important to you, use the tools available and give your best Final
|
||||
Answer, your job depends on it!\n\nThought:"}, {"role": "assistant", "content":
|
||||
"Action: Another Test Tool\nAction Input: {\"query\": \"AI and AI agents\"}\nObservation:
|
||||
Another processed: AI and AI agents"}], "model": "gpt-4o", "stop": ["\nObservation:"],
|
||||
"stream": false}'
|
||||
headers:
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- gzip, deflate
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1687'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- _cfuvid=mv42xOepGYaNopc5ovT9Ajamw5rJrze8tlWTik8lfrk-1736178252935-0.0.1.1-604800000;
|
||||
__cf_bm=X1fuDKrQrN8tU.uxjB0murgJXWXcPtlNLnD7xUrAKTs-1736178252-1.0.1.1-AME9VZZVtEpqX9.BEN_Kj9pI9uK3sIJc2LdbuPsP3wULKxF4Il6r8ghX0to2wpcYsGWbJXSqWP.dQz4vGf_Gbw
|
||||
host:
|
||||
- api.openai.com
|
||||
user-agent:
|
||||
- OpenAI/Python 1.52.1
|
||||
x-stainless-arch:
|
||||
- arm64
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- MacOS
|
||||
x-stainless-package-version:
|
||||
- 1.52.1
|
||||
x-stainless-raw-response:
|
||||
- 'true'
|
||||
x-stainless-retry-count:
|
||||
- '0'
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.12.7
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-AmjYzChV9s4D4qOJJvTvBAt3kRh7n\",\n \"object\"\
|
||||
: \"chat.completion\",\n \"created\": 1736178253,\n \"model\": \"gpt-4o-2024-08-06\"\
|
||||
,\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \
|
||||
\ \"role\": \"assistant\",\n \"content\": \"Thought: I now know\
|
||||
\ the final answer\\nFinal Answer: Another processed: AI and AI agents\",\n\
|
||||
\ \"refusal\": null\n },\n \"logprobs\": null,\n \"\
|
||||
finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\"\
|
||||
: 326,\n \"completion_tokens\": 19,\n \"total_tokens\": 345,\n \"\
|
||||
prompt_tokens_details\": {\n \"cached_tokens\": 0,\n \"audio_tokens\"\
|
||||
: 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\"\
|
||||
: 0,\n \"audio_tokens\": 0,\n \"accepted_prediction_tokens\": 0,\n\
|
||||
\ \"rejected_prediction_tokens\": 0\n }\n },\n \"system_fingerprint\"\
|
||||
: \"fp_5f20662549\"\n}\n"
|
||||
headers:
|
||||
CF-Cache-Status:
|
||||
- DYNAMIC
|
||||
CF-RAY:
|
||||
- 8fdcd4011938bf66-ATL
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Mon, 06 Jan 2025 15:44:15 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- nosniff
|
||||
access-control-expose-headers:
|
||||
- X-Request-ID
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
openai-organization:
|
||||
- crewai-iuxna1
|
||||
openai-processing-ms:
|
||||
- '2488'
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
strict-transport-security:
|
||||
- max-age=31536000; includeSubDomains; preload
|
||||
x-ratelimit-limit-requests:
|
||||
- '10000'
|
||||
x-ratelimit-limit-tokens:
|
||||
- '30000000'
|
||||
x-ratelimit-remaining-requests:
|
||||
- '9999'
|
||||
x-ratelimit-remaining-tokens:
|
||||
- '29999613'
|
||||
x-ratelimit-reset-requests:
|
||||
- 6ms
|
||||
x-ratelimit-reset-tokens:
|
||||
- 0s
|
||||
x-request-id:
|
||||
- req_5e3a1a90ef91ff4f12d5b84e396beccc
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user