mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-02-28 08:48:15 +00:00
Compare commits
11 Commits
lorenze/fe
...
matcha/opt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de8d28909c | ||
|
|
19b9b9da23 | ||
|
|
2327fd04a3 | ||
|
|
0bdc5a093e | ||
|
|
017189db78 | ||
|
|
02d911494f | ||
|
|
8102d0a6ca | ||
|
|
ee374d01de | ||
|
|
9914e51199 | ||
|
|
2dbb83ae31 | ||
|
|
7377e1aa26 |
@@ -21,7 +21,6 @@ OPENROUTER_API_KEY=fake-openrouter-key
|
||||
AWS_ACCESS_KEY_ID=fake-aws-access-key
|
||||
AWS_SECRET_ACCESS_KEY=fake-aws-secret-key
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_REGION_NAME=us-east-1
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Azure OpenAI Configuration
|
||||
|
||||
20
.github/workflows/build-uv-cache.yml
vendored
20
.github/workflows/build-uv-cache.yml
vendored
@@ -25,24 +25,12 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
- name: Install uv and populate cache
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
enable-cache: true
|
||||
|
||||
- name: Install dependencies and populate cache
|
||||
run: |
|
||||
echo "Building global UV cache for Python ${{ matrix.python-version }}..."
|
||||
uv sync --all-groups --all-extras --no-install-project
|
||||
echo "Cache populated successfully"
|
||||
|
||||
- name: Save uv caches
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-groups --all-extras --frozen --no-install-project
|
||||
|
||||
26
.github/workflows/linter.yml
vendored
26
.github/workflows/linter.yml
vendored
@@ -18,27 +18,15 @@ jobs:
|
||||
- name: Fetch Target Branch
|
||||
run: git fetch origin $TARGET_BRANCH --depth=1
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py3.11-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: "3.11"
|
||||
enable-cache: false
|
||||
enable-cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-groups --all-extras --no-install-project
|
||||
run: uv sync --all-groups --all-extras --frozen --no-install-project
|
||||
|
||||
- name: Get Changed Python Files
|
||||
id: changed-files
|
||||
@@ -57,13 +45,3 @@ jobs:
|
||||
| grep -v 'src/crewai/cli/templates/' \
|
||||
| grep -v '/tests/' \
|
||||
| xargs -I{} uv run ruff check "{}"
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py3.11-${{ hashFiles('uv.lock') }}
|
||||
|
||||
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -1,8 +1,6 @@
|
||||
name: Publish to PyPI
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [deployment-tests-passed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
@@ -20,11 +18,8 @@ jobs:
|
||||
- name: Determine release tag
|
||||
id: release
|
||||
run: |
|
||||
# Priority: workflow_dispatch input > repository_dispatch payload > default branch
|
||||
if [ -n "${{ inputs.release_tag }}" ]; then
|
||||
echo "tag=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
|
||||
elif [ -n "${{ github.event.client_payload.release_tag }}" ]; then
|
||||
echo "tag=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "tag=" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
99
.github/workflows/tests.yml
vendored
99
.github/workflows/tests.yml
vendored
@@ -1,47 +1,42 @@
|
||||
name: Run Tests
|
||||
|
||||
on: [pull_request]
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: tests-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: tests (${{ matrix.python-version }})
|
||||
name: tests (${{ matrix.python-version }}, ${{ matrix.group }}/4)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
group: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
group: [1, 2, 3, 4]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for proper diff
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
enable-cache: true
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --all-groups --all-extras
|
||||
run: uv sync --all-groups --all-extras --frozen
|
||||
|
||||
- name: Restore test durations
|
||||
uses: actions/cache/restore@v4
|
||||
@@ -49,52 +44,56 @@ jobs:
|
||||
path: .test_durations_py*
|
||||
key: test-durations-py${{ matrix.python-version }}
|
||||
|
||||
- name: Run tests (group ${{ matrix.group }} of 8)
|
||||
- name: Run tests (group ${{ matrix.group }} of 4)
|
||||
run: |
|
||||
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
|
||||
DURATION_FILE="../../.test_durations_py${PYTHON_VERSION_SAFE}"
|
||||
|
||||
# Temporarily always skip cached durations to fix test splitting
|
||||
# When durations don't match, pytest-split runs duplicate tests instead of splitting
|
||||
echo "Using even test splitting (duration cache disabled until fix merged)"
|
||||
DURATIONS_ARG=""
|
||||
if [ -f "$DURATION_FILE" ]; then
|
||||
if git diff "origin/${{ github.base_ref }}...HEAD" --name-only 2>/dev/null | grep -q "^lib/.*/tests/.*\.py$"; then
|
||||
echo "::notice::Test files changed — using even splitting"
|
||||
else
|
||||
echo "::notice::Using cached test durations for optimal splitting"
|
||||
DURATIONS_ARG="--durations-path=${DURATION_FILE}"
|
||||
fi
|
||||
else
|
||||
echo "::notice::No cached durations — using even splitting"
|
||||
fi
|
||||
|
||||
# Original logic (disabled temporarily):
|
||||
# if [ ! -f "$DURATION_FILE" ]; then
|
||||
# echo "No cached durations found, tests will be split evenly"
|
||||
# DURATIONS_ARG=""
|
||||
# elif git diff origin/${{ github.base_ref }}...HEAD --name-only 2>/dev/null | grep -q "^tests/.*\.py$"; then
|
||||
# echo "Test files have changed, skipping cached durations to avoid mismatches"
|
||||
# DURATIONS_ARG=""
|
||||
# else
|
||||
# echo "No test changes detected, using cached test durations for optimal splitting"
|
||||
# DURATIONS_ARG="--durations-path=${DURATION_FILE}"
|
||||
# fi
|
||||
|
||||
cd lib/crewai && uv run pytest \
|
||||
cd lib/crewai && uv run --frozen pytest \
|
||||
-vv \
|
||||
--splits 8 \
|
||||
--splits 4 \
|
||||
--group ${{ matrix.group }} \
|
||||
$DURATIONS_ARG \
|
||||
--splitting-algorithm least_duration \
|
||||
--durations=10 \
|
||||
--maxfail=3
|
||||
|
||||
- name: Run tool tests (group ${{ matrix.group }} of 8)
|
||||
- name: Run tool tests (group ${{ matrix.group }} of 4)
|
||||
run: |
|
||||
cd lib/crewai-tools && uv run pytest \
|
||||
cd lib/crewai-tools && uv run --frozen pytest \
|
||||
-vv \
|
||||
--splits 8 \
|
||||
--splits 4 \
|
||||
--group ${{ matrix.group }} \
|
||||
--durations=10 \
|
||||
--maxfail=3
|
||||
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
# Gate jobs matching required status checks in branch protection
|
||||
tests-gate:
|
||||
name: tests (${{ matrix.python-version }})
|
||||
needs: [tests]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- name: Check test results
|
||||
run: |
|
||||
if [ "${{ needs.tests.result }}" = "success" ]; then
|
||||
echo "All tests passed"
|
||||
else
|
||||
echo "Tests failed: ${{ needs.tests.result }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
18
.github/workflows/trigger-deployment-tests.yml
vendored
18
.github/workflows/trigger-deployment-tests.yml
vendored
@@ -1,18 +0,0 @@
|
||||
name: Trigger Deployment Tests
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
name: Trigger deployment tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger deployment tests
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ secrets.CREWAI_DEPLOYMENTS_PAT }}
|
||||
repository: ${{ secrets.CREWAI_DEPLOYMENTS_REPOSITORY }}
|
||||
event-type: crewai-release
|
||||
client-payload: '{"release_tag": "${{ github.event.release.tag_name }}", "release_name": "${{ github.event.release.name }}"}'
|
||||
30
.github/workflows/type-checker.yml
vendored
30
.github/workflows/type-checker.yml
vendored
@@ -20,27 +20,15 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0 # Fetch all history for proper diff
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
enable-cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --all-groups --all-extras
|
||||
run: uv sync --all-groups --all-extras --frozen
|
||||
|
||||
- name: Get changed Python files
|
||||
id: changed-files
|
||||
@@ -74,16 +62,6 @@ jobs:
|
||||
if: steps.changed-files.outputs.has_changes == 'false'
|
||||
run: echo "No Python files in src/ were modified - skipping type checks"
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
|
||||
# Summary job to provide single status for branch protection
|
||||
type-checker:
|
||||
name: type-checker
|
||||
@@ -94,8 +72,8 @@ jobs:
|
||||
- name: Check matrix results
|
||||
run: |
|
||||
if [ "${{ needs.type-checker-matrix.result }}" == "success" ] || [ "${{ needs.type-checker-matrix.result }}" == "skipped" ]; then
|
||||
echo "✅ All type checks passed"
|
||||
echo "All type checks passed"
|
||||
else
|
||||
echo "❌ Type checks failed"
|
||||
echo "Type checks failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
34
.github/workflows/update-test-durations.yml
vendored
34
.github/workflows/update-test-durations.yml
vendored
@@ -5,7 +5,9 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'tests/**/*.py'
|
||||
- 'lib/crewai/tests/**/*.py'
|
||||
- 'lib/crewai-tools/tests/**/*.py'
|
||||
- 'lib/crewai-files/tests/**/*.py'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -20,37 +22,25 @@ jobs:
|
||||
env:
|
||||
OPENAI_API_KEY: fake-api-key
|
||||
PYTHONUNBUFFERED: 1
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Restore global uv cache
|
||||
id: cache-restore
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
restore-keys: |
|
||||
uv-main-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
with:
|
||||
version: "0.8.4"
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: false
|
||||
enable-cache: true
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --all-groups --all-extras
|
||||
run: uv sync --all-groups --all-extras --frozen
|
||||
|
||||
- name: Run all tests and store durations
|
||||
run: |
|
||||
PYTHON_VERSION_SAFE=$(echo "${{ matrix.python-version }}" | tr '.' '_')
|
||||
uv run pytest --store-durations --durations-path=.test_durations_py${PYTHON_VERSION_SAFE} -n auto
|
||||
uv run --frozen pytest --store-durations --durations-path=.test_durations_py${PYTHON_VERSION_SAFE} -n auto
|
||||
continue-on-error: true
|
||||
|
||||
- name: Save durations to cache
|
||||
@@ -59,13 +49,3 @@ jobs:
|
||||
with:
|
||||
path: .test_durations_py*
|
||||
key: test-durations-py${{ matrix.python-version }}
|
||||
|
||||
- name: Save uv caches
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/uv
|
||||
~/.local/share/uv
|
||||
.venv
|
||||
key: uv-main-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
|
||||
2299
docs/docs.json
2299
docs/docs.json
File diff suppressed because it is too large
Load Diff
@@ -470,7 +470,7 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
To get an Express mode API key:
|
||||
- New Google Cloud users: Get an [express mode API key](https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstart?usertype=apikey)
|
||||
- Existing Google Cloud users: Get a [Google Cloud API key bound to a service account](https://cloud.google.com/docs/authentication/api-keys)
|
||||
|
||||
|
||||
For more details, see the [Vertex AI Express mode documentation](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/quickstart?usertype=apikey).
|
||||
</Info>
|
||||
|
||||
@@ -652,6 +652,7 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
# Optional
|
||||
AWS_SESSION_TOKEN=<your-session-token> # For temporary credentials
|
||||
AWS_DEFAULT_REGION=<your-region> # Defaults to us-east-1
|
||||
AWS_REGION_NAME=<your-region> # Alternative configuration for backwards compatibility with LiteLLM. Defaults to us-east-1
|
||||
```
|
||||
|
||||
**Basic Usage:**
|
||||
@@ -695,6 +696,7 @@ In this section, you'll find detailed examples that help you select, configure,
|
||||
- `AWS_SECRET_ACCESS_KEY`: AWS secret key (required)
|
||||
- `AWS_SESSION_TOKEN`: AWS session token for temporary credentials (optional)
|
||||
- `AWS_DEFAULT_REGION`: AWS region (defaults to `us-east-1`)
|
||||
- `AWS_REGION_NAME`: AWS region (defaults to `us-east-1`). Alternative configuration for backwards compatibility with LiteLLM
|
||||
|
||||
**Features:**
|
||||
- Native tool calling support via Converse API
|
||||
|
||||
@@ -177,6 +177,11 @@ You need to push your crew to a GitHub repository. If you haven't created a crew
|
||||

|
||||
</Frame>
|
||||
|
||||
<Info>
|
||||
Using private Python packages? You'll need to add your registry credentials here too.
|
||||
See [Private Package Registries](/en/enterprise/guides/private-package-registry) for the required variables.
|
||||
</Info>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Deploy Your Crew">
|
||||
|
||||
@@ -256,6 +256,12 @@ Before deployment, ensure you have:
|
||||
1. **LLM API keys** ready (OpenAI, Anthropic, Google, etc.)
|
||||
2. **Tool API keys** if using external tools (Serper, etc.)
|
||||
|
||||
<Info>
|
||||
If your project depends on packages from a **private PyPI registry**, you'll also need to configure
|
||||
registry authentication credentials as environment variables. See the
|
||||
[Private Package Registries](/en/enterprise/guides/private-package-registry) guide for details.
|
||||
</Info>
|
||||
|
||||
<Tip>
|
||||
Test your project locally with the same environment variables before deploying
|
||||
to catch configuration issues early.
|
||||
|
||||
263
docs/en/enterprise/guides/private-package-registry.mdx
Normal file
263
docs/en/enterprise/guides/private-package-registry.mdx
Normal file
@@ -0,0 +1,263 @@
|
||||
---
|
||||
title: "Private Package Registries"
|
||||
description: "Install private Python packages from authenticated PyPI registries in CrewAI AMP"
|
||||
icon: "lock"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Note>
|
||||
This guide covers how to configure your CrewAI project to install Python packages
|
||||
from private PyPI registries (Azure DevOps Artifacts, GitHub Packages, GitLab, AWS CodeArtifact, etc.)
|
||||
when deploying to CrewAI AMP.
|
||||
</Note>
|
||||
|
||||
## When You Need This
|
||||
|
||||
If your project depends on internal or proprietary Python packages hosted on a private registry
|
||||
rather than the public PyPI, you'll need to:
|
||||
|
||||
1. Tell UV **where** to find the package (an index URL)
|
||||
2. Tell UV **which** packages come from that index (a source mapping)
|
||||
3. Provide **credentials** so UV can authenticate during install
|
||||
|
||||
CrewAI AMP uses [UV](https://docs.astral.sh/uv/) for dependency resolution and installation.
|
||||
UV supports authenticated private registries through `pyproject.toml` configuration combined
|
||||
with environment variables for credentials.
|
||||
|
||||
## Step 1: Configure pyproject.toml
|
||||
|
||||
Three pieces work together in your `pyproject.toml`:
|
||||
|
||||
### 1a. Declare the dependency
|
||||
|
||||
Add the private package to your `[project.dependencies]` like any other dependency:
|
||||
|
||||
```toml
|
||||
[project]
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
```
|
||||
|
||||
### 1b. Define the index
|
||||
|
||||
Register your private registry as a named index under `[[tool.uv.index]]`:
|
||||
|
||||
```toml
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
```
|
||||
|
||||
<Info>
|
||||
The `name` field is important — UV uses it to construct the environment variable names
|
||||
for authentication (see [Step 2](#step-2-set-authentication-credentials) below).
|
||||
|
||||
Setting `explicit = true` means UV won't search this index for every package — only the
|
||||
ones you explicitly map to it in `[tool.uv.sources]`. This avoids unnecessary queries
|
||||
against your private registry and protects against dependency confusion attacks.
|
||||
</Info>
|
||||
|
||||
### 1c. Map the package to the index
|
||||
|
||||
Tell UV which packages should be resolved from your private index using `[tool.uv.sources]`:
|
||||
|
||||
```toml
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
### Complete example
|
||||
|
||||
```toml
|
||||
[project]
|
||||
name = "my-crew-project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.10,<=3.13"
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
|
||||
[tool.crewai]
|
||||
type = "crew"
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
After updating `pyproject.toml`, regenerate your lock file:
|
||||
|
||||
```bash
|
||||
uv lock
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Always commit the updated `uv.lock` along with your `pyproject.toml` changes.
|
||||
The lock file is required for deployment — see [Prepare for Deployment](/en/enterprise/guides/prepare-for-deployment).
|
||||
</Warning>
|
||||
|
||||
## Step 2: Set Authentication Credentials
|
||||
|
||||
UV authenticates against private indexes using environment variables that follow a naming convention
|
||||
based on the index name you defined in `pyproject.toml`:
|
||||
|
||||
```
|
||||
UV_INDEX_{UPPER_NAME}_USERNAME
|
||||
UV_INDEX_{UPPER_NAME}_PASSWORD
|
||||
```
|
||||
|
||||
Where `{UPPER_NAME}` is your index name converted to **uppercase** with **hyphens replaced by underscores**.
|
||||
|
||||
For example, an index named `my-private-registry` uses:
|
||||
|
||||
| Variable | Value |
|
||||
|----------|-------|
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME` | Your registry username or token name |
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD` | Your registry password or token/PAT |
|
||||
|
||||
<Warning>
|
||||
These environment variables **must** be added via the CrewAI AMP **Environment Variables** settings —
|
||||
either globally or at the deployment level. They cannot be set in `.env` files or hardcoded in your project.
|
||||
|
||||
See [Setting Environment Variables in AMP](#setting-environment-variables-in-amp) below.
|
||||
</Warning>
|
||||
|
||||
## Registry Provider Reference
|
||||
|
||||
The table below shows the index URL format and credential values for common registry providers.
|
||||
Replace placeholder values with your actual organization and feed details.
|
||||
|
||||
| Provider | Index URL | Username | Password |
|
||||
|----------|-----------|----------|----------|
|
||||
| **Azure DevOps Artifacts** | `https://pkgs.dev.azure.com/{org}/_packaging/{feed}/pypi/simple/` | Any non-empty string (e.g. `token`) | Personal Access Token (PAT) with Packaging Read scope |
|
||||
| **GitHub Packages** | `https://pypi.pkg.github.com/{owner}/simple/` | GitHub username | Personal Access Token (classic) with `read:packages` scope |
|
||||
| **GitLab Package Registry** | `https://gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple/` | `__token__` | Project or Personal Access Token with `read_api` scope |
|
||||
| **AWS CodeArtifact** | Use the URL from `aws codeartifact get-repository-endpoint` | `aws` | Token from `aws codeartifact get-authorization-token` |
|
||||
| **Google Artifact Registry** | `https://{region}-python.pkg.dev/{project}/{repo}/simple/` | `_json_key_base64` | Base64-encoded service account key |
|
||||
| **JFrog Artifactory** | `https://{instance}.jfrog.io/artifactory/api/pypi/{repo}/simple/` | Username or email | API key or identity token |
|
||||
| **Self-hosted (devpi, Nexus, etc.)** | Your registry's simple API URL | Registry username | Registry password |
|
||||
|
||||
<Tip>
|
||||
For **AWS CodeArtifact**, the authorization token expires periodically.
|
||||
You'll need to refresh the `UV_INDEX_*_PASSWORD` value when it expires.
|
||||
Consider automating this in your CI/CD pipeline.
|
||||
</Tip>
|
||||
|
||||
## Setting Environment Variables in AMP
|
||||
|
||||
Private registry credentials must be configured as environment variables in CrewAI AMP.
|
||||
You have two options:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Web Interface">
|
||||
1. Log in to [CrewAI AMP](https://app.crewai.com)
|
||||
2. Navigate to your automation
|
||||
3. Open the **Environment Variables** tab
|
||||
4. Add each variable (`UV_INDEX_*_USERNAME` and `UV_INDEX_*_PASSWORD`) with its value
|
||||
|
||||
See the [Deploy to AMP — Set Environment Variables](/en/enterprise/guides/deploy-to-amp#set-environment-variables) step for details.
|
||||
</Tab>
|
||||
<Tab title="CLI Deployment">
|
||||
Add the variables to your local `.env` file before running `crewai deploy create`.
|
||||
The CLI will securely transfer them to the platform:
|
||||
|
||||
```bash
|
||||
# .env
|
||||
OPENAI_API_KEY=sk-...
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat-here
|
||||
```
|
||||
|
||||
```bash
|
||||
crewai deploy create
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Warning>
|
||||
**Never** commit credentials to your repository. Use AMP environment variables for all secrets.
|
||||
The `.env` file should be listed in `.gitignore`.
|
||||
</Warning>
|
||||
|
||||
To update credentials on an existing deployment, see [Update Your Crew — Environment Variables](/en/enterprise/guides/update-crew).
|
||||
|
||||
## How It All Fits Together
|
||||
|
||||
When CrewAI AMP builds your automation, the resolution flow works like this:
|
||||
|
||||
<Steps>
|
||||
<Step title="Build starts">
|
||||
AMP pulls your repository and reads `pyproject.toml` and `uv.lock`.
|
||||
</Step>
|
||||
<Step title="UV resolves dependencies">
|
||||
UV reads `[tool.uv.sources]` to determine which index each package should come from.
|
||||
</Step>
|
||||
<Step title="UV authenticates">
|
||||
For each private index, UV looks up `UV_INDEX_{NAME}_USERNAME` and `UV_INDEX_{NAME}_PASSWORD`
|
||||
from the environment variables you configured in AMP.
|
||||
</Step>
|
||||
<Step title="Packages install">
|
||||
UV downloads and installs all packages — both public (from PyPI) and private (from your registry).
|
||||
</Step>
|
||||
<Step title="Automation runs">
|
||||
Your crew or flow starts with all dependencies available.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Authentication Errors During Build
|
||||
|
||||
**Symptom**: Build fails with `401 Unauthorized` or `403 Forbidden` when resolving a private package.
|
||||
|
||||
**Check**:
|
||||
- The `UV_INDEX_*` environment variable names match your index name exactly (uppercased, hyphens → underscores)
|
||||
- Credentials are set in AMP environment variables, not just in a local `.env`
|
||||
- Your token/PAT has the required read permissions for the package feed
|
||||
- The token hasn't expired (especially relevant for AWS CodeArtifact)
|
||||
|
||||
### Package Not Found
|
||||
|
||||
**Symptom**: `No matching distribution found for my-private-package`.
|
||||
|
||||
**Check**:
|
||||
- The index URL in `pyproject.toml` ends with `/simple/`
|
||||
- The `[tool.uv.sources]` entry maps the correct package name to the correct index name
|
||||
- The package is actually published to your private registry
|
||||
- Run `uv lock` locally with the same credentials to verify resolution works
|
||||
|
||||
### Lock File Conflicts
|
||||
|
||||
**Symptom**: `uv lock` fails or produces unexpected results after adding a private index.
|
||||
|
||||
**Solution**: Set the credentials locally and regenerate:
|
||||
|
||||
```bash
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat
|
||||
uv lock
|
||||
```
|
||||
|
||||
Then commit the updated `uv.lock`.
|
||||
|
||||
## Related Guides
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Prepare for Deployment" icon="clipboard-check" href="/en/enterprise/guides/prepare-for-deployment">
|
||||
Verify project structure and dependencies before deploying.
|
||||
</Card>
|
||||
<Card title="Deploy to AMP" icon="rocket" href="/en/enterprise/guides/deploy-to-amp">
|
||||
Deploy your crew or flow and configure environment variables.
|
||||
</Card>
|
||||
<Card title="Update Your Crew" icon="arrows-rotate" href="/en/enterprise/guides/update-crew">
|
||||
Update environment variables and push changes to a running deployment.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -176,6 +176,11 @@ Crew를 GitHub 저장소에 푸시해야 합니다. 아직 Crew를 만들지 않
|
||||

|
||||
</Frame>
|
||||
|
||||
<Info>
|
||||
프라이빗 Python 패키지를 사용하시나요? 여기에 레지스트리 자격 증명도 추가해야 합니다.
|
||||
필요한 변수는 [프라이빗 패키지 레지스트리](/ko/enterprise/guides/private-package-registry)를 참조하세요.
|
||||
</Info>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Crew 배포하기">
|
||||
|
||||
@@ -256,6 +256,12 @@ Crews와 Flows 모두 `src/project_name/main.py`에 진입점이 있습니다:
|
||||
1. **LLM API 키** (OpenAI, Anthropic, Google 등)
|
||||
2. **도구 API 키** - 외부 도구를 사용하는 경우 (Serper 등)
|
||||
|
||||
<Info>
|
||||
프로젝트가 **프라이빗 PyPI 레지스트리**의 패키지에 의존하는 경우, 레지스트리 인증 자격 증명도
|
||||
환경 변수로 구성해야 합니다. 자세한 내용은
|
||||
[프라이빗 패키지 레지스트리](/ko/enterprise/guides/private-package-registry) 가이드를 참조하세요.
|
||||
</Info>
|
||||
|
||||
<Tip>
|
||||
구성 문제를 조기에 발견하기 위해 배포 전에 동일한 환경 변수로
|
||||
로컬에서 프로젝트를 테스트하세요.
|
||||
|
||||
261
docs/ko/enterprise/guides/private-package-registry.mdx
Normal file
261
docs/ko/enterprise/guides/private-package-registry.mdx
Normal file
@@ -0,0 +1,261 @@
|
||||
---
|
||||
title: "프라이빗 패키지 레지스트리"
|
||||
description: "CrewAI AMP에서 인증된 PyPI 레지스트리의 프라이빗 Python 패키지 설치하기"
|
||||
icon: "lock"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Note>
|
||||
이 가이드는 CrewAI AMP에 배포할 때 프라이빗 PyPI 레지스트리(Azure DevOps Artifacts, GitHub Packages,
|
||||
GitLab, AWS CodeArtifact 등)에서 Python 패키지를 설치하도록 CrewAI 프로젝트를 구성하는 방법을 다룹니다.
|
||||
</Note>
|
||||
|
||||
## 이 가이드가 필요한 경우
|
||||
|
||||
프로젝트가 공개 PyPI가 아닌 프라이빗 레지스트리에 호스팅된 내부 또는 독점 Python 패키지에
|
||||
의존하는 경우, 다음을 수행해야 합니다:
|
||||
|
||||
1. UV에 패키지를 **어디서** 찾을지 알려줍니다 (index URL)
|
||||
2. UV에 **어떤** 패키지가 해당 index에서 오는지 알려줍니다 (source 매핑)
|
||||
3. UV가 설치 중에 인증할 수 있도록 **자격 증명**을 제공합니다
|
||||
|
||||
CrewAI AMP는 의존성 해결 및 설치에 [UV](https://docs.astral.sh/uv/)를 사용합니다.
|
||||
UV는 `pyproject.toml` 구성과 자격 증명용 환경 변수를 결합하여 인증된 프라이빗 레지스트리를 지원합니다.
|
||||
|
||||
## 1단계: pyproject.toml 구성
|
||||
|
||||
`pyproject.toml`에서 세 가지 요소가 함께 작동합니다:
|
||||
|
||||
### 1a. 의존성 선언
|
||||
|
||||
프라이빗 패키지를 다른 의존성과 마찬가지로 `[project.dependencies]`에 추가합니다:
|
||||
|
||||
```toml
|
||||
[project]
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
```
|
||||
|
||||
### 1b. index 정의
|
||||
|
||||
프라이빗 레지스트리를 `[[tool.uv.index]]` 아래에 명명된 index로 등록합니다:
|
||||
|
||||
```toml
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
```
|
||||
|
||||
<Info>
|
||||
`name` 필드는 중요합니다 — UV는 이를 사용하여 인증을 위한 환경 변수 이름을
|
||||
구성합니다 (아래 [2단계](#2단계-인증-자격-증명-설정)를 참조하세요).
|
||||
|
||||
`explicit = true`를 설정하면 UV가 모든 패키지에 대해 이 index를 검색하지 않습니다 —
|
||||
`[tool.uv.sources]`에서 명시적으로 매핑한 패키지만 검색합니다. 이렇게 하면 프라이빗
|
||||
레지스트리에 대한 불필요한 쿼리를 방지하고 의존성 혼동 공격을 차단할 수 있습니다.
|
||||
</Info>
|
||||
|
||||
### 1c. 패키지를 index에 매핑
|
||||
|
||||
`[tool.uv.sources]`를 사용하여 프라이빗 index에서 해결해야 할 패키지를 UV에 알려줍니다:
|
||||
|
||||
```toml
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
### 전체 예시
|
||||
|
||||
```toml
|
||||
[project]
|
||||
name = "my-crew-project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.10,<=3.13"
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
|
||||
[tool.crewai]
|
||||
type = "crew"
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
`pyproject.toml`을 업데이트한 후 lock 파일을 다시 생성합니다:
|
||||
|
||||
```bash
|
||||
uv lock
|
||||
```
|
||||
|
||||
<Warning>
|
||||
업데이트된 `uv.lock`을 항상 `pyproject.toml` 변경 사항과 함께 커밋하세요.
|
||||
lock 파일은 배포에 필수입니다 — [배포 준비하기](/ko/enterprise/guides/prepare-for-deployment)를 참조하세요.
|
||||
</Warning>
|
||||
|
||||
## 2단계: 인증 자격 증명 설정
|
||||
|
||||
UV는 `pyproject.toml`에서 정의한 index 이름을 기반으로 한 명명 규칙을 따르는
|
||||
환경 변수를 사용하여 프라이빗 index에 인증합니다:
|
||||
|
||||
```
|
||||
UV_INDEX_{UPPER_NAME}_USERNAME
|
||||
UV_INDEX_{UPPER_NAME}_PASSWORD
|
||||
```
|
||||
|
||||
여기서 `{UPPER_NAME}`은 index 이름을 **대문자**로 변환하고 **하이픈을 언더스코어로 대체**한 것입니다.
|
||||
|
||||
예를 들어, `my-private-registry`라는 이름의 index는 다음을 사용합니다:
|
||||
|
||||
| 변수 | 값 |
|
||||
|------|-----|
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME` | 레지스트리 사용자 이름 또는 토큰 이름 |
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD` | 레지스트리 비밀번호 또는 토큰/PAT |
|
||||
|
||||
<Warning>
|
||||
이 환경 변수는 CrewAI AMP **환경 변수** 설정을 통해 **반드시** 추가해야 합니다 —
|
||||
전역적으로 또는 배포 수준에서. `.env` 파일에 설정하거나 프로젝트에 하드코딩할 수 없습니다.
|
||||
|
||||
아래 [AMP에서 환경 변수 설정](#amp에서-환경-변수-설정)을 참조하세요.
|
||||
</Warning>
|
||||
|
||||
## 레지스트리 제공업체 참조
|
||||
|
||||
아래 표는 일반적인 레지스트리 제공업체의 index URL 형식과 자격 증명 값을 보여줍니다.
|
||||
자리 표시자 값을 실제 조직 및 피드 세부 정보로 대체하세요.
|
||||
|
||||
| 제공업체 | Index URL | 사용자 이름 | 비밀번호 |
|
||||
|---------|-----------|-----------|---------|
|
||||
| **Azure DevOps Artifacts** | `https://pkgs.dev.azure.com/{org}/_packaging/{feed}/pypi/simple/` | 비어 있지 않은 임의의 문자열 (예: `token`) | Packaging Read 범위의 Personal Access Token (PAT) |
|
||||
| **GitHub Packages** | `https://pypi.pkg.github.com/{owner}/simple/` | GitHub 사용자 이름 | `read:packages` 범위의 Personal Access Token (classic) |
|
||||
| **GitLab Package Registry** | `https://gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple/` | `__token__` | `read_api` 범위의 Project 또는 Personal Access Token |
|
||||
| **AWS CodeArtifact** | `aws codeartifact get-repository-endpoint`의 URL 사용 | `aws` | `aws codeartifact get-authorization-token`의 토큰 |
|
||||
| **Google Artifact Registry** | `https://{region}-python.pkg.dev/{project}/{repo}/simple/` | `_json_key_base64` | Base64로 인코딩된 서비스 계정 키 |
|
||||
| **JFrog Artifactory** | `https://{instance}.jfrog.io/artifactory/api/pypi/{repo}/simple/` | 사용자 이름 또는 이메일 | API 키 또는 ID 토큰 |
|
||||
| **자체 호스팅 (devpi, Nexus 등)** | 레지스트리의 simple API URL | 레지스트리 사용자 이름 | 레지스트리 비밀번호 |
|
||||
|
||||
<Tip>
|
||||
**AWS CodeArtifact**의 경우 인증 토큰이 주기적으로 만료됩니다.
|
||||
만료되면 `UV_INDEX_*_PASSWORD` 값을 갱신해야 합니다.
|
||||
CI/CD 파이프라인에서 이를 자동화하는 것을 고려하세요.
|
||||
</Tip>
|
||||
|
||||
## AMP에서 환경 변수 설정
|
||||
|
||||
프라이빗 레지스트리 자격 증명은 CrewAI AMP에서 환경 변수로 구성해야 합니다.
|
||||
두 가지 옵션이 있습니다:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="웹 인터페이스">
|
||||
1. [CrewAI AMP](https://app.crewai.com)에 로그인합니다
|
||||
2. 자동화로 이동합니다
|
||||
3. **Environment Variables** 탭을 엽니다
|
||||
4. 각 변수 (`UV_INDEX_*_USERNAME` 및 `UV_INDEX_*_PASSWORD`)에 값을 추가합니다
|
||||
|
||||
자세한 내용은 [AMP에 배포하기 — 환경 변수 설정하기](/ko/enterprise/guides/deploy-to-amp#환경-변수-설정하기) 단계를 참조하세요.
|
||||
</Tab>
|
||||
<Tab title="CLI 배포">
|
||||
`crewai deploy create`를 실행하기 전에 로컬 `.env` 파일에 변수를 추가합니다.
|
||||
CLI가 이를 안전하게 플랫폼으로 전송합니다:
|
||||
|
||||
```bash
|
||||
# .env
|
||||
OPENAI_API_KEY=sk-...
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat-here
|
||||
```
|
||||
|
||||
```bash
|
||||
crewai deploy create
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Warning>
|
||||
자격 증명을 저장소에 **절대** 커밋하지 마세요. 모든 비밀 정보에는 AMP 환경 변수를 사용하세요.
|
||||
`.env` 파일은 `.gitignore`에 포함되어야 합니다.
|
||||
</Warning>
|
||||
|
||||
기존 배포의 자격 증명을 업데이트하려면 [Crew 업데이트하기 — 환경 변수](/ko/enterprise/guides/update-crew)를 참조하세요.
|
||||
|
||||
## 전체 동작 흐름
|
||||
|
||||
CrewAI AMP가 자동화를 빌드할 때, 해결 흐름은 다음과 같이 작동합니다:
|
||||
|
||||
<Steps>
|
||||
<Step title="빌드 시작">
|
||||
AMP가 저장소를 가져오고 `pyproject.toml`과 `uv.lock`을 읽습니다.
|
||||
</Step>
|
||||
<Step title="UV가 의존성 해결">
|
||||
UV가 `[tool.uv.sources]`를 읽어 각 패키지가 어떤 index에서 와야 하는지 결정합니다.
|
||||
</Step>
|
||||
<Step title="UV가 인증">
|
||||
각 프라이빗 index에 대해 UV가 AMP에서 구성한 환경 변수에서
|
||||
`UV_INDEX_{NAME}_USERNAME`과 `UV_INDEX_{NAME}_PASSWORD`를 조회합니다.
|
||||
</Step>
|
||||
<Step title="패키지 설치">
|
||||
UV가 공개(PyPI) 및 프라이빗(레지스트리) 패키지를 모두 다운로드하고 설치합니다.
|
||||
</Step>
|
||||
<Step title="자동화 실행">
|
||||
모든 의존성이 사용 가능한 상태에서 crew 또는 flow가 시작됩니다.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 문제 해결
|
||||
|
||||
### 빌드 중 인증 오류
|
||||
|
||||
**증상**: 프라이빗 패키지를 해결할 때 `401 Unauthorized` 또는 `403 Forbidden`으로 빌드가 실패합니다.
|
||||
|
||||
**확인사항**:
|
||||
- `UV_INDEX_*` 환경 변수 이름이 index 이름과 정확히 일치하는지 확인합니다 (대문자, 하이픈 -> 언더스코어)
|
||||
- 자격 증명이 로컬 `.env`뿐만 아니라 AMP 환경 변수에 설정되어 있는지 확인합니다
|
||||
- 토큰/PAT에 패키지 피드에 필요한 읽기 권한이 있는지 확인합니다
|
||||
- 토큰이 만료되지 않았는지 확인합니다 (특히 AWS CodeArtifact의 경우)
|
||||
|
||||
### 패키지를 찾을 수 없음
|
||||
|
||||
**증상**: `No matching distribution found for my-private-package`.
|
||||
|
||||
**확인사항**:
|
||||
- `pyproject.toml`의 index URL이 `/simple/`로 끝나는지 확인합니다
|
||||
- `[tool.uv.sources]` 항목이 올바른 패키지 이름을 올바른 index 이름에 매핑하는지 확인합니다
|
||||
- 패키지가 실제로 프라이빗 레지스트리에 게시되어 있는지 확인합니다
|
||||
- 동일한 자격 증명으로 로컬에서 `uv lock`을 실행하여 해결이 작동하는지 확인합니다
|
||||
|
||||
### Lock 파일 충돌
|
||||
|
||||
**증상**: 프라이빗 index를 추가한 후 `uv lock`이 실패하거나 예상치 못한 결과를 생성합니다.
|
||||
|
||||
**해결책**: 로컬에서 자격 증명을 설정하고 다시 생성합니다:
|
||||
|
||||
```bash
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat
|
||||
uv lock
|
||||
```
|
||||
|
||||
그런 다음 업데이트된 `uv.lock`을 커밋합니다.
|
||||
|
||||
## 관련 가이드
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="배포 준비하기" icon="clipboard-check" href="/ko/enterprise/guides/prepare-for-deployment">
|
||||
배포 전에 프로젝트 구조와 의존성을 확인합니다.
|
||||
</Card>
|
||||
<Card title="AMP에 배포하기" icon="rocket" href="/ko/enterprise/guides/deploy-to-amp">
|
||||
crew 또는 flow를 배포하고 환경 변수를 구성합니다.
|
||||
</Card>
|
||||
<Card title="Crew 업데이트하기" icon="arrows-rotate" href="/ko/enterprise/guides/update-crew">
|
||||
환경 변수를 업데이트하고 실행 중인 배포에 변경 사항을 푸시합니다.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -176,6 +176,11 @@ Você precisa enviar seu crew para um repositório do GitHub. Caso ainda não te
|
||||

|
||||
</Frame>
|
||||
|
||||
<Info>
|
||||
Usando pacotes Python privados? Você também precisará adicionar suas credenciais de registro aqui.
|
||||
Consulte [Registros de Pacotes Privados](/pt-BR/enterprise/guides/private-package-registry) para as variáveis necessárias.
|
||||
</Info>
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Implante Seu Crew">
|
||||
|
||||
@@ -256,6 +256,12 @@ Antes da implantação, certifique-se de ter:
|
||||
1. **Chaves de API de LLM** prontas (OpenAI, Anthropic, Google, etc.)
|
||||
2. **Chaves de API de ferramentas** se estiver usando ferramentas externas (Serper, etc.)
|
||||
|
||||
<Info>
|
||||
Se seu projeto depende de pacotes de um **registro PyPI privado**, você também precisará configurar
|
||||
credenciais de autenticação do registro como variáveis de ambiente. Consulte o guia
|
||||
[Registros de Pacotes Privados](/pt-BR/enterprise/guides/private-package-registry) para mais detalhes.
|
||||
</Info>
|
||||
|
||||
<Tip>
|
||||
Teste seu projeto localmente com as mesmas variáveis de ambiente antes de implantar
|
||||
para detectar problemas de configuração antecipadamente.
|
||||
|
||||
263
docs/pt-BR/enterprise/guides/private-package-registry.mdx
Normal file
263
docs/pt-BR/enterprise/guides/private-package-registry.mdx
Normal file
@@ -0,0 +1,263 @@
|
||||
---
|
||||
title: "Registros de Pacotes Privados"
|
||||
description: "Instale pacotes Python privados de registros PyPI autenticados no CrewAI AMP"
|
||||
icon: "lock"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Note>
|
||||
Este guia aborda como configurar seu projeto CrewAI para instalar pacotes Python
|
||||
de registros PyPI privados (Azure DevOps Artifacts, GitHub Packages, GitLab, AWS CodeArtifact, etc.)
|
||||
ao implantar no CrewAI AMP.
|
||||
</Note>
|
||||
|
||||
## Quando Você Precisa Disso
|
||||
|
||||
Se seu projeto depende de pacotes Python internos ou proprietários hospedados em um registro privado
|
||||
em vez do PyPI público, você precisará:
|
||||
|
||||
1. Informar ao UV **onde** encontrar o pacote (uma URL de index)
|
||||
2. Informar ao UV **quais** pacotes vêm desse index (um mapeamento de source)
|
||||
3. Fornecer **credenciais** para que o UV possa autenticar durante a instalação
|
||||
|
||||
O CrewAI AMP usa [UV](https://docs.astral.sh/uv/) para resolução e instalação de dependências.
|
||||
O UV suporta registros privados autenticados por meio da configuração do `pyproject.toml` combinada
|
||||
com variáveis de ambiente para credenciais.
|
||||
|
||||
## Passo 1: Configurar o pyproject.toml
|
||||
|
||||
Três elementos trabalham juntos no seu `pyproject.toml`:
|
||||
|
||||
### 1a. Declarar a dependência
|
||||
|
||||
Adicione o pacote privado ao seu `[project.dependencies]` como qualquer outra dependência:
|
||||
|
||||
```toml
|
||||
[project]
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
```
|
||||
|
||||
### 1b. Definir o index
|
||||
|
||||
Registre seu registro privado como um index nomeado em `[[tool.uv.index]]`:
|
||||
|
||||
```toml
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
```
|
||||
|
||||
<Info>
|
||||
O campo `name` é importante — o UV o utiliza para construir os nomes das variáveis de ambiente
|
||||
para autenticação (veja o [Passo 2](#passo-2-configurar-credenciais-de-autenticação) abaixo).
|
||||
|
||||
Definir `explicit = true` significa que o UV não consultará esse index para todos os pacotes — apenas
|
||||
os que você mapear explicitamente em `[tool.uv.sources]`. Isso evita consultas desnecessárias
|
||||
ao seu registro privado e protege contra ataques de confusão de dependências.
|
||||
</Info>
|
||||
|
||||
### 1c. Mapear o pacote para o index
|
||||
|
||||
Informe ao UV quais pacotes devem ser resolvidos a partir do seu index privado usando `[tool.uv.sources]`:
|
||||
|
||||
```toml
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
### Exemplo completo
|
||||
|
||||
```toml
|
||||
[project]
|
||||
name = "my-crew-project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.10,<=3.13"
|
||||
dependencies = [
|
||||
"crewai[tools]>=0.100.1,<1.0.0",
|
||||
"my-private-package>=1.2.0",
|
||||
]
|
||||
|
||||
[tool.crewai]
|
||||
type = "crew"
|
||||
|
||||
[[tool.uv.index]]
|
||||
name = "my-private-registry"
|
||||
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
|
||||
explicit = true
|
||||
|
||||
[tool.uv.sources]
|
||||
my-private-package = { index = "my-private-registry" }
|
||||
```
|
||||
|
||||
Após atualizar o `pyproject.toml`, regenere seu arquivo lock:
|
||||
|
||||
```bash
|
||||
uv lock
|
||||
```
|
||||
|
||||
<Warning>
|
||||
Sempre faça commit do `uv.lock` atualizado junto com as alterações no `pyproject.toml`.
|
||||
O arquivo lock é obrigatório para implantação — veja [Preparar para Implantação](/pt-BR/enterprise/guides/prepare-for-deployment).
|
||||
</Warning>
|
||||
|
||||
## Passo 2: Configurar Credenciais de Autenticação
|
||||
|
||||
O UV autentica em indexes privados usando variáveis de ambiente que seguem uma convenção de nomenclatura
|
||||
baseada no nome do index que você definiu no `pyproject.toml`:
|
||||
|
||||
```
|
||||
UV_INDEX_{UPPER_NAME}_USERNAME
|
||||
UV_INDEX_{UPPER_NAME}_PASSWORD
|
||||
```
|
||||
|
||||
Onde `{UPPER_NAME}` é o nome do seu index convertido para **maiúsculas** com **hifens substituídos por underscores**.
|
||||
|
||||
Por exemplo, um index chamado `my-private-registry` usa:
|
||||
|
||||
| Variável | Valor |
|
||||
|----------|-------|
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME` | Seu nome de usuário ou nome do token do registro |
|
||||
| `UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD` | Sua senha ou token/PAT do registro |
|
||||
|
||||
<Warning>
|
||||
Essas variáveis de ambiente **devem** ser adicionadas pelas configurações de **Variáveis de Ambiente** do CrewAI AMP —
|
||||
globalmente ou no nível da implantação. Elas não podem ser definidas em arquivos `.env` ou codificadas no seu projeto.
|
||||
|
||||
Veja [Configurar Variáveis de Ambiente no AMP](#configurar-variáveis-de-ambiente-no-amp) abaixo.
|
||||
</Warning>
|
||||
|
||||
## Referência de Provedores de Registro
|
||||
|
||||
A tabela abaixo mostra o formato da URL de index e os valores de credenciais para provedores de registro comuns.
|
||||
Substitua os valores de exemplo pelos detalhes reais da sua organização e feed.
|
||||
|
||||
| Provedor | URL do Index | Usuário | Senha |
|
||||
|----------|-------------|---------|-------|
|
||||
| **Azure DevOps Artifacts** | `https://pkgs.dev.azure.com/{org}/_packaging/{feed}/pypi/simple/` | Qualquer string não vazia (ex: `token`) | Personal Access Token (PAT) com escopo Packaging Read |
|
||||
| **GitHub Packages** | `https://pypi.pkg.github.com/{owner}/simple/` | Nome de usuário do GitHub | Personal Access Token (classic) com escopo `read:packages` |
|
||||
| **GitLab Package Registry** | `https://gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple/` | `__token__` | Project ou Personal Access Token com escopo `read_api` |
|
||||
| **AWS CodeArtifact** | Use a URL de `aws codeartifact get-repository-endpoint` | `aws` | Token de `aws codeartifact get-authorization-token` |
|
||||
| **Google Artifact Registry** | `https://{region}-python.pkg.dev/{project}/{repo}/simple/` | `_json_key_base64` | Chave de conta de serviço codificada em Base64 |
|
||||
| **JFrog Artifactory** | `https://{instance}.jfrog.io/artifactory/api/pypi/{repo}/simple/` | Nome de usuário ou email | Chave API ou token de identidade |
|
||||
| **Auto-hospedado (devpi, Nexus, etc.)** | URL da API simple do seu registro | Nome de usuário do registro | Senha do registro |
|
||||
|
||||
<Tip>
|
||||
Para **AWS CodeArtifact**, o token de autorização expira periodicamente.
|
||||
Você precisará atualizar o valor de `UV_INDEX_*_PASSWORD` quando ele expirar.
|
||||
Considere automatizar isso no seu pipeline de CI/CD.
|
||||
</Tip>
|
||||
|
||||
## Configurar Variáveis de Ambiente no AMP
|
||||
|
||||
As credenciais do registro privado devem ser configuradas como variáveis de ambiente no CrewAI AMP.
|
||||
Você tem duas opções:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Interface Web">
|
||||
1. Faça login no [CrewAI AMP](https://app.crewai.com)
|
||||
2. Navegue até sua automação
|
||||
3. Abra a aba **Environment Variables**
|
||||
4. Adicione cada variável (`UV_INDEX_*_USERNAME` e `UV_INDEX_*_PASSWORD`) com seu valor
|
||||
|
||||
Veja o passo [Deploy para AMP — Definir Variáveis de Ambiente](/pt-BR/enterprise/guides/deploy-to-amp#definir-as-variáveis-de-ambiente) para detalhes.
|
||||
</Tab>
|
||||
<Tab title="Implantação via CLI">
|
||||
Adicione as variáveis ao seu arquivo `.env` local antes de executar `crewai deploy create`.
|
||||
A CLI as transferirá com segurança para a plataforma:
|
||||
|
||||
```bash
|
||||
# .env
|
||||
OPENAI_API_KEY=sk-...
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat-here
|
||||
```
|
||||
|
||||
```bash
|
||||
crewai deploy create
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Warning>
|
||||
**Nunca** faça commit de credenciais no seu repositório. Use variáveis de ambiente do AMP para todos os segredos.
|
||||
O arquivo `.env` deve estar listado no `.gitignore`.
|
||||
</Warning>
|
||||
|
||||
Para atualizar credenciais em uma implantação existente, veja [Atualizar Seu Crew — Variáveis de Ambiente](/pt-BR/enterprise/guides/update-crew).
|
||||
|
||||
## Como Tudo se Conecta
|
||||
|
||||
Quando o CrewAI AMP faz o build da sua automação, o fluxo de resolução funciona assim:
|
||||
|
||||
<Steps>
|
||||
<Step title="Build inicia">
|
||||
O AMP busca seu repositório e lê o `pyproject.toml` e o `uv.lock`.
|
||||
</Step>
|
||||
<Step title="UV resolve dependências">
|
||||
O UV lê `[tool.uv.sources]` para determinar de qual index cada pacote deve vir.
|
||||
</Step>
|
||||
<Step title="UV autentica">
|
||||
Para cada index privado, o UV busca `UV_INDEX_{NAME}_USERNAME` e `UV_INDEX_{NAME}_PASSWORD`
|
||||
nas variáveis de ambiente que você configurou no AMP.
|
||||
</Step>
|
||||
<Step title="Pacotes são instalados">
|
||||
O UV baixa e instala todos os pacotes — tanto públicos (do PyPI) quanto privados (do seu registro).
|
||||
</Step>
|
||||
<Step title="Automação executa">
|
||||
Seu crew ou flow inicia com todas as dependências disponíveis.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Solução de Problemas
|
||||
|
||||
### Erros de Autenticação Durante o Build
|
||||
|
||||
**Sintoma**: Build falha com `401 Unauthorized` ou `403 Forbidden` ao resolver um pacote privado.
|
||||
|
||||
**Verifique**:
|
||||
- Os nomes das variáveis de ambiente `UV_INDEX_*` correspondem exatamente ao nome do seu index (maiúsculas, hifens -> underscores)
|
||||
- As credenciais estão definidas nas variáveis de ambiente do AMP, não apenas em um `.env` local
|
||||
- Seu token/PAT tem as permissões de leitura necessárias para o feed de pacotes
|
||||
- O token não expirou (especialmente relevante para AWS CodeArtifact)
|
||||
|
||||
### Pacote Não Encontrado
|
||||
|
||||
**Sintoma**: `No matching distribution found for my-private-package`.
|
||||
|
||||
**Verifique**:
|
||||
- A URL do index no `pyproject.toml` termina com `/simple/`
|
||||
- A entrada `[tool.uv.sources]` mapeia o nome correto do pacote para o nome correto do index
|
||||
- O pacote está realmente publicado no seu registro privado
|
||||
- Execute `uv lock` localmente com as mesmas credenciais para verificar se a resolução funciona
|
||||
|
||||
### Conflitos no Arquivo Lock
|
||||
|
||||
**Sintoma**: `uv lock` falha ou produz resultados inesperados após adicionar um index privado.
|
||||
|
||||
**Solução**: Defina as credenciais localmente e regenere:
|
||||
|
||||
```bash
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
|
||||
export UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat
|
||||
uv lock
|
||||
```
|
||||
|
||||
Em seguida, faça commit do `uv.lock` atualizado.
|
||||
|
||||
## Guias Relacionados
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Preparar para Implantação" icon="clipboard-check" href="/pt-BR/enterprise/guides/prepare-for-deployment">
|
||||
Verifique a estrutura do projeto e as dependências antes de implantar.
|
||||
</Card>
|
||||
<Card title="Deploy para AMP" icon="rocket" href="/pt-BR/enterprise/guides/deploy-to-amp">
|
||||
Implante seu crew ou flow e configure variáveis de ambiente.
|
||||
</Card>
|
||||
<Card title="Atualizar Seu Crew" icon="arrows-rotate" href="/pt-BR/enterprise/guides/update-crew">
|
||||
Atualize variáveis de ambiente e envie alterações para uma implantação em execução.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -4,7 +4,6 @@ import urllib.request
|
||||
import warnings
|
||||
|
||||
from crewai.agent.core import Agent
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
from crewai.crew import Crew
|
||||
from crewai.crews.crew_output import CrewOutput
|
||||
from crewai.flow.flow import Flow
|
||||
@@ -83,7 +82,6 @@ __all__ = [
|
||||
"Knowledge",
|
||||
"LLMGuardrail",
|
||||
"Memory",
|
||||
"PlanningConfig",
|
||||
"Process",
|
||||
"Task",
|
||||
"TaskOutput",
|
||||
|
||||
@@ -24,7 +24,6 @@ from pydantic import (
|
||||
)
|
||||
from typing_extensions import Self
|
||||
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
from crewai.agent.utils import (
|
||||
ahandle_knowledge_retrieval,
|
||||
apply_training_data,
|
||||
@@ -212,23 +211,13 @@ class Agent(BaseAgent):
|
||||
default="safe",
|
||||
description="Mode for code execution: 'safe' (using Docker) or 'unsafe' (direct execution).",
|
||||
)
|
||||
planning_config: PlanningConfig | None = Field(
|
||||
default=None,
|
||||
description="Configuration for agent planning before task execution.",
|
||||
)
|
||||
planning: bool = Field(
|
||||
reasoning: bool = Field(
|
||||
default=False,
|
||||
description="Whether the agent should reflect and create a plan before executing a task.",
|
||||
)
|
||||
reasoning: bool = Field(
|
||||
default=False,
|
||||
description="[DEPRECATED: Use planning_config instead] Whether the agent should reflect and create a plan before executing a task.",
|
||||
deprecated=True,
|
||||
)
|
||||
max_reasoning_attempts: int | None = Field(
|
||||
default=None,
|
||||
description="[DEPRECATED: Use planning_config.max_attempts instead] Maximum number of reasoning attempts before executing the task. If None, will try until ready.",
|
||||
deprecated=True,
|
||||
description="Maximum number of reasoning attempts before executing the task. If None, will try until ready.",
|
||||
)
|
||||
embedder: EmbedderConfig | None = Field(
|
||||
default=None,
|
||||
@@ -295,26 +284,8 @@ class Agent(BaseAgent):
|
||||
if self.allow_code_execution:
|
||||
self._validate_docker_installation()
|
||||
|
||||
# Handle backward compatibility: convert reasoning=True to planning_config
|
||||
if self.reasoning and self.planning_config is None:
|
||||
import warnings
|
||||
|
||||
warnings.warn(
|
||||
"The 'reasoning' parameter is deprecated. Use 'planning_config=PlanningConfig()' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
self.planning_config = PlanningConfig(
|
||||
max_attempts=self.max_reasoning_attempts,
|
||||
)
|
||||
|
||||
return self
|
||||
|
||||
@property
|
||||
def planning_enabled(self) -> bool:
|
||||
"""Check if planning is enabled for this agent."""
|
||||
return self.planning_config is not None or self.planning
|
||||
|
||||
def _setup_agent_executor(self) -> None:
|
||||
if not self.cache_handler:
|
||||
self.cache_handler = CacheHandler()
|
||||
@@ -383,11 +354,7 @@ class Agent(BaseAgent):
|
||||
ValueError: If the max execution time is not a positive integer.
|
||||
RuntimeError: If the agent execution fails for other reasons.
|
||||
"""
|
||||
# Only call handle_reasoning for legacy CrewAgentExecutor
|
||||
# For AgentExecutor, planning is handled in AgentExecutor.generate_plan()
|
||||
if self.executor_class is not AgentExecutor:
|
||||
handle_reasoning(self, task)
|
||||
|
||||
handle_reasoning(self, task)
|
||||
self._inject_date_to_task(task)
|
||||
|
||||
if self.tools_handler:
|
||||
@@ -625,10 +592,7 @@ class Agent(BaseAgent):
|
||||
ValueError: If the max execution time is not a positive integer.
|
||||
RuntimeError: If the agent execution fails for other reasons.
|
||||
"""
|
||||
if self.executor_class is not AgentExecutor:
|
||||
handle_reasoning(
|
||||
self, task
|
||||
) # we need this till CrewAgentExecutor migrates to AgentExecutor
|
||||
handle_reasoning(self, task)
|
||||
self._inject_date_to_task(task)
|
||||
|
||||
if self.tools_handler:
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class PlanningConfig(BaseModel):
|
||||
"""Configuration for agent planning/reasoning before task execution.
|
||||
|
||||
This allows users to customize the planning behavior including prompts,
|
||||
iteration limits, and the LLM used for planning.
|
||||
|
||||
Note: To disable planning, don't pass a planning_config or set planning=False
|
||||
on the Agent. The presence of a PlanningConfig enables planning.
|
||||
|
||||
Attributes:
|
||||
max_attempts: Maximum number of planning refinement attempts.
|
||||
If None, will continue until the agent indicates readiness.
|
||||
max_steps: Maximum number of steps in the generated plan.
|
||||
system_prompt: Custom system prompt for planning. Uses default if None.
|
||||
plan_prompt: Custom prompt for creating the initial plan.
|
||||
refine_prompt: Custom prompt for refining the plan.
|
||||
llm: LLM to use for planning. Uses agent's LLM if None.
|
||||
|
||||
Example:
|
||||
```python
|
||||
from crewai import Agent
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
|
||||
# Simple usage
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Research topics",
|
||||
backstory="Expert researcher",
|
||||
planning_config=PlanningConfig(),
|
||||
)
|
||||
|
||||
# Customized planning
|
||||
agent = Agent(
|
||||
role="Researcher",
|
||||
goal="Research topics",
|
||||
backstory="Expert researcher",
|
||||
planning_config=PlanningConfig(
|
||||
max_attempts=3,
|
||||
max_steps=10,
|
||||
plan_prompt="Create a focused plan for: {description}",
|
||||
llm="gpt-4o-mini", # Use cheaper model for planning
|
||||
),
|
||||
)
|
||||
```
|
||||
"""
|
||||
|
||||
max_attempts: int | None = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"Maximum number of planning refinement attempts. "
|
||||
"If None, will continue until the agent indicates readiness."
|
||||
),
|
||||
)
|
||||
max_steps: int = Field(
|
||||
default=20,
|
||||
description="Maximum number of steps in the generated plan.",
|
||||
ge=1,
|
||||
)
|
||||
system_prompt: str | None = Field(
|
||||
default=None,
|
||||
description="Custom system prompt for planning. Uses default if None.",
|
||||
)
|
||||
plan_prompt: str | None = Field(
|
||||
default=None,
|
||||
description="Custom prompt for creating the initial plan.",
|
||||
)
|
||||
refine_prompt: str | None = Field(
|
||||
default=None,
|
||||
description="Custom prompt for refining the plan.",
|
||||
)
|
||||
llm: str | Any | None = Field(
|
||||
default=None,
|
||||
description="LLM to use for planning. Uses agent's LLM if None.",
|
||||
)
|
||||
|
||||
model_config = {"arbitrary_types_allowed": True}
|
||||
@@ -28,20 +28,13 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
def handle_reasoning(agent: Agent, task: Task) -> None:
|
||||
"""Handle the reasoning/planning process for an agent before task execution.
|
||||
|
||||
This function checks if planning is enabled for the agent and, if so,
|
||||
creates a plan that gets appended to the task description.
|
||||
|
||||
Note: This function is used by CrewAgentExecutor (legacy path).
|
||||
For AgentExecutor, planning is handled in AgentExecutor.generate_plan().
|
||||
"""Handle the reasoning process for an agent before task execution.
|
||||
|
||||
Args:
|
||||
agent: The agent performing the task.
|
||||
task: The task to execute.
|
||||
"""
|
||||
# Check if planning is enabled using the planning_enabled property
|
||||
if not getattr(agent, "planning_enabled", False):
|
||||
if not agent.reasoning:
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -50,13 +43,13 @@ def handle_reasoning(agent: Agent, task: Task) -> None:
|
||||
AgentReasoningOutput,
|
||||
)
|
||||
|
||||
planning_handler = AgentReasoning(agent=agent, task=task)
|
||||
planning_output: AgentReasoningOutput = (
|
||||
planning_handler.handle_agent_reasoning()
|
||||
reasoning_handler = AgentReasoning(task=task, agent=agent)
|
||||
reasoning_output: AgentReasoningOutput = (
|
||||
reasoning_handler.handle_agent_reasoning()
|
||||
)
|
||||
task.description += f"\n\nPlanning:\n{planning_output.plan.plan}"
|
||||
task.description += f"\n\nReasoning Plan:\n{reasoning_output.plan.plan}"
|
||||
except Exception as e:
|
||||
agent._logger.log("error", f"Error during planning: {e!s}")
|
||||
agent._logger.log("error", f"Error during reasoning process: {e!s}")
|
||||
|
||||
|
||||
def build_task_prompt_with_schema(task: Task, task_prompt: str, i18n: I18N) -> str:
|
||||
|
||||
@@ -50,6 +50,7 @@ from crewai.utilities.agent_utils import (
|
||||
handle_unknown_error,
|
||||
has_reached_max_iterations,
|
||||
is_context_length_exceeded,
|
||||
parse_tool_call_args,
|
||||
process_llm_response,
|
||||
track_delegation_if_needed,
|
||||
)
|
||||
@@ -894,13 +895,9 @@ class CrewAgentExecutor(CrewAgentExecutorMixin):
|
||||
ToolUsageStartedEvent,
|
||||
)
|
||||
|
||||
if isinstance(func_args, str):
|
||||
try:
|
||||
args_dict = json.loads(func_args)
|
||||
except json.JSONDecodeError:
|
||||
args_dict = {}
|
||||
else:
|
||||
args_dict = func_args
|
||||
args_dict, parse_error = parse_tool_call_args(func_args, func_name, call_id, original_tool)
|
||||
if parse_error is not None:
|
||||
return parse_error
|
||||
|
||||
if original_tool is None:
|
||||
for tool in self.original_tools or []:
|
||||
|
||||
@@ -69,7 +69,7 @@ ENV_VARS: dict[str, list[dict[str, Any]]] = {
|
||||
},
|
||||
{
|
||||
"prompt": "Enter your AWS Region Name (press Enter to skip)",
|
||||
"key_name": "AWS_REGION_NAME",
|
||||
"key_name": "AWS_DEFAULT_REGION",
|
||||
},
|
||||
],
|
||||
"azure": [
|
||||
|
||||
@@ -9,7 +9,7 @@ class ReasoningEvent(BaseEvent):
|
||||
type: str
|
||||
attempt: int = 1
|
||||
agent_role: str
|
||||
task_id: str | None = None
|
||||
task_id: str
|
||||
task_name: str | None = None
|
||||
from_task: Any | None = None
|
||||
agent_id: str | None = None
|
||||
|
||||
@@ -66,12 +66,12 @@ from crewai.utilities.agent_utils import (
|
||||
has_reached_max_iterations,
|
||||
is_context_length_exceeded,
|
||||
is_inside_event_loop,
|
||||
parse_tool_call_args,
|
||||
process_llm_response,
|
||||
track_delegation_if_needed,
|
||||
)
|
||||
from crewai.utilities.constants import TRAINING_DATA_FILE
|
||||
from crewai.utilities.i18n import I18N, get_i18n
|
||||
from crewai.utilities.planning_types import PlanStep, TodoItem, TodoList
|
||||
from crewai.utilities.printer import Printer
|
||||
from crewai.utilities.string_utils import sanitize_tool_name
|
||||
from crewai.utilities.tool_utils import execute_tool_and_check_finality
|
||||
@@ -105,13 +105,6 @@ class AgentReActState(BaseModel):
|
||||
ask_for_human_input: bool = Field(default=False)
|
||||
use_native_tools: bool = Field(default=False)
|
||||
pending_tool_calls: list[Any] = Field(default_factory=list)
|
||||
plan: str | None = Field(default=None, description="Generated execution plan")
|
||||
plan_ready: bool = Field(
|
||||
default=False, description="Whether agent is ready to execute"
|
||||
)
|
||||
todos: TodoList = Field(
|
||||
default_factory=TodoList, description="Todo list for tracking plan execution"
|
||||
)
|
||||
|
||||
|
||||
class AgentExecutor(Flow[AgentReActState], CrewAgentExecutorMixin):
|
||||
@@ -400,67 +393,6 @@ class AgentExecutor(Flow[AgentReActState], CrewAgentExecutorMixin):
|
||||
self._state.iterations = value
|
||||
|
||||
@start()
|
||||
def generate_plan(self) -> None:
|
||||
"""Generate execution plan if planning is enabled.
|
||||
|
||||
This is the entry point for the agent execution flow. If planning is
|
||||
enabled on the agent, it generates a plan before execution begins.
|
||||
The plan is stored in state and todos are created from the steps.
|
||||
"""
|
||||
if not getattr(self.agent, "planning_enabled", False):
|
||||
return
|
||||
|
||||
try:
|
||||
from crewai.utilities.reasoning_handler import AgentReasoning
|
||||
|
||||
if self.task:
|
||||
planning_handler = AgentReasoning(agent=self.agent, task=self.task)
|
||||
else:
|
||||
# For kickoff() path - use input text directly, no Task needed
|
||||
input_text = getattr(self, "_kickoff_input", "")
|
||||
planning_handler = AgentReasoning(
|
||||
agent=self.agent,
|
||||
description=input_text or "Complete the requested task",
|
||||
expected_output="Complete the task successfully",
|
||||
)
|
||||
|
||||
output = planning_handler.handle_agent_reasoning()
|
||||
|
||||
self.state.plan = output.plan.plan
|
||||
self.state.plan_ready = output.plan.ready
|
||||
|
||||
if self.state.plan_ready and output.plan.steps:
|
||||
self._create_todos_from_plan(output.plan.steps)
|
||||
|
||||
# Backward compatibility: append plan to task description
|
||||
# This can be removed in Phase 2 when plan execution is implemented
|
||||
if self.task and self.state.plan:
|
||||
self.task.description += f"\n\nPlanning:\n{self.state.plan}"
|
||||
|
||||
except Exception as e:
|
||||
if hasattr(self.agent, "_logger"):
|
||||
self.agent._logger.log("error", f"Error during planning: {e!s}")
|
||||
|
||||
def _create_todos_from_plan(self, steps: list[PlanStep]) -> None:
|
||||
"""Convert plan steps into trackable todo items.
|
||||
|
||||
Args:
|
||||
steps: List of PlanStep objects from the reasoning handler.
|
||||
"""
|
||||
todos: list[TodoItem] = []
|
||||
for step in steps:
|
||||
todo = TodoItem(
|
||||
step_number=step.step_number,
|
||||
description=step.description,
|
||||
tool_to_use=step.tool_to_use,
|
||||
depends_on=step.depends_on,
|
||||
status="pending",
|
||||
)
|
||||
todos.append(todo)
|
||||
|
||||
self.state.todos = TodoList(items=todos)
|
||||
|
||||
@listen(generate_plan)
|
||||
def initialize_reasoning(self) -> Literal["initialized"]:
|
||||
"""Initialize the reasoning flow and emit agent start logs."""
|
||||
self._show_start_logs()
|
||||
@@ -917,13 +849,9 @@ class AgentExecutor(Flow[AgentReActState], CrewAgentExecutorMixin):
|
||||
call_id, func_name, func_args = info
|
||||
|
||||
# Parse arguments
|
||||
if isinstance(func_args, str):
|
||||
try:
|
||||
args_dict = json.loads(func_args)
|
||||
except json.JSONDecodeError:
|
||||
args_dict = {}
|
||||
else:
|
||||
args_dict = func_args
|
||||
args_dict, parse_error = parse_tool_call_args(func_args, func_name, call_id)
|
||||
if parse_error is not None:
|
||||
return parse_error
|
||||
|
||||
# Get agent_key for event tracking
|
||||
agent_key = getattr(self.agent, "key", "unknown") if self.agent else "unknown"
|
||||
@@ -1252,10 +1180,6 @@ class AgentExecutor(Flow[AgentReActState], CrewAgentExecutorMixin):
|
||||
self.state.is_finished = False
|
||||
self.state.use_native_tools = False
|
||||
self.state.pending_tool_calls = []
|
||||
self.state.plan = None
|
||||
self.state.plan_ready = False
|
||||
|
||||
self._kickoff_input = inputs.get("input", "")
|
||||
|
||||
if "system" in self.prompt:
|
||||
prompt = cast("SystemPromptResult", self.prompt)
|
||||
@@ -1338,10 +1262,6 @@ class AgentExecutor(Flow[AgentReActState], CrewAgentExecutorMixin):
|
||||
self.state.is_finished = False
|
||||
self.state.use_native_tools = False
|
||||
self.state.pending_tool_calls = []
|
||||
self.state.plan = None
|
||||
self.state.plan_ready = False
|
||||
|
||||
self._kickoff_input = inputs.get("input", "")
|
||||
|
||||
if "system" in self.prompt:
|
||||
prompt = cast("SystemPromptResult", self.prompt)
|
||||
|
||||
@@ -234,7 +234,7 @@ class BedrockCompletion(BaseLLM):
|
||||
aws_access_key_id: str | None = None,
|
||||
aws_secret_access_key: str | None = None,
|
||||
aws_session_token: str | None = None,
|
||||
region_name: str = "us-east-1",
|
||||
region_name: str | None = None,
|
||||
temperature: float | None = None,
|
||||
max_tokens: int | None = None,
|
||||
top_p: float | None = None,
|
||||
@@ -287,15 +287,6 @@ class BedrockCompletion(BaseLLM):
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
# Initialize Bedrock client with proper configuration
|
||||
session = Session(
|
||||
aws_access_key_id=aws_access_key_id or os.getenv("AWS_ACCESS_KEY_ID"),
|
||||
aws_secret_access_key=aws_secret_access_key
|
||||
or os.getenv("AWS_SECRET_ACCESS_KEY"),
|
||||
aws_session_token=aws_session_token or os.getenv("AWS_SESSION_TOKEN"),
|
||||
region_name=region_name,
|
||||
)
|
||||
|
||||
# Configure client with timeouts and retries following AWS best practices
|
||||
config = Config(
|
||||
read_timeout=300,
|
||||
@@ -306,8 +297,12 @@ class BedrockCompletion(BaseLLM):
|
||||
tcp_keepalive=True,
|
||||
)
|
||||
|
||||
self.client = session.client("bedrock-runtime", config=config)
|
||||
self.region_name = region_name
|
||||
self.region_name = (
|
||||
region_name
|
||||
or os.getenv("AWS_DEFAULT_REGION")
|
||||
or os.getenv("AWS_REGION_NAME")
|
||||
or "us-east-1"
|
||||
)
|
||||
|
||||
self.aws_access_key_id = aws_access_key_id or os.getenv("AWS_ACCESS_KEY_ID")
|
||||
self.aws_secret_access_key = aws_secret_access_key or os.getenv(
|
||||
@@ -315,6 +310,16 @@ class BedrockCompletion(BaseLLM):
|
||||
)
|
||||
self.aws_session_token = aws_session_token or os.getenv("AWS_SESSION_TOKEN")
|
||||
|
||||
# Initialize Bedrock client with proper configuration
|
||||
session = Session(
|
||||
aws_access_key_id=self.aws_access_key_id,
|
||||
aws_secret_access_key=self.aws_secret_access_key,
|
||||
aws_session_token=self.aws_session_token,
|
||||
region_name=self.region_name,
|
||||
)
|
||||
|
||||
self.client = session.client("bedrock-runtime", config=config)
|
||||
|
||||
self._async_exit_stack = AsyncExitStack() if AIOBOTOCORE_AVAILABLE else None
|
||||
self._async_client_initialized = False
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ from pydantic import (
|
||||
BaseModel as PydanticBaseModel,
|
||||
ConfigDict,
|
||||
Field,
|
||||
ValidationError,
|
||||
create_model,
|
||||
field_validator,
|
||||
)
|
||||
@@ -150,14 +151,37 @@ class BaseTool(BaseModel, ABC):
|
||||
|
||||
super().model_post_init(__context)
|
||||
|
||||
def _validate_kwargs(self, kwargs: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Validate keyword arguments against args_schema if present.
|
||||
|
||||
Args:
|
||||
kwargs: The keyword arguments to validate.
|
||||
|
||||
Returns:
|
||||
Validated (and possibly coerced) keyword arguments.
|
||||
|
||||
Raises:
|
||||
ValueError: If validation against args_schema fails.
|
||||
"""
|
||||
if kwargs and self.args_schema is not None and self.args_schema.model_fields:
|
||||
try:
|
||||
validated = self.args_schema.model_validate(kwargs)
|
||||
return validated.model_dump()
|
||||
except Exception as e:
|
||||
raise ValueError(
|
||||
f"Tool '{self.name}' arguments validation failed: {e}"
|
||||
) from e
|
||||
return kwargs
|
||||
|
||||
def run(
|
||||
self,
|
||||
*args: Any,
|
||||
**kwargs: Any,
|
||||
) -> Any:
|
||||
kwargs = self._validate_kwargs(kwargs)
|
||||
|
||||
result = self._run(*args, **kwargs)
|
||||
|
||||
# If _run is async, we safely run it
|
||||
if asyncio.iscoroutine(result):
|
||||
result = asyncio.run(result)
|
||||
|
||||
@@ -179,6 +203,7 @@ class BaseTool(BaseModel, ABC):
|
||||
Returns:
|
||||
The result of the tool execution.
|
||||
"""
|
||||
kwargs = self._validate_kwargs(kwargs)
|
||||
result = await self._arun(*args, **kwargs)
|
||||
self.current_usage_count += 1
|
||||
return result
|
||||
@@ -331,6 +356,8 @@ class Tool(BaseTool, Generic[P, R]):
|
||||
Returns:
|
||||
The result of the tool execution.
|
||||
"""
|
||||
kwargs = self._validate_kwargs(kwargs)
|
||||
|
||||
result = self.func(*args, **kwargs)
|
||||
|
||||
if asyncio.iscoroutine(result):
|
||||
@@ -361,6 +388,7 @@ class Tool(BaseTool, Generic[P, R]):
|
||||
Returns:
|
||||
The result of the tool execution.
|
||||
"""
|
||||
kwargs = self._validate_kwargs(kwargs)
|
||||
result = await self._arun(*args, **kwargs)
|
||||
self.current_usage_count += 1
|
||||
return result
|
||||
|
||||
@@ -74,14 +74,9 @@
|
||||
"consolidation_user": "New content to consider storing:\n{new_content}\n\nExisting similar memories:\n{records_summary}\n\nReturn the consolidation plan as structured output."
|
||||
},
|
||||
"reasoning": {
|
||||
"initial_plan": "You are {role}. Create a focused execution plan using only the essential steps needed.",
|
||||
"refine_plan": "You are {role}. Refine your plan to address the specific gap while keeping it minimal.",
|
||||
"create_plan_prompt": "You are {role}.\n\nTask: {description}\n\nExpected output: {expected_output}\n\nAvailable tools: {tools}\n\nCreate a focused plan with ONLY the essential steps needed. Most tasks require just 2-5 steps. Do NOT pad with unnecessary steps like \"review\", \"verify\", \"document\", or \"finalize\" unless explicitly required.\n\nFor each step, specify the action and which tool to use (if any).\n\nConclude with:\n- \"READY: I am ready to execute the task.\"\n- \"NOT READY: I need to refine my plan because [specific reason].\"",
|
||||
"refine_plan_prompt": "Your plan:\n{current_plan}\n\nYou indicated you're not ready. Address the specific gap while keeping the plan minimal.\n\nConclude with READY or NOT READY."
|
||||
},
|
||||
"planning": {
|
||||
"system_prompt": "You are a strategic planning assistant. Create minimal, effective execution plans. Prefer fewer steps over more.",
|
||||
"create_plan_prompt": "Create a focused execution plan for the following task:\n\n## Task\n{description}\n\n## Expected Output\n{expected_output}\n\n## Available Tools\n{tools}\n\n## Planning Principles\nFocus on WHAT needs to be accomplished, not HOW. Group related actions into logical units. Fewer steps = better. Most tasks need 3-6 steps. Hard limit: {max_steps} steps.\n\n## Step Types (only these are valid):\n1. **Tool Step**: Uses a tool to gather information or take action\n2. **Output Step**: Synthesizes prior results into the final deliverable (usually the last step)\n\n## Rules:\n- Each step must either USE A TOOL or PRODUCE THE FINAL OUTPUT\n- Combine related tool calls: \"Research A, B, and C\" = ONE step, not three\n- Combine all synthesis into ONE final output step\n- NO standalone \"thinking\" steps (review, verify, confirm, refine, analyze) - these happen naturally between steps\n\nFor each step: State the action, specify the tool (if any), and note dependencies.\n\nAfter your plan, state READY or NOT READY.",
|
||||
"refine_plan_prompt": "Your previous plan:\n{current_plan}\n\nYou indicated you weren't ready. Refine your plan to address the specific gap.\n\nKeep the plan minimal - only add steps that directly address the issue.\n\nConclude with READY or NOT READY as before."
|
||||
"initial_plan": "You are {role}, a professional with the following background: {backstory}\n\nYour primary goal is: {goal}\n\nAs {role}, you are creating a strategic plan for a task that requires your expertise and unique perspective.",
|
||||
"refine_plan": "You are {role}, a professional with the following background: {backstory}\n\nYour primary goal is: {goal}\n\nAs {role}, you are refining a strategic plan for a task that requires your expertise and unique perspective.",
|
||||
"create_plan_prompt": "You are {role} with this background: {backstory}\n\nYour primary goal is: {goal}\n\nYou have been assigned the following task:\n{description}\n\nExpected output:\n{expected_output}\n\nAvailable tools: {tools}\n\nBefore executing this task, create a detailed plan that leverages your expertise as {role} and outlines:\n1. Your understanding of the task from your professional perspective\n2. The key steps you'll take to complete it, drawing on your background and skills\n3. How you'll approach any challenges that might arise, considering your expertise\n4. How you'll strategically use the available tools based on your experience, exactly what tools to use and how to use them\n5. The expected outcome and how it aligns with your goal\n\nAfter creating your plan, assess whether you feel ready to execute the task or if you could do better.\nConclude with one of these statements:\n- \"READY: I am ready to execute the task.\"\n- \"NOT READY: I need to refine my plan because [specific reason].\"",
|
||||
"refine_plan_prompt": "You are {role} with this background: {backstory}\n\nYour primary goal is: {goal}\n\nYou created the following plan for this task:\n{current_plan}\n\nHowever, you indicated that you're not ready to execute the task yet.\n\nPlease refine your plan further, drawing on your expertise as {role} to address any gaps or uncertainties. As you refine your plan, be specific about which available tools you will use, how you will use them, and why they are the best choices for each step. Clearly outline your tool usage strategy as part of your improved plan.\n\nAfter refining your plan, assess whether you feel ready to execute the task.\nConclude with one of these statements:\n- \"READY: I am ready to execute the task.\"\n- \"NOT READY: I need to refine my plan further because [specific reason].\""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1146,6 +1146,36 @@ def extract_tool_call_info(
|
||||
return None
|
||||
|
||||
|
||||
def parse_tool_call_args(
|
||||
func_args: dict[str, Any] | str,
|
||||
func_name: str,
|
||||
call_id: str,
|
||||
original_tool: Any = None,
|
||||
) -> tuple[dict[str, Any], None] | tuple[None, dict[str, Any]]:
|
||||
"""Parse tool call arguments from a JSON string or dict.
|
||||
|
||||
Returns:
|
||||
``(args_dict, None)`` on success, or ``(None, error_result)`` on
|
||||
JSON parse failure where ``error_result`` is a ready-to-return dict
|
||||
with the same shape as ``_execute_single_native_tool_call`` return values.
|
||||
"""
|
||||
if isinstance(func_args, str):
|
||||
try:
|
||||
return json.loads(func_args), None
|
||||
except json.JSONDecodeError as e:
|
||||
return None, {
|
||||
"call_id": call_id,
|
||||
"func_name": func_name,
|
||||
"result": (
|
||||
f"Error: Failed to parse tool arguments as JSON: {e}. "
|
||||
f"Please provide valid JSON arguments for the '{func_name}' tool."
|
||||
),
|
||||
"from_cache": False,
|
||||
"original_tool": original_tool,
|
||||
}
|
||||
return func_args, None
|
||||
|
||||
|
||||
def _setup_before_llm_call_hooks(
|
||||
executor_context: CrewAgentExecutor | AgentExecutor | LiteAgent | None,
|
||||
printer: Printer,
|
||||
|
||||
@@ -69,7 +69,7 @@ def create_llm(
|
||||
UNACCEPTED_ATTRIBUTES: Final[list[str]] = [
|
||||
"AWS_ACCESS_KEY_ID",
|
||||
"AWS_SECRET_ACCESS_KEY",
|
||||
"AWS_REGION_NAME",
|
||||
"AWS_DEFAULT_REGION",
|
||||
]
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ def _llm_via_environment_or_fallback() -> LLM | None:
|
||||
unaccepted_attributes = [
|
||||
"AWS_ACCESS_KEY_ID",
|
||||
"AWS_SECRET_ACCESS_KEY",
|
||||
"AWS_REGION_NAME",
|
||||
"AWS_DEFAULT_REGION",
|
||||
]
|
||||
set_provider = model_name.partition("/")[0] if "/" in model_name else "openai"
|
||||
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
"""Types for agent planning and todo tracking."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal
|
||||
from uuid import uuid4
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
# Todo status type
|
||||
TodoStatus = Literal["pending", "running", "completed"]
|
||||
|
||||
|
||||
class PlanStep(BaseModel):
|
||||
"""A single step in the reasoning plan."""
|
||||
|
||||
step_number: int = Field(description="Step number (1-based)")
|
||||
description: str = Field(description="What to do in this step")
|
||||
tool_to_use: str | None = Field(
|
||||
default=None, description="Tool to use for this step, if any"
|
||||
)
|
||||
depends_on: list[int] = Field(
|
||||
default_factory=list, description="Step numbers this step depends on"
|
||||
)
|
||||
|
||||
|
||||
class TodoItem(BaseModel):
|
||||
"""A single todo item representing a step in the execution plan."""
|
||||
|
||||
id: str = Field(default_factory=lambda: str(uuid4()))
|
||||
step_number: int = Field(description="Order of this step in the plan (1-based)")
|
||||
description: str = Field(description="What needs to be done")
|
||||
tool_to_use: str | None = Field(
|
||||
default=None, description="Tool to use for this step, if any"
|
||||
)
|
||||
status: TodoStatus = Field(default="pending", description="Current status")
|
||||
depends_on: list[int] = Field(
|
||||
default_factory=list, description="Step numbers this depends on"
|
||||
)
|
||||
result: str | None = Field(
|
||||
default=None, description="Result after completion, if any"
|
||||
)
|
||||
|
||||
|
||||
class TodoList(BaseModel):
|
||||
"""Collection of todos for tracking plan execution."""
|
||||
|
||||
items: list[TodoItem] = Field(default_factory=list)
|
||||
|
||||
@property
|
||||
def current_todo(self) -> TodoItem | None:
|
||||
"""Get the currently running todo item."""
|
||||
for item in self.items:
|
||||
if item.status == "running":
|
||||
return item
|
||||
return None
|
||||
|
||||
@property
|
||||
def next_pending(self) -> TodoItem | None:
|
||||
"""Get the next pending todo item."""
|
||||
for item in self.items:
|
||||
if item.status == "pending":
|
||||
return item
|
||||
return None
|
||||
|
||||
@property
|
||||
def is_complete(self) -> bool:
|
||||
"""Check if all todos are completed."""
|
||||
return len(self.items) > 0 and all(
|
||||
item.status == "completed" for item in self.items
|
||||
)
|
||||
|
||||
@property
|
||||
def pending_count(self) -> int:
|
||||
"""Count of pending todos."""
|
||||
return sum(1 for item in self.items if item.status == "pending")
|
||||
|
||||
@property
|
||||
def completed_count(self) -> int:
|
||||
"""Count of completed todos."""
|
||||
return sum(1 for item in self.items if item.status == "completed")
|
||||
|
||||
def get_by_step_number(self, step_number: int) -> TodoItem | None:
|
||||
"""Get a todo by its step number."""
|
||||
for item in self.items:
|
||||
if item.step_number == step_number:
|
||||
return item
|
||||
return None
|
||||
|
||||
def mark_running(self, step_number: int) -> None:
|
||||
"""Mark a todo as running by step number."""
|
||||
item = self.get_by_step_number(step_number)
|
||||
if item:
|
||||
item.status = "running"
|
||||
|
||||
def mark_completed(self, step_number: int, result: str | None = None) -> None:
|
||||
"""Mark a todo as completed by step number."""
|
||||
item = self.get_by_step_number(step_number)
|
||||
if item:
|
||||
item.status = "completed"
|
||||
if result:
|
||||
item.result = result
|
||||
@@ -1,13 +1,10 @@
|
||||
"""Handles planning/reasoning for agents before task execution."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any, Final, Literal, cast
|
||||
from typing import Any, Final, Literal, cast
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.events.event_bus import crewai_event_bus
|
||||
from crewai.events.types.reasoning_events import (
|
||||
AgentReasoningCompletedEvent,
|
||||
@@ -15,30 +12,14 @@ from crewai.events.types.reasoning_events import (
|
||||
AgentReasoningStartedEvent,
|
||||
)
|
||||
from crewai.llm import LLM
|
||||
from crewai.utilities.llm_utils import create_llm
|
||||
from crewai.utilities.planning_types import PlanStep
|
||||
from crewai.task import Task
|
||||
from crewai.utilities.string_utils import sanitize_tool_name
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from crewai.agent import Agent
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
from crewai.task import Task
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from crewai.agent import Agent
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
from crewai.task import Task
|
||||
|
||||
|
||||
class ReasoningPlan(BaseModel):
|
||||
"""Model representing a reasoning plan for a task."""
|
||||
|
||||
plan: str = Field(description="The detailed reasoning plan for the task.")
|
||||
steps: list[PlanStep] = Field(
|
||||
default_factory=list, description="Structured steps to execute"
|
||||
)
|
||||
ready: bool = Field(description="Whether the agent is ready to execute the task.")
|
||||
|
||||
|
||||
@@ -48,63 +29,24 @@ class AgentReasoningOutput(BaseModel):
|
||||
plan: ReasoningPlan = Field(description="The reasoning plan for the task.")
|
||||
|
||||
|
||||
# Aliases for backward compatibility
|
||||
PlanningPlan = ReasoningPlan
|
||||
AgentPlanningOutput = AgentReasoningOutput
|
||||
|
||||
|
||||
FUNCTION_SCHEMA: Final[dict[str, Any]] = {
|
||||
"type": "function",
|
||||
"function": {
|
||||
"name": "create_reasoning_plan",
|
||||
"description": "Create or refine a reasoning plan for a task with structured steps",
|
||||
"description": "Create or refine a reasoning plan for a task",
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"plan": {
|
||||
"type": "string",
|
||||
"description": "A brief summary of the overall plan.",
|
||||
},
|
||||
"steps": {
|
||||
"type": "array",
|
||||
"description": "List of discrete steps to execute the plan",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"step_number": {
|
||||
"type": "integer",
|
||||
"description": "Step number (1-based)",
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"description": "What to do in this step",
|
||||
},
|
||||
"tool_to_use": {
|
||||
"type": ["string", "null"],
|
||||
"description": "Tool to use for this step, or null if no tool needed",
|
||||
},
|
||||
"depends_on": {
|
||||
"type": "array",
|
||||
"items": {"type": "integer"},
|
||||
"description": "Step numbers this step depends on (empty array if none)",
|
||||
},
|
||||
},
|
||||
"required": [
|
||||
"step_number",
|
||||
"description",
|
||||
"tool_to_use",
|
||||
"depends_on",
|
||||
],
|
||||
"additionalProperties": False,
|
||||
},
|
||||
"description": "The detailed reasoning plan for the task.",
|
||||
},
|
||||
"ready": {
|
||||
"type": "boolean",
|
||||
"description": "Whether the agent is ready to execute the task.",
|
||||
},
|
||||
},
|
||||
"required": ["plan", "steps", "ready"],
|
||||
"additionalProperties": False,
|
||||
"required": ["plan", "ready"],
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -112,101 +54,41 @@ FUNCTION_SCHEMA: Final[dict[str, Any]] = {
|
||||
|
||||
class AgentReasoning:
|
||||
"""
|
||||
Handles the agent planning/reasoning process, enabling an agent to reflect
|
||||
and create a plan before executing a task.
|
||||
Handles the agent reasoning process, enabling an agent to reflect and create a plan
|
||||
before executing a task.
|
||||
|
||||
Attributes:
|
||||
task: The task for which the agent is planning (optional).
|
||||
agent: The agent performing the planning.
|
||||
config: The planning configuration.
|
||||
llm: The language model used for planning.
|
||||
task: The task for which the agent is reasoning.
|
||||
agent: The agent performing the reasoning.
|
||||
llm: The language model used for reasoning.
|
||||
logger: Logger for logging events and errors.
|
||||
description: Task description or input text for planning.
|
||||
expected_output: Expected output description.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
agent: Agent,
|
||||
task: Task | None = None,
|
||||
*,
|
||||
description: str | None = None,
|
||||
expected_output: str | None = None,
|
||||
) -> None:
|
||||
"""Initialize the AgentReasoning with an agent and optional task.
|
||||
def __init__(self, task: Task, agent: Agent) -> None:
|
||||
"""Initialize the AgentReasoning with a task and an agent.
|
||||
|
||||
Args:
|
||||
agent: The agent performing the planning.
|
||||
task: The task for which the agent is planning (optional).
|
||||
description: Task description or input text (used if task is None).
|
||||
expected_output: Expected output (used if task is None).
|
||||
task: The task for which the agent is reasoning.
|
||||
agent: The agent performing the reasoning.
|
||||
"""
|
||||
self.agent = agent
|
||||
self.task = task
|
||||
# Use task attributes if available, otherwise use provided values
|
||||
self._description = description or (
|
||||
task.description if task else "Complete the requested task"
|
||||
)
|
||||
self._expected_output = expected_output or (
|
||||
task.expected_output if task else "Complete the task successfully"
|
||||
)
|
||||
self.config = self._get_planning_config()
|
||||
self.llm = self._resolve_llm()
|
||||
self.agent = agent
|
||||
self.llm = cast(LLM, agent.llm)
|
||||
self.logger = logging.getLogger(__name__)
|
||||
|
||||
@property
|
||||
def description(self) -> str:
|
||||
"""Get the task/input description."""
|
||||
return self._description
|
||||
|
||||
@property
|
||||
def expected_output(self) -> str:
|
||||
"""Get the expected output."""
|
||||
return self._expected_output
|
||||
|
||||
def _get_planning_config(self) -> PlanningConfig:
|
||||
"""Get the planning configuration from the agent.
|
||||
|
||||
Returns:
|
||||
The planning configuration, using defaults if not set.
|
||||
"""
|
||||
from crewai.agent.planning_config import PlanningConfig
|
||||
|
||||
if self.agent.planning_config is not None:
|
||||
return self.agent.planning_config
|
||||
# Fallback for backward compatibility
|
||||
return PlanningConfig(
|
||||
max_attempts=getattr(self.agent, "max_reasoning_attempts", None),
|
||||
)
|
||||
|
||||
def _resolve_llm(self) -> LLM:
|
||||
"""Resolve which LLM to use for planning.
|
||||
|
||||
Returns:
|
||||
The LLM to use - either from config or the agent's LLM.
|
||||
"""
|
||||
if self.config.llm is not None:
|
||||
if isinstance(self.config.llm, LLM):
|
||||
return self.config.llm
|
||||
return create_llm(self.config.llm)
|
||||
return cast(LLM, self.agent.llm)
|
||||
|
||||
def handle_agent_reasoning(self) -> AgentReasoningOutput:
|
||||
"""Public method for the planning process that creates and refines a plan
|
||||
for the task until the agent is ready to execute it.
|
||||
"""Public method for the reasoning process that creates and refines a plan for the task until the agent is ready to execute it.
|
||||
|
||||
Returns:
|
||||
AgentReasoningOutput: The output of the agent planning process.
|
||||
AgentReasoningOutput: The output of the agent reasoning process.
|
||||
"""
|
||||
task_id = str(self.task.id) if self.task else "kickoff"
|
||||
|
||||
# Emit a planning started event (attempt 1)
|
||||
# Emit a reasoning started event (attempt 1)
|
||||
try:
|
||||
crewai_event_bus.emit(
|
||||
self.agent,
|
||||
AgentReasoningStartedEvent(
|
||||
agent_role=self.agent.role,
|
||||
task_id=task_id,
|
||||
task_id=str(self.task.id),
|
||||
attempt=1,
|
||||
from_task=self.task,
|
||||
),
|
||||
@@ -216,13 +98,13 @@ class AgentReasoning:
|
||||
pass
|
||||
|
||||
try:
|
||||
output = self._execute_planning()
|
||||
output = self.__handle_agent_reasoning()
|
||||
|
||||
crewai_event_bus.emit(
|
||||
self.agent,
|
||||
AgentReasoningCompletedEvent(
|
||||
agent_role=self.agent.role,
|
||||
task_id=task_id,
|
||||
task_id=str(self.task.id),
|
||||
plan=output.plan.plan,
|
||||
ready=output.plan.ready,
|
||||
attempt=1,
|
||||
@@ -233,77 +115,71 @@ class AgentReasoning:
|
||||
|
||||
return output
|
||||
except Exception as e:
|
||||
# Emit planning failed event
|
||||
# Emit reasoning failed event
|
||||
try:
|
||||
crewai_event_bus.emit(
|
||||
self.agent,
|
||||
AgentReasoningFailedEvent(
|
||||
agent_role=self.agent.role,
|
||||
task_id=task_id,
|
||||
task_id=str(self.task.id),
|
||||
error=str(e),
|
||||
attempt=1,
|
||||
from_task=self.task,
|
||||
from_agent=self.agent,
|
||||
),
|
||||
)
|
||||
except Exception as event_error:
|
||||
logging.error(f"Error emitting planning failed event: {event_error}")
|
||||
except Exception as e:
|
||||
logging.error(f"Error emitting reasoning failed event: {e}")
|
||||
|
||||
raise
|
||||
|
||||
def _execute_planning(self) -> AgentReasoningOutput:
|
||||
"""Execute the planning process.
|
||||
def __handle_agent_reasoning(self) -> AgentReasoningOutput:
|
||||
"""Private method that handles the agent reasoning process.
|
||||
|
||||
Returns:
|
||||
The output of the agent planning process.
|
||||
The output of the agent reasoning process.
|
||||
"""
|
||||
plan, steps, ready = self._create_initial_plan()
|
||||
plan, steps, ready = self._refine_plan_if_needed(plan, steps, ready)
|
||||
plan, ready = self.__create_initial_plan()
|
||||
|
||||
reasoning_plan = ReasoningPlan(plan=plan, steps=steps, ready=ready)
|
||||
plan, ready = self.__refine_plan_if_needed(plan, ready)
|
||||
|
||||
reasoning_plan = ReasoningPlan(plan=plan, ready=ready)
|
||||
return AgentReasoningOutput(plan=reasoning_plan)
|
||||
|
||||
def _create_initial_plan(self) -> tuple[str, list[PlanStep], bool]:
|
||||
"""Creates the initial plan for the task.
|
||||
def __create_initial_plan(self) -> tuple[str, bool]:
|
||||
"""Creates the initial reasoning plan for the task.
|
||||
|
||||
Returns:
|
||||
A tuple of the plan summary, list of steps, and whether the agent is ready.
|
||||
The initial plan and whether the agent is ready to execute the task.
|
||||
"""
|
||||
planning_prompt = self._create_planning_prompt()
|
||||
planning_prompt = self._create_planning_prompt()
|
||||
reasoning_prompt = self.__create_reasoning_prompt()
|
||||
|
||||
if self.llm.supports_function_calling():
|
||||
plan, steps, ready = self._call_with_function(
|
||||
planning_prompt, "create_plan"
|
||||
)
|
||||
return plan, steps, ready
|
||||
|
||||
response = self._call_llm_with_prompt(
|
||||
prompt=planning_prompt,
|
||||
plan_type="create_plan",
|
||||
plan, ready = self.__call_with_function(reasoning_prompt, "initial_plan")
|
||||
return plan, ready
|
||||
response = _call_llm_with_reasoning_prompt(
|
||||
llm=self.llm,
|
||||
prompt=reasoning_prompt,
|
||||
task=self.task,
|
||||
reasoning_agent=self.agent,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
plan_type="initial_plan",
|
||||
)
|
||||
|
||||
plan, ready = self._parse_planning_response(str(response))
|
||||
return plan, [], ready # No structured steps from text parsing
|
||||
return self.__parse_reasoning_response(str(response))
|
||||
|
||||
def _refine_plan_if_needed(
|
||||
self, plan: str, steps: list[PlanStep], ready: bool
|
||||
) -> tuple[str, list[PlanStep], bool]:
|
||||
"""Refines the plan if the agent is not ready to execute the task.
|
||||
def __refine_plan_if_needed(self, plan: str, ready: bool) -> tuple[str, bool]:
|
||||
"""Refines the reasoning plan if the agent is not ready to execute the task.
|
||||
|
||||
Args:
|
||||
plan: The current plan.
|
||||
steps: The current list of steps.
|
||||
plan: The current reasoning plan.
|
||||
ready: Whether the agent is ready to execute the task.
|
||||
|
||||
Returns:
|
||||
The refined plan, steps, and whether the agent is ready to execute.
|
||||
The refined plan and whether the agent is ready to execute the task.
|
||||
"""
|
||||
|
||||
attempt = 1
|
||||
max_attempts = self.config.max_attempts
|
||||
task_id = str(self.task.id) if self.task else "kickoff"
|
||||
current_attempt = attempt + 1
|
||||
max_attempts = self.agent.max_reasoning_attempts
|
||||
|
||||
while not ready and (max_attempts is None or attempt < max_attempts):
|
||||
# Emit event for each refinement attempt
|
||||
@@ -312,82 +188,62 @@ class AgentReasoning:
|
||||
self.agent,
|
||||
AgentReasoningStartedEvent(
|
||||
agent_role=self.agent.role,
|
||||
task_id=task_id,
|
||||
attempt=current_attempt,
|
||||
task_id=str(self.task.id),
|
||||
attempt=attempt + 1,
|
||||
from_task=self.task,
|
||||
),
|
||||
)
|
||||
except Exception: # noqa: S110
|
||||
pass
|
||||
|
||||
refine_prompt = self._create_refine_prompt(plan)
|
||||
refine_prompt = self._create_refine_prompt(plan)
|
||||
refine_prompt = self.__create_refine_prompt(plan)
|
||||
|
||||
if self.llm.supports_function_calling():
|
||||
plan, steps, ready = self._call_with_function(
|
||||
refine_prompt, "refine_plan"
|
||||
)
|
||||
plan, ready = self.__call_with_function(refine_prompt, "refine_plan")
|
||||
else:
|
||||
response = self._call_llm_with_prompt(
|
||||
response = _call_llm_with_reasoning_prompt(
|
||||
llm=self.llm,
|
||||
prompt=refine_prompt,
|
||||
task=self.task,
|
||||
reasoning_agent=self.agent,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
plan_type="refine_plan",
|
||||
)
|
||||
plan, ready = self._parse_planning_response(str(response))
|
||||
steps = [] # No structured steps from text parsing
|
||||
|
||||
# Emit completed event for this refinement attempt
|
||||
try:
|
||||
crewai_event_bus.emit(
|
||||
self.agent,
|
||||
AgentReasoningCompletedEvent(
|
||||
agent_role=self.agent.role,
|
||||
task_id=task_id,
|
||||
plan=plan,
|
||||
ready=ready,
|
||||
attempt=current_attempt,
|
||||
from_task=self.task,
|
||||
from_agent=self.agent,
|
||||
),
|
||||
)
|
||||
except Exception: # noqa: S110
|
||||
pass
|
||||
plan, ready = self.__parse_reasoning_response(str(response))
|
||||
|
||||
attempt += 1
|
||||
|
||||
if max_attempts is not None and attempt >= max_attempts:
|
||||
self.logger.warning(
|
||||
f"Agent planning reached maximum attempts ({max_attempts}) "
|
||||
"without being ready. Proceeding with current plan."
|
||||
f"Agent reasoning reached maximum attempts ({max_attempts}) without being ready. Proceeding with current plan."
|
||||
)
|
||||
break
|
||||
|
||||
return plan, steps, ready
|
||||
return plan, ready
|
||||
|
||||
def _call_with_function(
|
||||
self, prompt: str, plan_type: Literal["create_plan", "refine_plan"]
|
||||
) -> tuple[str, list[PlanStep], bool]:
|
||||
"""Calls the LLM with function calling to get a plan.
|
||||
def __call_with_function(self, prompt: str, prompt_type: str) -> tuple[str, bool]:
|
||||
"""Calls the LLM with function calling to get a reasoning plan.
|
||||
|
||||
Args:
|
||||
prompt: The prompt to send to the LLM.
|
||||
plan_type: The type of plan being created.
|
||||
prompt_type: The type of prompt (initial_plan or refine_plan).
|
||||
|
||||
Returns:
|
||||
A tuple containing the plan summary, list of steps, and whether the agent is ready.
|
||||
A tuple containing the plan and whether the agent is ready.
|
||||
"""
|
||||
self.logger.debug(f"Using function calling for {plan_type} planning")
|
||||
self.logger.debug(f"Using function calling for {prompt_type} reasoning")
|
||||
|
||||
try:
|
||||
system_prompt = self._get_system_prompt()
|
||||
system_prompt = self.agent.i18n.retrieve("reasoning", prompt_type).format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
)
|
||||
|
||||
# Prepare a simple callable that just returns the tool arguments as JSON
|
||||
def _create_reasoning_plan(
|
||||
plan: str,
|
||||
steps: list[dict[str, Any]] | None = None,
|
||||
ready: bool = True,
|
||||
) -> str:
|
||||
"""Return the planning result in JSON string form."""
|
||||
return json.dumps({"plan": plan, "steps": steps or [], "ready": ready})
|
||||
def _create_reasoning_plan(plan: str, ready: bool = True) -> str:
|
||||
"""Return the reasoning plan result in JSON string form."""
|
||||
return json.dumps({"plan": plan, "ready": ready})
|
||||
|
||||
response = self.llm.call(
|
||||
[
|
||||
@@ -399,33 +255,19 @@ class AgentReasoning:
|
||||
from_task=self.task,
|
||||
from_agent=self.agent,
|
||||
)
|
||||
|
||||
self.logger.debug(f"Function calling response: {response[:100]}...")
|
||||
|
||||
try:
|
||||
result = json.loads(response)
|
||||
if "plan" in result and "ready" in result:
|
||||
# Parse steps from the response
|
||||
steps: list[PlanStep] = []
|
||||
raw_steps = result.get("steps", [])
|
||||
try:
|
||||
for step_data in raw_steps:
|
||||
step = PlanStep(
|
||||
step_number=step_data.get("step_number", 0),
|
||||
description=step_data.get("description", ""),
|
||||
tool_to_use=step_data.get("tool_to_use"),
|
||||
depends_on=step_data.get("depends_on", []),
|
||||
)
|
||||
steps.append(step)
|
||||
except Exception as step_error:
|
||||
self.logger.warning(
|
||||
f"Failed to parse step: {step_data}, error: {step_error}"
|
||||
)
|
||||
return result["plan"], steps, result["ready"]
|
||||
return result["plan"], result["ready"]
|
||||
except (json.JSONDecodeError, KeyError):
|
||||
pass
|
||||
|
||||
response_str = str(response)
|
||||
return (
|
||||
response_str,
|
||||
[],
|
||||
"READY: I am ready to execute the task." in response_str,
|
||||
)
|
||||
|
||||
@@ -435,7 +277,13 @@ class AgentReasoning:
|
||||
)
|
||||
|
||||
try:
|
||||
system_prompt = self._get_system_prompt()
|
||||
system_prompt = self.agent.i18n.retrieve(
|
||||
"reasoning", prompt_type
|
||||
).format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
)
|
||||
|
||||
fallback_response = self.llm.call(
|
||||
[
|
||||
@@ -449,165 +297,78 @@ class AgentReasoning:
|
||||
fallback_str = str(fallback_response)
|
||||
return (
|
||||
fallback_str,
|
||||
[],
|
||||
"READY: I am ready to execute the task." in fallback_str,
|
||||
)
|
||||
except Exception as inner_e:
|
||||
self.logger.error(f"Error during fallback text parsing: {inner_e!s}")
|
||||
return (
|
||||
"Failed to generate a plan due to an error.",
|
||||
[],
|
||||
True,
|
||||
) # Default to ready to avoid getting stuck
|
||||
|
||||
def _call_llm_with_prompt(
|
||||
self,
|
||||
prompt: str,
|
||||
plan_type: Literal["create_plan", "refine_plan"],
|
||||
) -> str:
|
||||
"""Calls the LLM with the planning prompt.
|
||||
|
||||
Args:
|
||||
prompt: The prompt to send to the LLM.
|
||||
plan_type: The type of plan being created.
|
||||
|
||||
Returns:
|
||||
The LLM response.
|
||||
def __get_agent_backstory(self) -> str:
|
||||
"""
|
||||
system_prompt = self._get_system_prompt()
|
||||
|
||||
response = self.llm.call(
|
||||
[
|
||||
{"role": "system", "content": system_prompt},
|
||||
{"role": "user", "content": prompt},
|
||||
],
|
||||
from_task=self.task,
|
||||
from_agent=self.agent,
|
||||
)
|
||||
return str(response)
|
||||
|
||||
def _get_system_prompt(self) -> str:
|
||||
"""Get the system prompt for planning.
|
||||
Safely gets the agent's backstory, providing a default if not available.
|
||||
|
||||
Returns:
|
||||
The system prompt, either custom or from i18n.
|
||||
"""
|
||||
if self.config.system_prompt is not None:
|
||||
return self.config.system_prompt
|
||||
|
||||
# Try new "planning" section first, fall back to "reasoning" for compatibility
|
||||
try:
|
||||
return self.agent.i18n.retrieve("planning", "system_prompt")
|
||||
except (KeyError, AttributeError):
|
||||
# Fallback to reasoning section for backward compatibility
|
||||
return self.agent.i18n.retrieve("reasoning", "initial_plan").format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self._get_agent_backstory(),
|
||||
)
|
||||
|
||||
def _get_agent_backstory(self) -> str:
|
||||
"""Safely gets the agent's backstory, providing a default if not available.
|
||||
|
||||
Returns:
|
||||
The agent's backstory or a default value.
|
||||
str: The agent's backstory or a default value.
|
||||
"""
|
||||
return getattr(self.agent, "backstory", "No backstory provided")
|
||||
|
||||
def _create_planning_prompt(self) -> str:
|
||||
"""Creates a prompt for the agent to plan the task.
|
||||
def __create_reasoning_prompt(self) -> str:
|
||||
"""
|
||||
Creates a prompt for the agent to reason about the task.
|
||||
|
||||
Returns:
|
||||
The planning prompt.
|
||||
str: The reasoning prompt.
|
||||
"""
|
||||
available_tools = self._format_available_tools()
|
||||
available_tools = self.__format_available_tools()
|
||||
|
||||
# Use custom prompt if provided
|
||||
if self.config.plan_prompt is not None:
|
||||
return self.config.plan_prompt.format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self._get_agent_backstory(),
|
||||
description=self.description,
|
||||
expected_output=self.expected_output,
|
||||
tools=available_tools,
|
||||
max_steps=self.config.max_steps,
|
||||
)
|
||||
return self.agent.i18n.retrieve("reasoning", "create_plan_prompt").format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
description=self.task.description,
|
||||
expected_output=self.task.expected_output,
|
||||
tools=available_tools,
|
||||
)
|
||||
|
||||
# Try new "planning" section first
|
||||
try:
|
||||
return self.agent.i18n.retrieve("planning", "create_plan_prompt").format(
|
||||
description=self.description,
|
||||
expected_output=self.expected_output,
|
||||
tools=available_tools,
|
||||
max_steps=self.config.max_steps,
|
||||
)
|
||||
except (KeyError, AttributeError):
|
||||
# Fallback to reasoning section for backward compatibility
|
||||
return self.agent.i18n.retrieve("reasoning", "create_plan_prompt").format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self._get_agent_backstory(),
|
||||
description=self.description,
|
||||
expected_output=self.expected_output,
|
||||
tools=available_tools,
|
||||
)
|
||||
|
||||
def _format_available_tools(self) -> str:
|
||||
"""Formats the available tools for inclusion in the prompt.
|
||||
def __format_available_tools(self) -> str:
|
||||
"""
|
||||
Formats the available tools for inclusion in the prompt.
|
||||
|
||||
Returns:
|
||||
Comma-separated list of tool names.
|
||||
str: Comma-separated list of tool names.
|
||||
"""
|
||||
try:
|
||||
# Try task tools first, then agent tools
|
||||
tools = []
|
||||
if self.task:
|
||||
tools = self.task.tools or []
|
||||
if not tools:
|
||||
tools = getattr(self.agent, "tools", []) or []
|
||||
if not tools:
|
||||
return "No tools available"
|
||||
return ", ".join([sanitize_tool_name(tool.name) for tool in tools])
|
||||
return ", ".join(
|
||||
[sanitize_tool_name(tool.name) for tool in (self.task.tools or [])]
|
||||
)
|
||||
except (AttributeError, TypeError):
|
||||
return "No tools available"
|
||||
|
||||
def _create_refine_prompt(self, current_plan: str) -> str:
|
||||
"""Creates a prompt for the agent to refine its plan.
|
||||
def __create_refine_prompt(self, current_plan: str) -> str:
|
||||
"""
|
||||
Creates a prompt for the agent to refine its reasoning plan.
|
||||
|
||||
Args:
|
||||
current_plan: The current plan.
|
||||
current_plan: The current reasoning plan.
|
||||
|
||||
Returns:
|
||||
The refine prompt.
|
||||
str: The refine prompt.
|
||||
"""
|
||||
# Use custom prompt if provided
|
||||
if self.config.refine_prompt is not None:
|
||||
return self.config.refine_prompt.format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self._get_agent_backstory(),
|
||||
current_plan=current_plan,
|
||||
max_steps=self.config.max_steps,
|
||||
)
|
||||
|
||||
# Try new "planning" section first
|
||||
try:
|
||||
return self.agent.i18n.retrieve("planning", "refine_plan_prompt").format(
|
||||
current_plan=current_plan,
|
||||
)
|
||||
except (KeyError, AttributeError):
|
||||
# Fallback to reasoning section for backward compatibility
|
||||
return self.agent.i18n.retrieve("reasoning", "refine_plan_prompt").format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self._get_agent_backstory(),
|
||||
current_plan=current_plan,
|
||||
)
|
||||
return self.agent.i18n.retrieve("reasoning", "refine_plan_prompt").format(
|
||||
role=self.agent.role,
|
||||
goal=self.agent.goal,
|
||||
backstory=self.__get_agent_backstory(),
|
||||
current_plan=current_plan,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _parse_planning_response(response: str) -> tuple[str, bool]:
|
||||
"""Parses the planning response to extract the plan and readiness.
|
||||
def __parse_reasoning_response(response: str) -> tuple[str, bool]:
|
||||
"""
|
||||
Parses the reasoning response to extract the plan and whether
|
||||
the agent is ready to execute the task.
|
||||
|
||||
Args:
|
||||
response: The LLM response.
|
||||
@@ -619,13 +380,25 @@ class AgentReasoning:
|
||||
return "No plan was generated.", False
|
||||
|
||||
plan = response
|
||||
ready = "READY: I am ready to execute the task." in response
|
||||
ready = False
|
||||
|
||||
if "READY: I am ready to execute the task." in response:
|
||||
ready = True
|
||||
|
||||
return plan, ready
|
||||
|
||||
def _handle_agent_reasoning(self) -> AgentReasoningOutput:
|
||||
"""
|
||||
Deprecated method for backward compatibility.
|
||||
Use handle_agent_reasoning() instead.
|
||||
|
||||
# Alias for backward compatibility
|
||||
AgentPlanning = AgentReasoning
|
||||
Returns:
|
||||
AgentReasoningOutput: The output of the agent reasoning process.
|
||||
"""
|
||||
self.logger.warning(
|
||||
"The _handle_agent_reasoning method is deprecated. Use handle_agent_reasoning instead."
|
||||
)
|
||||
return self.handle_agent_reasoning()
|
||||
|
||||
|
||||
def _call_llm_with_reasoning_prompt(
|
||||
@@ -636,9 +409,7 @@ def _call_llm_with_reasoning_prompt(
|
||||
backstory: str,
|
||||
plan_type: Literal["initial_plan", "refine_plan"],
|
||||
) -> str:
|
||||
"""Deprecated: Calls the LLM with the reasoning prompt.
|
||||
|
||||
This function is kept for backward compatibility.
|
||||
"""Calls the LLM with the reasoning prompt.
|
||||
|
||||
Args:
|
||||
llm: The language model to use.
|
||||
@@ -646,7 +417,7 @@ def _call_llm_with_reasoning_prompt(
|
||||
task: The task for which the agent is reasoning.
|
||||
reasoning_agent: The agent performing the reasoning.
|
||||
backstory: The agent's backstory.
|
||||
plan_type: The type of plan being created.
|
||||
plan_type: The type of plan being created ("initial_plan" or "refine_plan").
|
||||
|
||||
Returns:
|
||||
The LLM response.
|
||||
|
||||
@@ -1456,7 +1456,7 @@ def test_agent_execute_task_with_tool():
|
||||
)
|
||||
|
||||
result = agent.execute_task(task)
|
||||
assert "test query" in result
|
||||
assert "you should always think about what to do" in result
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
@@ -1475,9 +1475,9 @@ def test_agent_execute_task_with_custom_llm():
|
||||
)
|
||||
|
||||
result = agent.execute_task(task)
|
||||
assert "Artificial minds" in result
|
||||
assert "Code and circuits" in result
|
||||
assert "Future undefined" in result
|
||||
assert "In circuits they thrive" in result
|
||||
assert "Artificial minds awake" in result
|
||||
assert "Future's coded drive" in result
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
|
||||
@@ -26,18 +26,6 @@ class TestAgentReActState:
|
||||
assert state.current_answer is None
|
||||
assert state.is_finished is False
|
||||
assert state.ask_for_human_input is False
|
||||
# Planning state fields
|
||||
assert state.plan is None
|
||||
assert state.plan_ready is False
|
||||
|
||||
def test_state_with_plan(self):
|
||||
"""Test AgentReActState initialization with planning fields."""
|
||||
state = AgentReActState(
|
||||
plan="Step 1: Do X\nStep 2: Do Y",
|
||||
plan_ready=True,
|
||||
)
|
||||
assert state.plan == "Step 1: Do X\nStep 2: Do Y"
|
||||
assert state.plan_ready is True
|
||||
|
||||
def test_state_with_values(self):
|
||||
"""Test AgentReActState initialization with values."""
|
||||
@@ -648,249 +636,3 @@ class TestNativeToolExecution:
|
||||
tool_messages = [m for m in executor.state.messages if m.get("role") == "tool"]
|
||||
assert len(tool_messages) == 1
|
||||
assert tool_messages[0]["tool_call_id"] == "call_1"
|
||||
|
||||
|
||||
class TestAgentExecutorPlanning:
|
||||
"""Test planning functionality in AgentExecutor with real agent kickoff."""
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_with_planning_stores_plan_in_state(self):
|
||||
"""Test that Agent.kickoff() with planning enabled stores plan in executor state."""
|
||||
from crewai import Agent, PlanningConfig
|
||||
from crewai.llm import LLM
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve simple math problems",
|
||||
backstory="A helpful assistant that solves math problems step by step",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Execute kickoff with a simple task
|
||||
result = agent.kickoff("What is 2 + 2?")
|
||||
|
||||
# Verify result
|
||||
assert result is not None
|
||||
assert "4" in str(result)
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_without_planning_skips_plan_generation(self):
|
||||
"""Test that Agent.kickoff() without planning skips planning phase."""
|
||||
from crewai import Agent
|
||||
from crewai.llm import LLM
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve simple math problems",
|
||||
backstory="A helpful assistant",
|
||||
llm=llm,
|
||||
# No planning_config = no planning
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Execute kickoff
|
||||
result = agent.kickoff("What is 3 + 3?")
|
||||
|
||||
# Verify we get a result
|
||||
assert result is not None
|
||||
assert "6" in str(result)
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_planning_disabled_skips_planning(self):
|
||||
"""Test that planning=False skips planning."""
|
||||
from crewai import Agent
|
||||
from crewai.llm import LLM
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve simple math problems",
|
||||
backstory="A helpful assistant",
|
||||
llm=llm,
|
||||
planning=False, # Explicitly disable planning
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff("What is 5 + 5?")
|
||||
|
||||
# Should still complete successfully
|
||||
assert result is not None
|
||||
assert "10" in str(result)
|
||||
|
||||
def test_backward_compat_reasoning_true_enables_planning(self):
|
||||
"""Test that reasoning=True (deprecated) still enables planning."""
|
||||
import warnings
|
||||
from crewai import Agent
|
||||
from crewai.llm import LLM
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
with warnings.catch_warnings(record=True):
|
||||
warnings.simplefilter("always")
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="Complete tasks",
|
||||
backstory="A helpful agent",
|
||||
llm=llm,
|
||||
reasoning=True, # Deprecated but should still work
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Should have planning_config created from reasoning=True
|
||||
assert agent.planning_config is not None
|
||||
assert agent.planning_enabled is True
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_executor_state_contains_plan_after_planning(self):
|
||||
"""Test that executor state contains plan after planning phase."""
|
||||
from crewai import Agent, PlanningConfig
|
||||
from crewai.llm import LLM
|
||||
from crewai.experimental.agent_executor import AgentExecutor
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve simple math problems",
|
||||
backstory="A helpful assistant that solves math problems step by step",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Track executor for inspection
|
||||
executor_ref = [None]
|
||||
original_invoke = AgentExecutor.invoke
|
||||
|
||||
def capture_executor(self, inputs):
|
||||
executor_ref[0] = self
|
||||
return original_invoke(self, inputs)
|
||||
|
||||
with patch.object(AgentExecutor, "invoke", capture_executor):
|
||||
result = agent.kickoff("What is 7 + 7?")
|
||||
|
||||
# Verify result
|
||||
assert result is not None
|
||||
|
||||
# If we captured an executor, check its state
|
||||
if executor_ref[0] is not None:
|
||||
# After planning, state should have plan info
|
||||
assert hasattr(executor_ref[0].state, "plan")
|
||||
assert hasattr(executor_ref[0].state, "plan_ready")
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_planning_creates_minimal_steps_for_multi_step_task(self):
|
||||
"""Test that planning creates only necessary steps for a multi-step task.
|
||||
|
||||
This task requires exactly 3 dependent steps:
|
||||
1. Identify the first 3 prime numbers (2, 3, 5)
|
||||
2. Sum them (2 + 3 + 5 = 10)
|
||||
3. Multiply by 2 (10 * 2 = 20)
|
||||
|
||||
The plan should reflect these dependencies without unnecessary padding.
|
||||
"""
|
||||
from crewai import Agent, PlanningConfig
|
||||
from crewai.llm import LLM
|
||||
from crewai.experimental.agent_executor import AgentExecutor
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Tutor",
|
||||
goal="Solve multi-step math problems accurately",
|
||||
backstory="An expert math tutor who breaks down problems step by step",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1, max_steps=10),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Track the plan that gets generated
|
||||
captured_plan = [None]
|
||||
original_invoke = AgentExecutor.invoke
|
||||
|
||||
def capture_plan(self, inputs):
|
||||
result = original_invoke(self, inputs)
|
||||
captured_plan[0] = self.state.plan
|
||||
return result
|
||||
|
||||
with patch.object(AgentExecutor, "invoke", capture_plan):
|
||||
result = agent.kickoff(
|
||||
"Calculate the sum of the first 3 prime numbers, then multiply that result by 2. "
|
||||
"Show your work for each step."
|
||||
)
|
||||
|
||||
# Verify result contains the correct answer (20)
|
||||
assert result is not None
|
||||
assert "20" in str(result)
|
||||
|
||||
# Verify a plan was generated
|
||||
assert captured_plan[0] is not None
|
||||
|
||||
# The plan should be concise - this task needs ~3 steps, not 10+
|
||||
plan_text = captured_plan[0]
|
||||
# Count steps by looking for numbered items or bullet points
|
||||
import re
|
||||
|
||||
step_pattern = r"^\s*\d+[\.\):]|\n\s*-\s+"
|
||||
steps = re.findall(step_pattern, plan_text, re.MULTILINE)
|
||||
# Plan should have roughly 3-5 steps, not fill up to max_steps
|
||||
assert len(steps) <= 6, f"Plan has too many steps ({len(steps)}): {plan_text}"
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_planning_handles_sequential_dependency_task(self):
|
||||
"""Test planning for a task where step N depends on step N-1.
|
||||
|
||||
Task: Convert 100 Celsius to Fahrenheit, then round to nearest 10.
|
||||
Step 1: Apply formula (C * 9/5 + 32) = 212
|
||||
Step 2: Round 212 to nearest 10 = 210
|
||||
|
||||
This tests that the planner recognizes sequential dependencies.
|
||||
"""
|
||||
from crewai import Agent, PlanningConfig
|
||||
from crewai.llm import LLM
|
||||
from crewai.experimental.agent_executor import AgentExecutor
|
||||
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Unit Converter",
|
||||
goal="Accurately convert between units and apply transformations",
|
||||
backstory="A precise unit conversion specialist",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1, max_steps=10),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
captured_plan = [None]
|
||||
original_invoke = AgentExecutor.invoke
|
||||
|
||||
def capture_plan(self, inputs):
|
||||
result = original_invoke(self, inputs)
|
||||
captured_plan[0] = self.state.plan
|
||||
return result
|
||||
|
||||
with patch.object(AgentExecutor, "invoke", capture_plan):
|
||||
result = agent.kickoff(
|
||||
"Convert 100 degrees Celsius to Fahrenheit, then round the result to the nearest 10."
|
||||
)
|
||||
|
||||
assert result is not None
|
||||
# 100C = 212F, rounded to nearest 10 = 210
|
||||
assert "210" in str(result) or "212" in str(result)
|
||||
|
||||
# Plan should exist and be minimal (2-3 steps for this task)
|
||||
assert captured_plan[0] is not None
|
||||
plan_text = captured_plan[0]
|
||||
|
||||
import re
|
||||
|
||||
step_pattern = r"^\s*\d+[\.\):]|\n\s*-\s+"
|
||||
steps = re.findall(step_pattern, plan_text, re.MULTILINE)
|
||||
assert len(steps) <= 5, f"Plan should be minimal ({len(steps)} steps): {plan_text}"
|
||||
|
||||
@@ -1,345 +1,240 @@
|
||||
"""Tests for planning/reasoning in agents."""
|
||||
"""Tests for reasoning in agents."""
|
||||
|
||||
import warnings
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from crewai import Agent, PlanningConfig, Task
|
||||
from crewai import Agent, Task
|
||||
from crewai.llm import LLM
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Tests for PlanningConfig configuration (no LLM calls needed)
|
||||
# =============================================================================
|
||||
@pytest.fixture
|
||||
def mock_llm_responses():
|
||||
"""Fixture for mock LLM responses."""
|
||||
return {
|
||||
"ready": "I'll solve this simple math problem.\n\nREADY: I am ready to execute the task.\n\n",
|
||||
"not_ready": "I need to think about derivatives.\n\nNOT READY: I need to refine my plan because I'm not sure about the derivative rules.",
|
||||
"ready_after_refine": "I'll use the power rule for derivatives where d/dx(x^n) = n*x^(n-1).\n\nREADY: I am ready to execute the task.",
|
||||
"execution": "4",
|
||||
}
|
||||
|
||||
|
||||
def test_planning_config_default_values():
|
||||
"""Test PlanningConfig default values."""
|
||||
config = PlanningConfig()
|
||||
|
||||
assert config.max_attempts is None
|
||||
assert config.max_steps == 20
|
||||
assert config.system_prompt is None
|
||||
assert config.plan_prompt is None
|
||||
assert config.refine_prompt is None
|
||||
assert config.llm is None
|
||||
|
||||
|
||||
def test_planning_config_custom_values():
|
||||
"""Test PlanningConfig with custom values."""
|
||||
config = PlanningConfig(
|
||||
max_attempts=5,
|
||||
max_steps=15,
|
||||
system_prompt="Custom system",
|
||||
plan_prompt="Custom plan: {description}",
|
||||
refine_prompt="Custom refine: {current_plan}",
|
||||
llm="gpt-4",
|
||||
)
|
||||
|
||||
assert config.max_attempts == 5
|
||||
assert config.max_steps == 15
|
||||
assert config.system_prompt == "Custom system"
|
||||
assert config.plan_prompt == "Custom plan: {description}"
|
||||
assert config.refine_prompt == "Custom refine: {current_plan}"
|
||||
assert config.llm == "gpt-4"
|
||||
|
||||
|
||||
def test_agent_with_planning_config_custom_prompts():
|
||||
"""Test agent with PlanningConfig using custom prompts."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
custom_system_prompt = "You are a specialized planner."
|
||||
custom_plan_prompt = "Plan this task: {description}"
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test custom prompts",
|
||||
backstory="I am a test agent.",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(
|
||||
system_prompt=custom_system_prompt,
|
||||
plan_prompt=custom_plan_prompt,
|
||||
max_steps=10,
|
||||
),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Just test that the agent is created properly
|
||||
assert agent.planning_config is not None
|
||||
assert agent.planning_config.system_prompt == custom_system_prompt
|
||||
assert agent.planning_config.plan_prompt == custom_plan_prompt
|
||||
assert agent.planning_config.max_steps == 10
|
||||
|
||||
|
||||
def test_agent_with_planning_config_disabled():
|
||||
"""Test agent with PlanningConfig disabled."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test disabled planning",
|
||||
backstory="I am a test agent.",
|
||||
llm=llm,
|
||||
planning=False,
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Planning should be disabled
|
||||
assert agent.planning_enabled is False
|
||||
|
||||
|
||||
def test_planning_enabled_property():
|
||||
"""Test the planning_enabled property on Agent."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
# With planning_config enabled
|
||||
agent_with_planning = Agent(
|
||||
role="Test Agent",
|
||||
goal="Test",
|
||||
backstory="Test",
|
||||
llm=llm,
|
||||
planning=True,
|
||||
)
|
||||
assert agent_with_planning.planning_enabled is True
|
||||
|
||||
# With planning_config disabled
|
||||
agent_disabled = Agent(
|
||||
role="Test Agent",
|
||||
goal="Test",
|
||||
backstory="Test",
|
||||
llm=llm,
|
||||
planning=False,
|
||||
)
|
||||
assert agent_disabled.planning_enabled is False
|
||||
|
||||
# Without planning_config
|
||||
agent_no_planning = Agent(
|
||||
role="Test Agent",
|
||||
goal="Test",
|
||||
backstory="Test",
|
||||
llm=llm,
|
||||
)
|
||||
assert agent_no_planning.planning_enabled is False
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Tests for backward compatibility with reasoning=True (no LLM calls)
|
||||
# =============================================================================
|
||||
|
||||
|
||||
def test_agent_with_reasoning_backward_compat():
|
||||
"""Test agent with reasoning=True (backward compatibility)."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
# This should emit a deprecation warning
|
||||
with warnings.catch_warnings(record=True):
|
||||
warnings.simplefilter("always")
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
reasoning=True,
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Should have created a PlanningConfig internally
|
||||
assert agent.planning_config is not None
|
||||
assert agent.planning_enabled is True
|
||||
|
||||
|
||||
def test_agent_with_reasoning_and_max_attempts_backward_compat():
|
||||
"""Test agent with reasoning=True and max_reasoning_attempts (backward compatibility)."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
def test_agent_with_reasoning(mock_llm_responses):
|
||||
"""Test agent with reasoning."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent.",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=5,
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Should have created a PlanningConfig with max_attempts
|
||||
assert agent.planning_config is not None
|
||||
assert agent.planning_config.max_attempts == 5
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Tests for Agent.kickoff() with planning (uses AgentExecutor)
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_with_planning():
|
||||
"""Test Agent.kickoff() with planning enabled generates a plan."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve math problems step by step",
|
||||
backstory="A helpful math tutor",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff("What is 15 + 27?")
|
||||
|
||||
assert result is not None
|
||||
assert "42" in str(result)
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_without_planning():
|
||||
"""Test Agent.kickoff() without planning skips plan generation."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve math problems",
|
||||
backstory="A helpful assistant",
|
||||
llm=llm,
|
||||
# No planning_config = no planning
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff("What is 8 * 7?")
|
||||
|
||||
assert result is not None
|
||||
assert "56" in str(result)
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_with_planning_disabled():
|
||||
"""Test Agent.kickoff() with planning explicitly disabled via planning=False."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve math problems",
|
||||
backstory="A helpful assistant",
|
||||
llm=llm,
|
||||
planning=False, # Explicitly disable planning
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff("What is 100 / 4?")
|
||||
|
||||
assert result is not None
|
||||
assert "25" in str(result)
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_kickoff_multi_step_task_with_planning():
|
||||
"""Test Agent.kickoff() with a multi-step task that benefits from planning."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Tutor",
|
||||
goal="Solve multi-step math problems",
|
||||
backstory="An expert tutor who explains step by step",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1, max_steps=5),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
# Task requires: find primes, sum them, then double
|
||||
result = agent.kickoff(
|
||||
"Find the first 3 prime numbers, add them together, then multiply by 2."
|
||||
)
|
||||
|
||||
assert result is not None
|
||||
# First 3 primes: 2, 3, 5 -> sum = 10 -> doubled = 20
|
||||
assert "20" in str(result)
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Tests for Agent.execute_task() with planning (uses CrewAgentExecutor)
|
||||
# These test the legacy path via handle_reasoning()
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_execute_task_with_planning():
|
||||
"""Test Agent.execute_task() with planning via CrewAgentExecutor."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve math problems",
|
||||
backstory="A helpful math tutor",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="What is 9 + 11?",
|
||||
expected_output="A number",
|
||||
description="Simple math task: What's 2+2?",
|
||||
expected_output="The answer should be a number.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
agent.llm.call = lambda messages, *args, **kwargs: (
|
||||
mock_llm_responses["ready"]
|
||||
if any("create a detailed plan" in msg.get("content", "") for msg in messages)
|
||||
else mock_llm_responses["execution"]
|
||||
)
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result is not None
|
||||
assert "20" in str(result)
|
||||
# Planning should be appended to task description
|
||||
assert "Planning:" in task.description
|
||||
assert result == mock_llm_responses["execution"]
|
||||
assert "Reasoning Plan:" in task.description
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_execute_task_without_planning():
|
||||
"""Test Agent.execute_task() without planning."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
def test_agent_with_reasoning_not_ready_initially(mock_llm_responses):
|
||||
"""Test agent with reasoning that requires refinement."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Assistant",
|
||||
goal="Help solve math problems",
|
||||
backstory="A helpful assistant",
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
verbose=False,
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=2,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="What is 12 * 3?",
|
||||
expected_output="A number",
|
||||
description="Complex math task: What's the derivative of x²?",
|
||||
expected_output="The answer should be a mathematical expression.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
call_count = [0]
|
||||
|
||||
def mock_llm_call(messages, *args, **kwargs):
|
||||
if any(
|
||||
"create a detailed plan" in msg.get("content", "") for msg in messages
|
||||
) or any("refine your plan" in msg.get("content", "") for msg in messages):
|
||||
call_count[0] += 1
|
||||
if call_count[0] == 1:
|
||||
return mock_llm_responses["not_ready"]
|
||||
return mock_llm_responses["ready_after_refine"]
|
||||
return "2x"
|
||||
|
||||
agent.llm.call = mock_llm_call
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result is not None
|
||||
assert "36" in str(result)
|
||||
# No planning should be added
|
||||
assert "Planning:" not in task.description
|
||||
assert result == "2x"
|
||||
assert call_count[0] == 2 # Should have made 2 reasoning calls
|
||||
assert "Reasoning Plan:" in task.description
|
||||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_agent_execute_task_with_planning_refine():
|
||||
"""Test Agent.execute_task() with planning that requires refinement."""
|
||||
llm = LLM("gpt-4o-mini")
|
||||
def test_agent_with_reasoning_max_attempts_reached():
|
||||
"""Test agent with reasoning that reaches max attempts without being ready."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Math Tutor",
|
||||
goal="Solve complex math problems step by step",
|
||||
backstory="An expert tutor",
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
planning_config=PlanningConfig(max_attempts=2),
|
||||
verbose=False,
|
||||
reasoning=True,
|
||||
max_reasoning_attempts=2,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Calculate the area of a circle with radius 5 (use pi = 3.14)",
|
||||
expected_output="The area as a number",
|
||||
description="Complex math task: Solve the Riemann hypothesis.",
|
||||
expected_output="A proof or disproof of the hypothesis.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
call_count = [0]
|
||||
|
||||
def mock_llm_call(messages, *args, **kwargs):
|
||||
if any(
|
||||
"create a detailed plan" in msg.get("content", "") for msg in messages
|
||||
) or any("refine your plan" in msg.get("content", "") for msg in messages):
|
||||
call_count[0] += 1
|
||||
return f"Attempt {call_count[0]}: I need more time to think.\n\nNOT READY: I need to refine my plan further."
|
||||
return "This is an unsolved problem in mathematics."
|
||||
|
||||
agent.llm.call = mock_llm_call
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result is not None
|
||||
# Area = pi * r^2 = 3.14 * 25 = 78.5
|
||||
assert "78" in str(result) or "79" in str(result)
|
||||
assert "Planning:" in task.description
|
||||
assert result == "This is an unsolved problem in mathematics."
|
||||
assert (
|
||||
call_count[0] == 2
|
||||
) # Should have made exactly 2 reasoning calls (max_attempts)
|
||||
assert "Reasoning Plan:" in task.description
|
||||
|
||||
|
||||
def test_agent_reasoning_error_handling():
|
||||
"""Test error handling during the reasoning process."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
reasoning=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Task that will cause an error",
|
||||
expected_output="Output that will never be generated",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
call_count = [0]
|
||||
|
||||
def mock_llm_call_error(*args, **kwargs):
|
||||
call_count[0] += 1
|
||||
if call_count[0] <= 2: # First calls are for reasoning
|
||||
raise Exception("LLM error during reasoning")
|
||||
return "Fallback execution result" # Return a value for task execution
|
||||
|
||||
agent.llm.call = mock_llm_call_error
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result == "Fallback execution result"
|
||||
assert call_count[0] > 2 # Ensure we called the mock multiple times
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test requires updates for native tool calling changes")
|
||||
def test_agent_with_function_calling():
|
||||
"""Test agent with reasoning using function calling."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
reasoning=True,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Simple math task: What's 2+2?",
|
||||
expected_output="The answer should be a number.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
agent.llm.supports_function_calling = lambda: True
|
||||
|
||||
def mock_function_call(messages, *args, **kwargs):
|
||||
if "tools" in kwargs:
|
||||
return json.dumps(
|
||||
{"plan": "I'll solve this simple math problem: 2+2=4.", "ready": True}
|
||||
)
|
||||
return "4"
|
||||
|
||||
agent.llm.call = mock_function_call
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result == "4"
|
||||
assert "Reasoning Plan:" in task.description
|
||||
assert "I'll solve this simple math problem: 2+2=4." in task.description
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Test requires updates for native tool calling changes")
|
||||
def test_agent_with_function_calling_fallback():
|
||||
"""Test agent with reasoning using function calling that falls back to text parsing."""
|
||||
llm = LLM("gpt-3.5-turbo")
|
||||
|
||||
agent = Agent(
|
||||
role="Test Agent",
|
||||
goal="To test the reasoning feature",
|
||||
backstory="I am a test agent created to verify the reasoning feature works correctly.",
|
||||
llm=llm,
|
||||
reasoning=True,
|
||||
verbose=True,
|
||||
)
|
||||
|
||||
task = Task(
|
||||
description="Simple math task: What's 2+2?",
|
||||
expected_output="The answer should be a number.",
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
agent.llm.supports_function_calling = lambda: True
|
||||
|
||||
def mock_function_call(messages, *args, **kwargs):
|
||||
if "tools" in kwargs:
|
||||
return "Invalid JSON that will trigger fallback. READY: I am ready to execute the task."
|
||||
return "4"
|
||||
|
||||
agent.llm.call = mock_function_call
|
||||
|
||||
result = agent.execute_task(task)
|
||||
|
||||
assert result == "4"
|
||||
assert "Reasoning Plan:" in task.description
|
||||
assert "Invalid JSON that will trigger fallback" in task.description
|
||||
|
||||
@@ -11,7 +11,7 @@ import os
|
||||
import threading
|
||||
import time
|
||||
from collections import Counter
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from pydantic import BaseModel, Field
|
||||
@@ -1129,3 +1129,150 @@ class TestMaxUsageCountWithNativeToolCalling:
|
||||
# Verify the requested calls occurred while keeping usage bounded.
|
||||
assert tool.current_usage_count >= 2
|
||||
assert tool.current_usage_count <= tool.max_usage_count
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# JSON Parse Error Handling Tests
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class TestNativeToolCallingJsonParseError:
|
||||
"""Tests that malformed JSON tool arguments produce clear errors
|
||||
instead of silently dropping all arguments."""
|
||||
|
||||
def _make_executor(self, tools: list[BaseTool]) -> "CrewAgentExecutor":
|
||||
"""Create a minimal CrewAgentExecutor with mocked dependencies."""
|
||||
from crewai.agents.crew_agent_executor import CrewAgentExecutor
|
||||
from crewai.tools.base_tool import to_langchain
|
||||
|
||||
structured_tools = to_langchain(tools)
|
||||
mock_agent = Mock()
|
||||
mock_agent.key = "test_agent"
|
||||
mock_agent.role = "tester"
|
||||
mock_agent.verbose = False
|
||||
mock_agent.fingerprint = None
|
||||
mock_agent.tools_results = []
|
||||
|
||||
mock_task = Mock()
|
||||
mock_task.name = "test"
|
||||
mock_task.description = "test"
|
||||
mock_task.id = "test-id"
|
||||
|
||||
executor = object.__new__(CrewAgentExecutor)
|
||||
executor.agent = mock_agent
|
||||
executor.task = mock_task
|
||||
executor.crew = Mock()
|
||||
executor.tools = structured_tools
|
||||
executor.original_tools = tools
|
||||
executor.tools_handler = None
|
||||
executor._printer = Mock()
|
||||
executor.messages = []
|
||||
|
||||
return executor
|
||||
|
||||
def test_malformed_json_returns_parse_error(self) -> None:
|
||||
"""Malformed JSON args must return a descriptive error, not silently become {}."""
|
||||
|
||||
class CodeTool(BaseTool):
|
||||
name: str = "execute_code"
|
||||
description: str = "Run code"
|
||||
|
||||
def _run(self, code: str) -> str:
|
||||
return f"ran: {code}"
|
||||
|
||||
tool = CodeTool()
|
||||
executor = self._make_executor([tool])
|
||||
|
||||
from crewai.utilities.agent_utils import convert_tools_to_openai_schema
|
||||
_, available_functions = convert_tools_to_openai_schema([tool])
|
||||
|
||||
malformed_json = '{"code": "print("hello")"}'
|
||||
|
||||
result = executor._execute_single_native_tool_call(
|
||||
call_id="call_123",
|
||||
func_name="execute_code",
|
||||
func_args=malformed_json,
|
||||
available_functions=available_functions,
|
||||
)
|
||||
|
||||
assert "Failed to parse tool arguments as JSON" in result["result"]
|
||||
assert tool.current_usage_count == 0
|
||||
|
||||
def test_valid_json_still_executes_normally(self) -> None:
|
||||
"""Valid JSON args should execute the tool as before."""
|
||||
|
||||
class CodeTool(BaseTool):
|
||||
name: str = "execute_code"
|
||||
description: str = "Run code"
|
||||
|
||||
def _run(self, code: str) -> str:
|
||||
return f"ran: {code}"
|
||||
|
||||
tool = CodeTool()
|
||||
executor = self._make_executor([tool])
|
||||
|
||||
from crewai.utilities.agent_utils import convert_tools_to_openai_schema
|
||||
_, available_functions = convert_tools_to_openai_schema([tool])
|
||||
|
||||
valid_json = '{"code": "print(1)"}'
|
||||
|
||||
result = executor._execute_single_native_tool_call(
|
||||
call_id="call_456",
|
||||
func_name="execute_code",
|
||||
func_args=valid_json,
|
||||
available_functions=available_functions,
|
||||
)
|
||||
|
||||
assert result["result"] == "ran: print(1)"
|
||||
|
||||
def test_dict_args_bypass_json_parsing(self) -> None:
|
||||
"""When func_args is already a dict, no JSON parsing occurs."""
|
||||
|
||||
class CodeTool(BaseTool):
|
||||
name: str = "execute_code"
|
||||
description: str = "Run code"
|
||||
|
||||
def _run(self, code: str) -> str:
|
||||
return f"ran: {code}"
|
||||
|
||||
tool = CodeTool()
|
||||
executor = self._make_executor([tool])
|
||||
|
||||
from crewai.utilities.agent_utils import convert_tools_to_openai_schema
|
||||
_, available_functions = convert_tools_to_openai_schema([tool])
|
||||
|
||||
result = executor._execute_single_native_tool_call(
|
||||
call_id="call_789",
|
||||
func_name="execute_code",
|
||||
func_args={"code": "x = 42"},
|
||||
available_functions=available_functions,
|
||||
)
|
||||
|
||||
assert result["result"] == "ran: x = 42"
|
||||
|
||||
def test_schema_validation_catches_missing_args_on_native_path(self) -> None:
|
||||
"""The native function calling path should now enforce args_schema,
|
||||
catching missing required fields before _run is called."""
|
||||
|
||||
class StrictTool(BaseTool):
|
||||
name: str = "strict_tool"
|
||||
description: str = "A tool with required args"
|
||||
|
||||
def _run(self, code: str, language: str) -> str:
|
||||
return f"{language}: {code}"
|
||||
|
||||
tool = StrictTool()
|
||||
executor = self._make_executor([tool])
|
||||
|
||||
from crewai.utilities.agent_utils import convert_tools_to_openai_schema
|
||||
_, available_functions = convert_tools_to_openai_schema([tool])
|
||||
|
||||
result = executor._execute_single_native_tool_call(
|
||||
call_id="call_schema",
|
||||
func_name="strict_tool",
|
||||
func_args={"code": "print(1)"},
|
||||
available_functions=available_functions,
|
||||
)
|
||||
|
||||
assert "Error" in result["result"]
|
||||
assert "validation failed" in result["result"].lower() or "missing" in result["result"].lower()
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nWhat is 2 + 2?\n\n##
|
||||
Expected Output\nComplete the task successfully\n\n## Available Tools\nNo tools
|
||||
available\n\n## Instructions\nCreate ONLY the essential steps needed to complete
|
||||
this task. Use the MINIMUM number of steps required - do NOT pad your plan with
|
||||
unnecessary steps. Most tasks need only 2-5 steps.\n\nFor each step:\n- State
|
||||
the specific action to take\n- Specify which tool to use (if any)\n\nDo NOT
|
||||
include:\n- Setup or preparation steps that are obvious\n- Verification steps
|
||||
unless critical\n- Documentation or cleanup steps unless explicitly required\n-
|
||||
Generic steps like \"review results\" or \"finalize output\"\n\nAfter your plan,
|
||||
state:\n- \"READY: I am ready to execute the task.\" if the plan is complete\n-
|
||||
\"NOT READY: I need to refine my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1541'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTTAh68P65LybtqkwNI3p2HXcRv\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078147,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n\\n1. **Action:**
|
||||
Perform the addition operation. \\n **Tool:** None (manually calculate).\\n\\n2.
|
||||
**Action:** State the result. \\n **Tool:** None (manually output).\\n\\nREADY:
|
||||
I am ready to execute the task.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 281,\n \"completion_tokens\":
|
||||
56,\n \"total_tokens\": 337,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:28 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1165'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant that solves math problems step by step\nYour personal goal is: Help
|
||||
solve simple math problems"},{"role":"user","content":"\nCurrent Task: What
|
||||
is 2 + 2?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '299'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTVB9mdtq1YZrUVf1aSb6dVVQ8G\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078149,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To solve the problem of 2 + 2, we simply
|
||||
perform the addition:\\n\\n1. Start with the first number: 2\\n2. Add the
|
||||
second number: + 2\\n3. Combine the two: 2 + 2 = 4\\n\\nTherefore, the answer
|
||||
is 4.\",\n \"refusal\": null,\n \"annotations\": []\n },\n
|
||||
\ \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n
|
||||
\ \"usage\": {\n \"prompt_tokens\": 54,\n \"completion_tokens\": 62,\n
|
||||
\ \"total_tokens\": 116,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:30 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1300'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,108 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve simple math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 3 + 3?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '260'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTTFxQ75llVmJv0ee902FIjXE8p\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078147,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"3 + 3 equals 6.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
47,\n \"completion_tokens\": 8,\n \"total_tokens\": 55,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:27 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '401'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,230 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nWhat is 7 + 7?\n\n##
|
||||
Expected Output\nComplete the task successfully\n\n## Available Tools\nNo tools
|
||||
available\n\n## Instructions\nCreate ONLY the essential steps needed to complete
|
||||
this task. Use the MINIMUM number of steps required - do NOT pad your plan with
|
||||
unnecessary steps. Most tasks need only 2-5 steps.\n\nFor each step:\n- State
|
||||
the specific action to take\n- Specify which tool to use (if any)\n\nDo NOT
|
||||
include:\n- Setup or preparation steps that are obvious\n- Verification steps
|
||||
unless critical\n- Documentation or cleanup steps unless explicitly required\n-
|
||||
Generic steps like \"review results\" or \"finalize output\"\n\nAfter your plan,
|
||||
state:\n- \"READY: I am ready to execute the task.\" if the plan is complete\n-
|
||||
\"NOT READY: I need to refine my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1541'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTdqlxwWowSdLncBERFrCgxTvVj\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078157,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n\\n1. Calculate
|
||||
the sum of 7 and 7.\\n \\nREADY: I am ready to execute the task.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
281,\n \"completion_tokens\": 28,\n \"total_tokens\": 309,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:38 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '709'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant that solves math problems step by step\nYour personal goal is: Help
|
||||
solve simple math problems"},{"role":"user","content":"\nCurrent Task: What
|
||||
is 7 + 7?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '299'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTeB6Miecallw9SjSfLAXPjX2XD\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078158,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To find the sum of 7 and 7, you simply
|
||||
add the two numbers together:\\n\\n7 + 7 = 14\\n\\nSo, the answer is 14.\",\n
|
||||
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
|
||||
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
54,\n \"completion_tokens\": 35,\n \"total_tokens\": 89,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:38 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '733'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,108 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve simple math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 5 + 5?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '260'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTf8T2iADffpPCJBZhntLlaoaSy\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078159,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"5 + 5 equals 10.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
47,\n \"completion_tokens\": 8,\n \"total_tokens\": 55,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:40 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '515'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,247 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nCalculate the sum
|
||||
of the first 3 prime numbers, then multiply that result by 2. Show your work
|
||||
for each step.\n\n## Expected Output\nComplete the task successfully\n\n## Available
|
||||
Tools\nNo tools available\n\n## Instructions\nCreate ONLY the essential steps
|
||||
needed to complete this task. Use the MINIMUM number of steps required - do
|
||||
NOT pad your plan with unnecessary steps. Most tasks need only 2-5 steps.\n\nFor
|
||||
each step:\n- State the specific action to take\n- Specify which tool to use
|
||||
(if any)\n\nDo NOT include:\n- Setup or preparation steps that are obvious\n-
|
||||
Verification steps unless critical\n- Documentation or cleanup steps unless
|
||||
explicitly required\n- Generic steps like \"review results\" or \"finalize output\"\n\nAfter
|
||||
your plan, state:\n- \"READY: I am ready to execute the task.\" if the plan
|
||||
is complete\n- \"NOT READY: I need to refine my plan because [reason].\" if
|
||||
you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1636'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTWa7FxCHkHwHF25AYXXeJDBOuY\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078150,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n\\n1. Identify
|
||||
the first 3 prime numbers: 2, 3, and 5.\\n2. Calculate the sum: \\\\(2 + 3
|
||||
+ 5 = 10\\\\).\\n3. Multiply the sum by 2: \\\\(10 \\\\times 2 = 20\\\\).\\n\\nREADY:
|
||||
I am ready to execute the task.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 299,\n \"completion_tokens\":
|
||||
74,\n \"total_tokens\": 373,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:32 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1716'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Tutor. An expert
|
||||
math tutor who breaks down problems step by step\nYour personal goal is: Solve
|
||||
multi-step math problems accurately"},{"role":"user","content":"\nCurrent Task:
|
||||
Calculate the sum of the first 3 prime numbers, then multiply that result by
|
||||
2. Show your work for each step.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '400'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTYJgCZf2oY7wiPMZmN4QEQhHb5\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078152,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To solve the problem, let's break it
|
||||
down into two main steps: \\n\\n1. Calculate the sum of the first 3 prime
|
||||
numbers.\\n2. Multiply the result of that sum by 2.\\n\\n### Step 1: Identify
|
||||
the first 3 prime numbers\\nPrime numbers are natural numbers greater than
|
||||
1 that have no positive divisors other than 1 and themselves. \\n\\nThe first
|
||||
three prime numbers are:\\n- 2\\n- 3\\n- 5\\n\\n### Step 2: Calculate the
|
||||
sum of the first 3 prime numbers\\nNow, we add these prime numbers together:\\n\\n\\\\[\\n2
|
||||
+ 3 + 5\\n\\\\]\\n\\nCalculating this step-by-step:\\n- First, add 2 and 3:\\n
|
||||
\ \\\\[\\n 2 + 3 = 5\\n \\\\]\\n \\n- Next, add this result to 5:\\n \\\\[\\n
|
||||
\ 5 + 5 = 10\\n \\\\]\\n\\nSo, the sum of the first 3 prime numbers is \\\\(10\\\\).\\n\\n###
|
||||
Step 3: Multiply the sum by 2\\nNext, we take the sum we calculated and multiply
|
||||
it by 2:\\n\\n\\\\[\\n10 \\\\times 2\\n\\\\]\\n\\nCalculating this:\\n\\\\[\\n10
|
||||
\\\\times 2 = 20\\n\\\\]\\n\\n### Final Answer\\nThus, the final result obtained
|
||||
after performing all the steps is:\\n\\n\\\\[\\n\\\\boxed{20}\\n\\\\]\",\n
|
||||
\ \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\":
|
||||
null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
74,\n \"completion_tokens\": 288,\n \"total_tokens\": 362,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:37 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '4751'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,108 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve simple math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 5 + 5?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '260'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yXGD5IrieoUDSK5hDmJyA2gJtDc\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078382,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"5 + 5 equals 10.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
47,\n \"completion_tokens\": 8,\n \"total_tokens\": 55,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:26:23 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '363'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,242 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nConvert 100 degrees
|
||||
Celsius to Fahrenheit, then round the result to the nearest 10.\n\n## Expected
|
||||
Output\nComplete the task successfully\n\n## Available Tools\nNo tools available\n\n##
|
||||
Instructions\nCreate ONLY the essential steps needed to complete this task.
|
||||
Use the MINIMUM number of steps required - do NOT pad your plan with unnecessary
|
||||
steps. Most tasks need only 2-5 steps.\n\nFor each step:\n- State the specific
|
||||
action to take\n- Specify which tool to use (if any)\n\nDo NOT include:\n- Setup
|
||||
or preparation steps that are obvious\n- Verification steps unless critical\n-
|
||||
Documentation or cleanup steps unless explicitly required\n- Generic steps like
|
||||
\"review results\" or \"finalize output\"\n\nAfter your plan, state:\n- \"READY:
|
||||
I am ready to execute the task.\" if the plan is complete\n- \"NOT READY: I
|
||||
need to refine my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1610'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTN8fHOefyzzhvdUOHjxdFDR2HW\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078141,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n\\n1. Convert 100
|
||||
degrees Celsius to Fahrenheit using the formula: \\\\( F = C \\\\times \\\\frac{9}{5}
|
||||
+ 32 \\\\).\\n2. Round the Fahrenheit result to the nearest 10.\\n\\nREADY:
|
||||
I am ready to execute the task.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 291,\n \"completion_tokens\":
|
||||
58,\n \"total_tokens\": 349,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:22 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1089'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Unit Converter. A precise
|
||||
unit conversion specialist\nYour personal goal is: Accurately convert between
|
||||
units and apply transformations"},{"role":"user","content":"\nCurrent Task:
|
||||
Convert 100 degrees Celsius to Fahrenheit, then round the result to the nearest
|
||||
10.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '373'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTPQewXDyPdYHI4dHPH7YGHcRge\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078143,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To convert degrees Celsius to Fahrenheit,
|
||||
you can use the formula:\\n\\n\\\\[ F = \\\\left( C \\\\times \\\\frac{9}{5}
|
||||
\\\\right) + 32 \\\\]\\n\\nPlugging in 100 degrees Celsius:\\n\\n\\\\[ F =
|
||||
\\\\left( 100 \\\\times \\\\frac{9}{5} \\\\right) + 32 \\\\]\\n\\nCalculating
|
||||
that step-by-step:\\n\\n1. Multiply 100 by 9: \\n \\\\[ 100 \\\\times 9
|
||||
= 900 \\\\]\\n\\n2. Divide by 5:\\n \\\\[ 900 \\\\div 5 = 180 \\\\]\\n\\n3.
|
||||
Add 32:\\n \\\\[ 180 + 32 = 212 \\\\]\\n\\nSo, 100 degrees Celsius is equal
|
||||
to 212 degrees Fahrenheit.\\n\\nNow, rounding 212 to the nearest 10:\\n\\nThe
|
||||
nearest multiple of 10 to 212 is 210.\\n\\nTherefore, the final result is
|
||||
**210 degrees Fahrenheit**.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 63,\n \"completion_tokens\":
|
||||
191,\n \"total_tokens\": 254,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:26 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3736'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,10 +1,6 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour
|
||||
personal goal is: test goal"},{"role":"user","content":"\nCurrent Task: Calculate
|
||||
2 + 2\n\nThis is the expected criteria for your final answer: The result of
|
||||
the calculation\nyou MUST return the actual complete content as the final answer,
|
||||
not a summary.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour personal goal is: test goal\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: Calculate 2 + 2\n\nThis is the expected criteria for your final answer: The result of the calculation\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-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -17,7 +13,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '396'
|
||||
- '797'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -39,23 +35,13 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.12.10
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5DTjYe6n92Rjo4Ox6NiZpAAdBLF0\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770135823,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"The result of the calculation 2 + 2
|
||||
is 4.\",\n \"refusal\": null,\n \"annotations\": []\n },\n
|
||||
\ \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n
|
||||
\ \"usage\": {\n \"prompt_tokens\": 75,\n \"completion_tokens\": 14,\n
|
||||
\ \"total_tokens\": 89,\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_1590f93f9d\"\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-CjDsYJQa2tIYBbNloukSWecpsTvdK\",\n \"object\": \"chat.completion\",\n \"created\": 1764894146,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"I now can give a great answer \\nFinal Answer: The result of the calculation 2 + 2 is 4.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 161,\n \"completion_tokens\": 25,\n \"total_tokens\": 186,\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_11f3029f6b\"\
|
||||
\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
@@ -64,7 +50,7 @@ interactions:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 16:23:43 GMT
|
||||
- Fri, 05 Dec 2025 00:22:27 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
@@ -84,11 +70,13 @@ interactions:
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '636'
|
||||
- '516'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '529'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour
|
||||
personal goal is: test goal"},{"role":"user","content":"\nCurrent Task: Summarize
|
||||
the given context in one sentence\n\nThis is the expected criteria for your
|
||||
final answer: A one-sentence summary\nyou MUST return the actual complete content
|
||||
as the final answer, not a summary.\n\nThis is the context you''re working with:\nThe
|
||||
quick brown fox jumps over the lazy dog. This sentence contains every letter
|
||||
of the alphabet.\n\nProvide your complete response:"}],"model":"gpt-3.5-turbo"}'
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour personal goal is: test goal\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: Summarize the given context in one sentence\n\nThis is the expected criteria for your final answer: A one-sentence summary\nyou MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nThe quick brown fox jumps over the lazy dog. This sentence contains every letter of the alphabet.\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-3.5-turbo"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -19,7 +13,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '562'
|
||||
- '963'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -41,23 +35,13 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.12.10
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5DTn6yIQ7HpIn5j5Bsbag1efzXPa\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770135827,\n \"model\": \"gpt-3.5-turbo-0125\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"The quick brown fox jumps over the
|
||||
lazy dog. This sentence contains every letter of the alphabet.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
105,\n \"completion_tokens\": 19,\n \"total_tokens\": 124,\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\": null\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-CjDtsaX0LJ0dzZz02KwKeRGYgazv1\",\n \"object\": \"chat.completion\",\n \"created\": 1764894228,\n \"model\": \"gpt-3.5-turbo-0125\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"I now can give a great answer\\n\\nFinal Answer: The quick brown fox jumps over the lazy dog. This sentence contains every letter of the alphabet.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 191,\n \"completion_tokens\": 30,\n \"total_tokens\": 221,\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\": null\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
@@ -66,7 +50,7 @@ interactions:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 16:23:48 GMT
|
||||
- Fri, 05 Dec 2025 00:23:49 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
@@ -86,11 +70,13 @@ interactions:
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '606'
|
||||
- '506'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '559'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour
|
||||
personal goal is: test goal"},{"role":"user","content":"\nCurrent Task: Write
|
||||
a haiku about AI\n\nThis is the expected criteria for your final answer: A haiku
|
||||
(3 lines, 5-7-5 syllable pattern) about AI\nyou MUST return the actual complete
|
||||
content as the final answer, not a summary.\n\nProvide your complete response:"}],"model":"gpt-3.5-turbo","max_tokens":50,"temperature":0.7}'
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour personal goal is: test goal\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: Write a haiku about AI\n\nThis is the expected criteria for your final answer: A haiku (3 lines, 5-7-5 syllable pattern) about AI\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-3.5-turbo","max_tokens":50,"temperature":0.7}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -17,7 +13,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '460'
|
||||
- '861'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -39,23 +35,13 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.12.10
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5DTgAqxaC8RmEvikXK0UDaxmVmf9\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770135820,\n \"model\": \"gpt-3.5-turbo-0125\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Artificial minds,\\nCode and circuits
|
||||
intertwine,\\nFuture undefined.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 88,\n \"completion_tokens\":
|
||||
13,\n \"total_tokens\": 101,\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\": null\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-CjDqr2BmEXQ08QzZKslTZJZ5vV9lo\",\n \"object\": \"chat.completion\",\n \"created\": 1764894041,\n \"model\": \"gpt-3.5-turbo-0125\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"I now can give a great answer\\n\\nFinal Answer: \\nIn circuits they thrive, \\nArtificial minds awake, \\nFuture's coded drive.\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 174,\n \"completion_tokens\": 29,\n \"total_tokens\": 203,\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\": null\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
@@ -64,7 +50,7 @@ interactions:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 16:23:40 GMT
|
||||
- Fri, 05 Dec 2025 00:20:41 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
@@ -84,11 +70,13 @@ interactions:
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '277'
|
||||
- '434'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '456'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nWhat is 9 + 11?\n\n##
|
||||
Expected Output\nA number\n\n## Available Tools\nNo tools available\n\n## Instructions\nCreate
|
||||
ONLY the essential steps needed to complete this task. Use the MINIMUM number
|
||||
of steps required - do NOT pad your plan with unnecessary steps. Most tasks
|
||||
need only 2-5 steps.\n\nFor each step:\n- State the specific action to take\n-
|
||||
Specify which tool to use (if any)\n\nDo NOT include:\n- Setup or preparation
|
||||
steps that are obvious\n- Verification steps unless critical\n- Documentation
|
||||
or cleanup steps unless explicitly required\n- Generic steps like \"review results\"
|
||||
or \"finalize output\"\n\nAfter your plan, state:\n- \"READY: I am ready to
|
||||
execute the task.\" if the plan is complete\n- \"NOT READY: I need to refine
|
||||
my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1520'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yVACNTzZcghQRwt5kFYQ4HAvbgI\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078252,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n1. Calculate the
|
||||
sum of 9 and 11.\\n \\nREADY: I am ready to execute the task.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
279,\n \"completion_tokens\": 28,\n \"total_tokens\": 307,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:24:13 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '951'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
math tutor\nYour personal goal is: Help solve math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 9 + 11?\n\nPlanning:\n## Execution Plan\n1. Calculate the sum
|
||||
of 9 and 11.\n \nREADY: I am ready to execute the task.\n\nThis is the expected
|
||||
criteria for your final answer: A number\nyou MUST return the actual complete
|
||||
content as the final answer, not a summary.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '513'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yVBdTCKSdfcJYlIOX9BbzrObgFI\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078253,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"9 + 11 = 20\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
105,\n \"completion_tokens\": 7,\n \"total_tokens\": 112,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:24:13 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '477'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,243 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nCalculate the area
|
||||
of a circle with radius 5 (use pi = 3.14)\n\n## Expected Output\nThe area as
|
||||
a number\n\n## Available Tools\nNo tools available\n\n## Instructions\nCreate
|
||||
ONLY the essential steps needed to complete this task. Use the MINIMUM number
|
||||
of steps required - do NOT pad your plan with unnecessary steps. Most tasks
|
||||
need only 2-5 steps.\n\nFor each step:\n- State the specific action to take\n-
|
||||
Specify which tool to use (if any)\n\nDo NOT include:\n- Setup or preparation
|
||||
steps that are obvious\n- Verification steps unless critical\n- Documentation
|
||||
or cleanup steps unless explicitly required\n- Generic steps like \"review results\"
|
||||
or \"finalize output\"\n\nAfter your plan, state:\n- \"READY: I am ready to
|
||||
execute the task.\" if the plan is complete\n- \"NOT READY: I need to refine
|
||||
my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1577'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yVCdA1csIzfoHSQvxkfrA4gDn4z\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078254,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n1. Multiply the
|
||||
radius (5) by itself (5) to get the square of the radius.\\n2. Multiply the
|
||||
squared radius by pi (3.14) to calculate the area.\\n\\nREADY: I am ready
|
||||
to execute the task.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 293,\n \"completion_tokens\":
|
||||
54,\n \"total_tokens\": 347,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:24:15 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '845'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Tutor. An expert
|
||||
tutor\nYour personal goal is: Solve complex math problems step by step"},{"role":"user","content":"\nCurrent
|
||||
Task: Calculate the area of a circle with radius 5 (use pi = 3.14)\n\nPlanning:\n##
|
||||
Execution Plan\n1. Multiply the radius (5) by itself (5) to get the square of
|
||||
the radius.\n2. Multiply the squared radius by pi (3.14) to calculate the area.\n\nREADY:
|
||||
I am ready to execute the task.\n\nThis is the expected criteria for your final
|
||||
answer: The area as a number\nyou MUST return the actual complete content as
|
||||
the final answer, not a summary.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '682'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yVDh2U2xx3qeYHcDQvbetOmVCxb\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078255,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To calculate the area of a circle with
|
||||
a radius of 5, we will follow the steps outlined in the execution plan.\\n\\n1.
|
||||
**Square the radius**:\\n \\\\[\\n 5 \\\\times 5 = 25\\n \\\\]\\n\\n2.
|
||||
**Multiply the squared radius by pi (using \\\\(\\\\pi \\\\approx 3.14\\\\))**:\\n
|
||||
\ \\\\[\\n \\\\text{Area} = \\\\pi \\\\times (\\\\text{radius})^2 = 3.14
|
||||
\\\\times 25\\n \\\\]\\n\\n Now, let's perform the multiplication:\\n
|
||||
\ \\\\[\\n 3.14 \\\\times 25 = 78.5\\n \\\\]\\n\\nThus, the area of the
|
||||
circle is \\\\( \\\\boxed{78.5} \\\\).\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 147,\n \"completion_tokens\":
|
||||
155,\n \"total_tokens\": 302,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:24:18 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '2228'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,11 +1,7 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour
|
||||
personal goal is: test goal"},{"role":"user","content":"\nCurrent Task: Use
|
||||
the dummy tool to get a result for ''test query''\n\nThis is the expected criteria
|
||||
for your final answer: The result from the dummy tool\nyou MUST return the actual
|
||||
complete content as the final answer, not a summary."}],"model":"gpt-3.5-turbo","tool_choice":"auto","tools":[{"type":"function","function":{"name":"dummy_tool","description":"Useful
|
||||
for when you need to get a dummy result for a query.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}}]}'
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour personal goal is: test goal\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nTool Name: dummy_tool\nTool Arguments: {''query'': {''description'': None, ''type'': ''str''}}\nTool Description: Useful for when you need to get a dummy result for a query.\n\nIMPORTANT: Use the following format in your response:\n\n```\nThought: you should always think about what to do\nAction: the action to take, only one name of [dummy_tool], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple JSON object, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n```\n\nOnce all necessary information is gathered, return the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n```"},{"role":"user","content":"\nCurrent
|
||||
Task: Use the dummy tool to get a result for ''test query''\n\nThis is the expected criteria for your final answer: The result from the dummy tool\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-3.5-turbo"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
@@ -18,7 +14,7 @@ interactions:
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '712'
|
||||
- '1381'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
@@ -40,26 +36,12 @@ interactions:
|
||||
x-stainless-runtime:
|
||||
- CPython
|
||||
x-stainless-runtime-version:
|
||||
- 3.13.3
|
||||
- 3.12.10
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5DTlUmKYee1DaS5AqnaUCZ6B14xV\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770135825,\n \"model\": \"gpt-3.5-turbo-0125\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_tBCgelchfQjXXJrrM15MxqGJ\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"dummy_tool\",\n
|
||||
\ \"arguments\": \"{\\\"query\\\":\\\"test query\\\"}\"\n }\n
|
||||
\ }\n ],\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 122,\n \"completion_tokens\":
|
||||
16,\n \"total_tokens\": 138,\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\": null\n}\n"
|
||||
string: "{\n \"id\": \"chatcmpl-CjDrE1Z8bFQjjxI2vDPPKgtOTm28p\",\n \"object\": \"chat.completion\",\n \"created\": 1764894064,\n \"model\": \"gpt-3.5-turbo-0125\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"you should always think about what to do\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 289,\n \"completion_tokens\": 8,\n \"total_tokens\": 297,\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\": null\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
@@ -68,7 +50,7 @@ interactions:
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 16:23:46 GMT
|
||||
- Fri, 05 Dec 2025 00:21:05 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
@@ -88,124 +70,13 @@ interactions:
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '694'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are test role. test backstory\nYour
|
||||
personal goal is: test goal"},{"role":"user","content":"\nCurrent Task: Use
|
||||
the dummy tool to get a result for ''test query''\n\nThis is the expected criteria
|
||||
for your final answer: The result from the dummy tool\nyou MUST return the actual
|
||||
complete content as the final answer, not a summary."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_tBCgelchfQjXXJrrM15MxqGJ","type":"function","function":{"name":"dummy_tool","arguments":"{\"query\":\"test
|
||||
query\"}"}}]},{"role":"tool","tool_call_id":"call_tBCgelchfQjXXJrrM15MxqGJ","name":"dummy_tool","content":"Dummy
|
||||
result for: test query"},{"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-3.5-turbo","tool_choice":"auto","tools":[{"type":"function","function":{"name":"dummy_tool","description":"Useful
|
||||
for when you need to get a dummy result for a query.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1202'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5DTmxZJI2Ee7fHNc9dYtQkD7sIY2\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770135826,\n \"model\": \"gpt-3.5-turbo-0125\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"Dummy result for: test query\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
188,\n \"completion_tokens\": 7,\n \"total_tokens\": 195,\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\": null\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 16:23:47 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '416'
|
||||
- '379'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-envoy-upstream-service-time:
|
||||
- '399'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 12 * 3?\n\nThis is the expected criteria for your final answer:
|
||||
A number\nyou MUST return the actual complete content as the final answer, not
|
||||
a summary.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '400'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yVCw0CGLFmcVvniplwCCt8avtRb\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078254,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"12 * 3 = 36\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
75,\n \"completion_tokens\": 7,\n \"total_tokens\": 82,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:24:14 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '331'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,243 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nFind the first
|
||||
3 prime numbers, add them together, then multiply by 2.\n\n## Expected Output\nComplete
|
||||
the task successfully\n\n## Available Tools\nNo tools available\n\n## Instructions\nCreate
|
||||
ONLY the essential steps needed to complete this task. Use the MINIMUM number
|
||||
of steps required - do NOT pad your plan with unnecessary steps. Most tasks
|
||||
need only 2-5 steps.\n\nFor each step:\n- State the specific action to take\n-
|
||||
Specify which tool to use (if any)\n\nDo NOT include:\n- Setup or preparation
|
||||
steps that are obvious\n- Verification steps unless critical\n- Documentation
|
||||
or cleanup steps unless explicitly required\n- Generic steps like \"review results\"
|
||||
or \"finalize output\"\n\nAfter your plan, state:\n- \"READY: I am ready to
|
||||
execute the task.\" if the plan is complete\n- \"NOT READY: I need to refine
|
||||
my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1597'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yU0MD5GfSUjRW0R4cBmFJ6Hcjbi\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078180,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"### Execution Plan\\n1. Identify the
|
||||
first 3 prime numbers: 2, 3, and 5.\\n2. Add the prime numbers together: 2
|
||||
+ 3 + 5 = 10.\\n3. Multiply the sum by 2: 10 * 2 = 20.\\n\\nREADY: I am ready
|
||||
to execute the task.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 291,\n \"completion_tokens\":
|
||||
73,\n \"total_tokens\": 364,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:23:02 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1253'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Tutor. An expert
|
||||
tutor who explains step by step\nYour personal goal is: Solve multi-step math
|
||||
problems"},{"role":"user","content":"\nCurrent Task: Find the first 3 prime
|
||||
numbers, add them together, then multiply by 2.\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '333'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yU2qY6Xqpkz2D5yVAwagQzuPpen\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078182,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To solve the problem, let\u2019s go
|
||||
through each step methodically.\\n\\n1. **Identify the first three prime numbers**:\\n
|
||||
\ - **Prime numbers** are numbers greater than 1 that have no positive divisors
|
||||
other than 1 and themselves.\\n - The first three prime numbers are:\\n
|
||||
\ - 2\\n - 3\\n - 5\\n\\n2. **Add these prime numbers together**:\\n
|
||||
\ - We add them together:\\n \\\\[\\n 2 + 3 + 5\\n \\\\]\\n -
|
||||
Performing the addition step-by-step:\\n - First, add 2 and 3:\\n \\\\[\\n
|
||||
\ 2 + 3 = 5\\n \\\\]\\n - Then add 5 to this result:\\n \\\\[\\n
|
||||
\ 5 + 5 = 10\\n \\\\]\\n - So, the sum of the first three prime
|
||||
numbers is **10**.\\n\\n3. **Multiply the sum by 2**:\\n - Now we multiply
|
||||
the result by 2:\\n \\\\[\\n 10 \\\\times 2 = 20\\n \\\\]\\n \\nTherefore,
|
||||
the final answer is **20**.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 62,\n \"completion_tokens\":
|
||||
236,\n \"total_tokens\": 298,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:23:06 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3846'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,238 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nWhat is 15 + 27?\n\n##
|
||||
Expected Output\nComplete the task successfully\n\n## Available Tools\nNo tools
|
||||
available\n\n## Instructions\nCreate ONLY the essential steps needed to complete
|
||||
this task. Use the MINIMUM number of steps required - do NOT pad your plan with
|
||||
unnecessary steps. Most tasks need only 2-5 steps.\n\nFor each step:\n- State
|
||||
the specific action to take\n- Specify which tool to use (if any)\n\nDo NOT
|
||||
include:\n- Setup or preparation steps that are obvious\n- Verification steps
|
||||
unless critical\n- Documentation or cleanup steps unless explicitly required\n-
|
||||
Generic steps like \"review results\" or \"finalize output\"\n\nAfter your plan,
|
||||
state:\n- \"READY: I am ready to execute the task.\" if the plan is complete\n-
|
||||
\"NOT READY: I need to refine my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o-mini","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"The
|
||||
detailed reasoning plan for the task."},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1543'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTrm3GkzDX47DIcce9uA3iF8kFE\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078171,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"## Execution Plan\\n\\n1. Calculate
|
||||
the sum of 15 and 27.\\n\\nREADY: I am ready to execute the task.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
281,\n \"completion_tokens\": 27,\n \"total_tokens\": 308,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:51 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '691'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
math tutor\nYour personal goal is: Help solve math problems step by step"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 15 + 27?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '269'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTrUOvExA9fTFDwYxvG4xEgRP6L\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078171,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To solve the problem \\\\( 15 + 27
|
||||
\\\\), we can follow these steps:\\n\\n1. **Align the numbers**: Write them
|
||||
one on top of the other, aligned by their rightmost digits:\\n\\n ```\\n
|
||||
\ 15\\n + 27\\n ```\\n\\n2. **Add the units place**: Start from the
|
||||
rightmost digits (units place):\\n - \\\\( 5 + 7 = 12 \\\\)\\n - Write
|
||||
down 2 and carry over 1.\\n\\n3. **Add the tens place**: Now, move to the
|
||||
next column (tens place):\\n - \\\\( 1 + 2 + 1 \\\\) (the 1 is from the
|
||||
carry) \\\\( = 4 \\\\)\\n\\n4. **Combine the results**: Now, combine the results
|
||||
from the tens and units places:\\n - The result in the tens place is 4 and
|
||||
in the units place is 2, giving us \\\\( 42 \\\\).\\n\\nTherefore, \\\\( 15
|
||||
+ 27 = 42 \\\\).\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 50,\n \"completion_tokens\":
|
||||
209,\n \"total_tokens\": 259,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:55 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3263'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,110 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 100 / 4?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '255'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yU6mFapBLuCx4fJtYBup52dwwrs\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078186,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"To solve the problem 100 divided by
|
||||
4, you can perform the division as follows:\\n\\n100 \xF7 4 = 25\\n\\nSo,
|
||||
the answer is 25.\",\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 46,\n \"completion_tokens\":
|
||||
36,\n \"total_tokens\": 82,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:23:07 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1098'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,108 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Math Assistant. A helpful
|
||||
assistant\nYour personal goal is: Help solve math problems"},{"role":"user","content":"\nCurrent
|
||||
Task: What is 8 * 7?\n\nProvide your complete response:"}],"model":"gpt-4o-mini"}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '253'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D4yTqLFhGtfq2CyS2aPPhiZL4GjtQ\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770078170,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"8 * 7 equals 56.\",\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
46,\n \"completion_tokens\": 8,\n \"total_tokens\": 54,\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_1590f93f9d\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 00:22:50 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '443'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,548 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are a strategic planning
|
||||
assistant. Create minimal, effective execution plans. Prefer fewer steps over
|
||||
more."}, {"role": "user", "content": "Create a focused execution plan for the
|
||||
following task:\n\n## Task\nResearch the current state of the AI agent market:\n1.
|
||||
Search for recent information about AI agents and their market trends\n2. Read
|
||||
detailed content from a relevant industry source\n3. Generate a brief report
|
||||
summarizing the key findings\n\nUse the available tools for each step.\n\n##
|
||||
Expected Output\nComplete the task successfully\n\n## Available Tools\nweb_search,
|
||||
read_website, generate_report\n\n## Instructions\nCreate ONLY the essential
|
||||
steps needed to complete this task. Use the MINIMUM number of steps required
|
||||
- do NOT pad your plan with unnecessary steps. Most tasks need only 2-5 steps.\n\nFor
|
||||
each step:\n- State the specific action to take\n- Specify which tool to use
|
||||
(if any)\n- Note dependencies on previous steps if this step requires their
|
||||
output\n- If a step involves multiple items (e.g., research 3 competitors),
|
||||
note this explicitly\n\nDo NOT include:\n- Setup or preparation steps that are
|
||||
obvious\n- Verification steps unless critical\n- Documentation or cleanup steps
|
||||
unless explicitly required\n- Generic steps like \"review results\" or \"finalize
|
||||
output\"\n\nAfter your plan, state:\n- \"READY: I am ready to execute the task.\"
|
||||
if the plan is complete\n- \"NOT READY: I need to refine my plan because [reason].\"
|
||||
if you need more thinking"}], "stream": false, "stop": ["\nObservation:"], "tool_choice":
|
||||
"auto", "tools": [{"function": {"name": "create_reasoning_plan", "description":
|
||||
"Create or refine a reasoning plan for a task with structured steps", "parameters":
|
||||
{"type": "object", "properties": {"plan": {"type": "string", "description":
|
||||
"A brief summary of the overall plan."}, "steps": {"type": "array", "description":
|
||||
"List of discrete steps to execute the plan", "items": {"type": "object", "properties":
|
||||
{"step_number": {"type": "integer", "description": "Step number (1-based)"},
|
||||
"description": {"type": "string", "description": "What to do in this step"},
|
||||
"tool_to_use": {"type": ["string", "null"], "description": "Tool to use for
|
||||
this step, or null if no tool needed"}, "depends_on": {"type": "array", "items":
|
||||
{"type": "integer"}, "description": "Step numbers this step depends on (empty
|
||||
array if none)"}}, "required": ["step_number", "description", "tool_to_use",
|
||||
"depends_on"], "additionalProperties": false}}, "ready": {"type": "boolean",
|
||||
"description": "Whether the agent is ready to execute the task."}}, "required":
|
||||
["plan", "steps", "ready"], "additionalProperties": false}}, "type": "function"}]}'
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Length:
|
||||
- '2711'
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
api-key:
|
||||
- X-API-KEY-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
method: POST
|
||||
uri: https://fake-azure-endpoint.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-12-01-preview
|
||||
response:
|
||||
body:
|
||||
string: '{"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"annotations":[],"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"plan\":\"Research
|
||||
the current state of the AI agent market and summarize the key findings.\",\"steps\":[{\"step_number\":1,\"description\":\"Search
|
||||
for recent information about AI agents and their market trends using web_search.\",\"tool_to_use\":\"web_search\",\"depends_on\":[]},{\"step_number\":2,\"description\":\"Read
|
||||
detailed content from a relevant industry source using read_website, gathering
|
||||
insights on trends and competitive analysis.\",\"tool_to_use\":\"read_website\",\"depends_on\":[1]},{\"step_number\":3,\"description\":\"Using
|
||||
the knowledge from steps 1 and 2, generate a brief report summarizing the
|
||||
AI agent market findings.\",\"tool_to_use\":\"generate_report\",\"depends_on\":[1,2]}],\"ready\":true}","name":"create_reasoning_plan"},"id":"call_TPmou69xLfxPqApRnPwI6zYV","type":"function"}]}}],"created":1770145131,"id":"chatcmpl-D5Ftr1QP6lTPXIemws2EtuKaWeSxt","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_b54fe76834","usage":{"completion_tokens":157,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":480,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":637}}
|
||||
|
||||
'
|
||||
headers:
|
||||
Content-Length:
|
||||
- '1762'
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:58:54 GMT
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
apim-request-id:
|
||||
- APIM-REQUEST-ID-XXX
|
||||
azureml-model-session:
|
||||
- AZUREML-MODEL-SESSION-XXX
|
||||
x-accel-buffering:
|
||||
- 'no'
|
||||
x-content-type-options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
x-ms-deployment-name:
|
||||
- gpt-4o
|
||||
x-ms-rai-invoked:
|
||||
- 'true'
|
||||
x-ms-region:
|
||||
- X-MS-REGION-XXX
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Research Analyst.
|
||||
An experienced analyst skilled at gathering information and synthesizing findings
|
||||
into actionable insights.\nYour personal goal is: Conduct thorough research
|
||||
and produce insightful reports"}, {"role": "user", "content": "\nCurrent Task:
|
||||
Research the current state of the AI agent market:\n1. Search for recent information
|
||||
about AI agents and their market trends\n2. Read detailed content from a relevant
|
||||
industry source\n3. Generate a brief report summarizing the key findings\n\nUse
|
||||
the available tools for each step."}], "stream": false, "stop": ["\nObservation:"],
|
||||
"tool_choice": "auto", "tools": [{"function": {"name": "web_search", "description":
|
||||
"Search the web for information on a given topic.\n\nArgs:\n query: The search
|
||||
query to look up.\n\nReturns:\n Search results as a string.", "parameters":
|
||||
{"properties": {"query": {"title": "Query", "type": "string"}}, "required":
|
||||
["query"], "type": "object", "additionalProperties": false}}, "type": "function"},
|
||||
{"function": {"name": "read_website", "description": "Read and extract content
|
||||
from a website URL.\n\nArgs:\n url: The URL of the website to read.\n\nReturns:\n The
|
||||
extracted content from the website.", "parameters": {"properties": {"url": {"title":
|
||||
"Url", "type": "string"}}, "required": ["url"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}, {"function": {"name": "generate_report", "description":
|
||||
"Generate a structured report based on research findings.\n\nArgs:\n title:
|
||||
The title of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "parameters": {"properties": {"title": {"title":
|
||||
"Title", "type": "string"}, "findings": {"title": "Findings", "type": "string"}},
|
||||
"required": ["title", "findings"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}]}'
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Length:
|
||||
- '1912'
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
api-key:
|
||||
- X-API-KEY-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
method: POST
|
||||
uri: https://fake-azure-endpoint.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-12-01-preview
|
||||
response:
|
||||
body:
|
||||
string: '{"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"annotations":[],"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"query\":\"current
|
||||
state of AI agent market 2023\"}","name":"web_search"},"id":"call_6RDgkQSr8S7luEHqqOaI734w","type":"function"}]}}],"created":1770145136,"id":"chatcmpl-D5FtwVvV3KE10L2JIOd7n8Ph1Iu3Q","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_b54fe76834","usage":{"completion_tokens":23,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":267,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":290}}
|
||||
|
||||
'
|
||||
headers:
|
||||
Content-Length:
|
||||
- '1079'
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:58:55 GMT
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
apim-request-id:
|
||||
- APIM-REQUEST-ID-XXX
|
||||
azureml-model-session:
|
||||
- AZUREML-MODEL-SESSION-XXX
|
||||
x-accel-buffering:
|
||||
- 'no'
|
||||
x-content-type-options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
x-ms-deployment-name:
|
||||
- gpt-4o
|
||||
x-ms-rai-invoked:
|
||||
- 'true'
|
||||
x-ms-region:
|
||||
- X-MS-REGION-XXX
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Research Analyst.
|
||||
An experienced analyst skilled at gathering information and synthesizing findings
|
||||
into actionable insights.\nYour personal goal is: Conduct thorough research
|
||||
and produce insightful reports"}, {"role": "user", "content": "\nCurrent Task:
|
||||
Research the current state of the AI agent market:\n1. Search for recent information
|
||||
about AI agents and their market trends\n2. Read detailed content from a relevant
|
||||
industry source\n3. Generate a brief report summarizing the key findings\n\nUse
|
||||
the available tools for each step."}, {"role": "assistant", "content": "", "tool_calls":
|
||||
[{"id": "call_6RDgkQSr8S7luEHqqOaI734w", "type": "function", "function": {"name":
|
||||
"web_search", "arguments": "{\"query\":\"current state of AI agent market 2023\"}"}}]},
|
||||
{"role": "tool", "tool_call_id": "call_6RDgkQSr8S7luEHqqOaI734w", "content":
|
||||
"Search results for ''current state of AI agent market 2023'': Found 3 relevant
|
||||
articles about the topic including market analysis, competitor data, and industry
|
||||
trends."}], "stream": false, "stop": ["\nObservation:"], "tool_choice": "auto",
|
||||
"tools": [{"function": {"name": "web_search", "description": "Search the web
|
||||
for information on a given topic.\n\nArgs:\n query: The search query to look
|
||||
up.\n\nReturns:\n Search results as a string.", "parameters": {"properties":
|
||||
{"query": {"title": "Query", "type": "string"}}, "required": ["query"], "type":
|
||||
"object", "additionalProperties": false}}, "type": "function"}, {"function":
|
||||
{"name": "read_website", "description": "Read and extract content from a website
|
||||
URL.\n\nArgs:\n url: The URL of the website to read.\n\nReturns:\n The
|
||||
extracted content from the website.", "parameters": {"properties": {"url": {"title":
|
||||
"Url", "type": "string"}}, "required": ["url"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}, {"function": {"name": "generate_report", "description":
|
||||
"Generate a structured report based on research findings.\n\nArgs:\n title:
|
||||
The title of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "parameters": {"properties": {"title": {"title":
|
||||
"Title", "type": "string"}, "findings": {"title": "Findings", "type": "string"}},
|
||||
"required": ["title", "findings"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}]}'
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Length:
|
||||
- '2381'
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
api-key:
|
||||
- X-API-KEY-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
method: POST
|
||||
uri: https://fake-azure-endpoint.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-12-01-preview
|
||||
response:
|
||||
body:
|
||||
string: '{"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"annotations":[],"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"url\":
|
||||
\"https://example.com/article1\"}","name":"read_website"},"id":"call_ie6tNHSbW9TWIqoXD9CN3MNZ","type":"function"},{"function":{"arguments":"{\"url\":
|
||||
\"https://example.com/article2\"}","name":"read_website"},"id":"call_qxn4V4mMMpOnYSAwVuwarFkB","type":"function"},{"function":{"arguments":"{\"url\":
|
||||
\"https://example.com/article3\"}","name":"read_website"},"id":"call_7ElzUIHHJvuciFWj6eIF5RhF","type":"function"}]}}],"created":1770145137,"id":"chatcmpl-D5Ftxnr2VyEYZd6zSpTJavdxSoE18","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_b54fe76834","usage":{"completion_tokens":77,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":330,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":407}}
|
||||
|
||||
'
|
||||
headers:
|
||||
Content-Length:
|
||||
- '1371'
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:58:57 GMT
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
apim-request-id:
|
||||
- APIM-REQUEST-ID-XXX
|
||||
azureml-model-session:
|
||||
- AZUREML-MODEL-SESSION-XXX
|
||||
x-accel-buffering:
|
||||
- 'no'
|
||||
x-content-type-options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
x-ms-deployment-name:
|
||||
- gpt-4o
|
||||
x-ms-rai-invoked:
|
||||
- 'true'
|
||||
x-ms-region:
|
||||
- X-MS-REGION-XXX
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Research Analyst.
|
||||
An experienced analyst skilled at gathering information and synthesizing findings
|
||||
into actionable insights.\nYour personal goal is: Conduct thorough research
|
||||
and produce insightful reports"}, {"role": "user", "content": "\nCurrent Task:
|
||||
Research the current state of the AI agent market:\n1. Search for recent information
|
||||
about AI agents and their market trends\n2. Read detailed content from a relevant
|
||||
industry source\n3. Generate a brief report summarizing the key findings\n\nUse
|
||||
the available tools for each step."}, {"role": "assistant", "content": "", "tool_calls":
|
||||
[{"id": "call_6RDgkQSr8S7luEHqqOaI734w", "type": "function", "function": {"name":
|
||||
"web_search", "arguments": "{\"query\":\"current state of AI agent market 2023\"}"}}]},
|
||||
{"role": "tool", "tool_call_id": "call_6RDgkQSr8S7luEHqqOaI734w", "content":
|
||||
"Search results for ''current state of AI agent market 2023'': Found 3 relevant
|
||||
articles about the topic including market analysis, competitor data, and industry
|
||||
trends."}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_ie6tNHSbW9TWIqoXD9CN3MNZ",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article1\"}"}}, {"id": "call_qxn4V4mMMpOnYSAwVuwarFkB",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article2\"}"}}, {"id": "call_7ElzUIHHJvuciFWj6eIF5RhF",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article3\"}"}}]}, {"role": "tool", "tool_call_id": "call_ie6tNHSbW9TWIqoXD9CN3MNZ",
|
||||
"content": "Content from https://example.com/article1: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."}, {"role": "tool", "tool_call_id":
|
||||
"call_qxn4V4mMMpOnYSAwVuwarFkB", "content": "Content from https://example.com/article2:
|
||||
This article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}, {"role": "tool",
|
||||
"tool_call_id": "call_7ElzUIHHJvuciFWj6eIF5RhF", "content": "Content from https://example.com/article3:
|
||||
This article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}], "stream": false,
|
||||
"stop": ["\nObservation:"], "tool_choice": "auto", "tools": [{"function": {"name":
|
||||
"web_search", "description": "Search the web for information on a given topic.\n\nArgs:\n query:
|
||||
The search query to look up.\n\nReturns:\n Search results as a string.",
|
||||
"parameters": {"properties": {"query": {"title": "Query", "type": "string"}},
|
||||
"required": ["query"], "type": "object", "additionalProperties": false}}, "type":
|
||||
"function"}, {"function": {"name": "read_website", "description": "Read and
|
||||
extract content from a website URL.\n\nArgs:\n url: The URL of the website
|
||||
to read.\n\nReturns:\n The extracted content from the website.", "parameters":
|
||||
{"properties": {"url": {"title": "Url", "type": "string"}}, "required": ["url"],
|
||||
"type": "object", "additionalProperties": false}}, "type": "function"}, {"function":
|
||||
{"name": "generate_report", "description": "Generate a structured report based
|
||||
on research findings.\n\nArgs:\n title: The title of the report.\n findings:
|
||||
The research findings to include.\n\nReturns:\n A formatted report string.",
|
||||
"parameters": {"properties": {"title": {"title": "Title", "type": "string"},
|
||||
"findings": {"title": "Findings", "type": "string"}}, "required": ["title",
|
||||
"findings"], "type": "object", "additionalProperties": false}}, "type": "function"}]}'
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Length:
|
||||
- '3704'
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
api-key:
|
||||
- X-API-KEY-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
method: POST
|
||||
uri: https://fake-azure-endpoint.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-12-01-preview
|
||||
response:
|
||||
body:
|
||||
string: '{"choices":[{"content_filter_results":{},"finish_reason":"tool_calls","index":0,"logprobs":null,"message":{"annotations":[],"content":null,"refusal":null,"role":"assistant","tool_calls":[{"function":{"arguments":"{\"title\":\"Current
|
||||
State of the AI Agent Market\",\"findings\":\"The AI agent market in 2023
|
||||
is valued at $50 billion, with a growth rate of 15% YoY. Major players in
|
||||
the market have been identified as contributing to the expansion of industry
|
||||
capabilities. Trends point to increasing adoption across industries such as
|
||||
healthcare and finance, where automation and intelligence are becoming central
|
||||
to operations. Emerging competitive forces are influencing pricing and technological
|
||||
advancements in AI agents. Existing and new entrants focus on innovation to
|
||||
differentiate their offerings and capture market share.\"}","name":"generate_report"},"id":"call_7eE0bJbpvO6YYQNs87iTifQ3","type":"function"}]}}],"created":1770145138,"id":"chatcmpl-D5Ftys4PE1B1dkTuv6EPOQyqk0xuv","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_b54fe76834","usage":{"completion_tokens":120,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":537,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":657}}
|
||||
|
||||
'
|
||||
headers:
|
||||
Content-Length:
|
||||
- '1652'
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:58:59 GMT
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
apim-request-id:
|
||||
- APIM-REQUEST-ID-XXX
|
||||
azureml-model-session:
|
||||
- AZUREML-MODEL-SESSION-XXX
|
||||
x-accel-buffering:
|
||||
- 'no'
|
||||
x-content-type-options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
x-ms-deployment-name:
|
||||
- gpt-4o
|
||||
x-ms-rai-invoked:
|
||||
- 'true'
|
||||
x-ms-region:
|
||||
- X-MS-REGION-XXX
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages": [{"role": "system", "content": "You are Research Analyst.
|
||||
An experienced analyst skilled at gathering information and synthesizing findings
|
||||
into actionable insights.\nYour personal goal is: Conduct thorough research
|
||||
and produce insightful reports"}, {"role": "user", "content": "\nCurrent Task:
|
||||
Research the current state of the AI agent market:\n1. Search for recent information
|
||||
about AI agents and their market trends\n2. Read detailed content from a relevant
|
||||
industry source\n3. Generate a brief report summarizing the key findings\n\nUse
|
||||
the available tools for each step."}, {"role": "assistant", "content": "", "tool_calls":
|
||||
[{"id": "call_6RDgkQSr8S7luEHqqOaI734w", "type": "function", "function": {"name":
|
||||
"web_search", "arguments": "{\"query\":\"current state of AI agent market 2023\"}"}}]},
|
||||
{"role": "tool", "tool_call_id": "call_6RDgkQSr8S7luEHqqOaI734w", "content":
|
||||
"Search results for ''current state of AI agent market 2023'': Found 3 relevant
|
||||
articles about the topic including market analysis, competitor data, and industry
|
||||
trends."}, {"role": "assistant", "content": "", "tool_calls": [{"id": "call_ie6tNHSbW9TWIqoXD9CN3MNZ",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article1\"}"}}, {"id": "call_qxn4V4mMMpOnYSAwVuwarFkB",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article2\"}"}}, {"id": "call_7ElzUIHHJvuciFWj6eIF5RhF",
|
||||
"type": "function", "function": {"name": "read_website", "arguments": "{\"url\":
|
||||
\"https://example.com/article3\"}"}}]}, {"role": "tool", "tool_call_id": "call_ie6tNHSbW9TWIqoXD9CN3MNZ",
|
||||
"content": "Content from https://example.com/article1: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."}, {"role": "tool", "tool_call_id":
|
||||
"call_qxn4V4mMMpOnYSAwVuwarFkB", "content": "Content from https://example.com/article2:
|
||||
This article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}, {"role": "tool",
|
||||
"tool_call_id": "call_7ElzUIHHJvuciFWj6eIF5RhF", "content": "Content from https://example.com/article3:
|
||||
This article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}, {"role": "assistant",
|
||||
"content": "", "tool_calls": [{"id": "call_7eE0bJbpvO6YYQNs87iTifQ3", "type":
|
||||
"function", "function": {"name": "generate_report", "arguments": "{\"title\":\"Current
|
||||
State of the AI Agent Market\",\"findings\":\"The AI agent market in 2023 is
|
||||
valued at $50 billion, with a growth rate of 15% YoY. Major players in the market
|
||||
have been identified as contributing to the expansion of industry capabilities.
|
||||
Trends point to increasing adoption across industries such as healthcare and
|
||||
finance, where automation and intelligence are becoming central to operations.
|
||||
Emerging competitive forces are influencing pricing and technological advancements
|
||||
in AI agents. Existing and new entrants focus on innovation to differentiate
|
||||
their offerings and capture market share.\"}"}}]}, {"role": "tool", "tool_call_id":
|
||||
"call_7eE0bJbpvO6YYQNs87iTifQ3", "content": "# Current State of the AI Agent
|
||||
Market\n\n## Executive Summary\nThe AI agent market in 2023 is valued at $50
|
||||
billion, with a growth rate of 15% YoY. Major players in the market have been
|
||||
identified as contributing to the expansion of industry capabilities. Trends
|
||||
point to increasing adoption across industries such as healthcare and finance,
|
||||
where automation and intelligence are becoming central to operations. Emerging
|
||||
competitive forces are influencing pricing and technological advancements in
|
||||
AI agents. Existing and new entrants focus on innovation to differentiate their
|
||||
offerings and capture market share.\n\n## Conclusion\nBased on the analysis,
|
||||
the market shows strong growth potential."}], "stream": false, "stop": ["\nObservation:"],
|
||||
"tool_choice": "auto", "tools": [{"function": {"name": "web_search", "description":
|
||||
"Search the web for information on a given topic.\n\nArgs:\n query: The search
|
||||
query to look up.\n\nReturns:\n Search results as a string.", "parameters":
|
||||
{"properties": {"query": {"title": "Query", "type": "string"}}, "required":
|
||||
["query"], "type": "object", "additionalProperties": false}}, "type": "function"},
|
||||
{"function": {"name": "read_website", "description": "Read and extract content
|
||||
from a website URL.\n\nArgs:\n url: The URL of the website to read.\n\nReturns:\n The
|
||||
extracted content from the website.", "parameters": {"properties": {"url": {"title":
|
||||
"Url", "type": "string"}}, "required": ["url"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}, {"function": {"name": "generate_report", "description":
|
||||
"Generate a structured report based on research findings.\n\nArgs:\n title:
|
||||
The title of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "parameters": {"properties": {"title": {"title":
|
||||
"Title", "type": "string"}, "findings": {"title": "Findings", "type": "string"}},
|
||||
"required": ["title", "findings"], "type": "object", "additionalProperties":
|
||||
false}}, "type": "function"}]}'
|
||||
headers:
|
||||
Accept:
|
||||
- application/json
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Length:
|
||||
- '5276'
|
||||
Content-Type:
|
||||
- application/json
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
api-key:
|
||||
- X-API-KEY-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
method: POST
|
||||
uri: https://fake-azure-endpoint.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-12-01-preview
|
||||
response:
|
||||
body:
|
||||
string: '{"choices":[{"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"protected_material_code":{"detected":false,"filtered":false},"protected_material_text":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}},"finish_reason":"stop","index":0,"logprobs":null,"message":{"annotations":[],"content":"The
|
||||
report detailing the current state of the AI agent market has been generated
|
||||
successfully. It highlights the market''s $50 billion valuation in 2023, with
|
||||
a consistent annual growth rate of 15%. Key findings identify the role of
|
||||
major players, impactful trends like sector adoption (healthcare and finance),
|
||||
and the competitive dynamic driving innovation and technological advancements.","refusal":null,"role":"assistant"}}],"created":1770145141,"id":"chatcmpl-D5Fu18JFkDPGsKf10eiS2e2uI04MU","model":"gpt-4o-2024-11-20","object":"chat.completion","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"detected":false,"filtered":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}],"system_fingerprint":"fp_b54fe76834","usage":{"completion_tokens":72,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":0,"rejected_prediction_tokens":0},"prompt_tokens":787,"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0},"total_tokens":859}}
|
||||
|
||||
'
|
||||
headers:
|
||||
Content-Length:
|
||||
- '1597'
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:01 GMT
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
apim-request-id:
|
||||
- APIM-REQUEST-ID-XXX
|
||||
azureml-model-session:
|
||||
- AZUREML-MODEL-SESSION-XXX
|
||||
x-accel-buffering:
|
||||
- 'no'
|
||||
x-content-type-options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
x-ms-client-request-id:
|
||||
- X-MS-CLIENT-REQUEST-ID-XXX
|
||||
x-ms-deployment-name:
|
||||
- gpt-4o
|
||||
x-ms-rai-invoked:
|
||||
- 'true'
|
||||
x-ms-region:
|
||||
- X-MS-REGION-XXX
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,613 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "Create a focused execution plan for
|
||||
the following task:\n\n## Task\nResearch the current state of the AI agent market:\n1.
|
||||
Search for recent information about AI agents and their market trends\n2. Read
|
||||
detailed content from a relevant industry source\n3. Generate a brief report
|
||||
summarizing the key findings\n\nUse the available tools for each step.\n\n##
|
||||
Expected Output\nComplete the task successfully\n\n## Available Tools\nweb_search,
|
||||
read_website, generate_report\n\n## Instructions\nCreate ONLY the essential
|
||||
steps needed to complete this task. Use the MINIMUM number of steps required
|
||||
- do NOT pad your plan with unnecessary steps. Most tasks need only 2-5 steps.\n\nFor
|
||||
each step:\n- State the specific action to take\n- Specify which tool to use
|
||||
(if any)\n- Note dependencies on previous steps if this step requires their
|
||||
output\n- If a step involves multiple items (e.g., research 3 competitors),
|
||||
note this explicitly\n\nDo NOT include:\n- Setup or preparation steps that are
|
||||
obvious\n- Verification steps unless critical\n- Documentation or cleanup steps
|
||||
unless explicitly required\n- Generic steps like \"review results\" or \"finalize
|
||||
output\"\n\nAfter your plan, state:\n- \"READY: I am ready to execute the task.\"
|
||||
if the plan is complete\n- \"NOT READY: I need to refine my plan because [reason].\"
|
||||
if you need more thinking"}], "role": "user"}], "systemInstruction": {"parts":
|
||||
[{"text": "You are a strategic planning assistant. Create minimal, effective
|
||||
execution plans. Prefer fewer steps over more."}], "role": "user"}, "tools":
|
||||
[{"functionDeclarations": [{"description": "Create or refine a reasoning plan
|
||||
for a task with structured steps", "name": "create_reasoning_plan", "parameters_json_schema":
|
||||
{"type": "object", "properties": {"plan": {"type": "string", "description":
|
||||
"A brief summary of the overall plan."}, "steps": {"type": "array", "description":
|
||||
"List of discrete steps to execute the plan", "items": {"type": "object", "properties":
|
||||
{"step_number": {"type": "integer", "description": "Step number (1-based)"},
|
||||
"description": {"type": "string", "description": "What to do in this step"},
|
||||
"tool_to_use": {"type": ["string", "null"], "description": "Tool to use for
|
||||
this step, or null if no tool needed"}, "depends_on": {"type": "array", "items":
|
||||
{"type": "integer"}, "description": "Step numbers this step depends on (empty
|
||||
array if none)"}}, "required": ["step_number", "description", "tool_to_use",
|
||||
"depends_on"], "additionalProperties": false}}, "ready": {"type": "boolean",
|
||||
"description": "Whether the agent is ready to execute the task."}}, "required":
|
||||
["plan", "steps", "ready"], "additionalProperties": false}}]}], "generationConfig":
|
||||
{"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '2747'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"functionCall\": {\n \"name\": \"create_reasoning_plan\",\n
|
||||
\ \"args\": {\n \"steps\": [\n {\n
|
||||
\ \"step_number\": 1,\n \"tool_to_use\":
|
||||
\"web_search\",\n \"depends_on\": [],\n \"description\":
|
||||
\"Search for recent information on AI agent market trends.\"\n },\n
|
||||
\ {\n \"description\": \"Read detailed
|
||||
content from a relevant industry source found in the search results.\",\n
|
||||
\ \"depends_on\": [\n 1\n ],\n
|
||||
\ \"step_number\": 2,\n \"tool_to_use\":
|
||||
\"read_website\"\n },\n {\n \"depends_on\":
|
||||
[\n 2\n ],\n \"step_number\":
|
||||
3,\n \"tool_to_use\": \"generate_report\",\n \"description\":
|
||||
\"Generate a brief report summarizing the key findings from the researched
|
||||
content.\"\n }\n ],\n \"plan\":
|
||||
\"Research the current state of the AI agent market and generate a summary
|
||||
report.\",\n \"ready\": true\n }\n },\n
|
||||
\ \"thoughtSignature\": \"CsIIAXLI2nztq0xBScBM9fsnIBhVvD6CWKYYyj3khtIYTNl4oRbOYnH8LQBzET8fRrxiWqnxib7Nn/UVK29pvsHX7TacFxm0ieHb5gmb2lgqo4GpG0P2+HI4xo4vnibPl3OM+bl4M39/JOdBNBmYGUJETnzV++m8INVLIlOuRPGTXRDUOKLNfkyktsJRdNuO68OMu5WXDqrlbuppG1dsK+Y8cyvzDRoMTsYU1arFOZuyLisuhDQ7nTbdXQ8AO0Oc43MdYrSFmfeDBbsnrxDKBMPYtFVadggz4RwKIFvg3Fb9ORho2GkBUum8PNWHZCBXuAoU9FaVdDFVReduuTfZuBwy/Y6MS+8mnLqcQ1wADlg7DnzaOXmALxgfApTEL6YUvwVjVYI1dpCR5ACkFgNq6ecYYumrlZHuHE59p+XOHMhrzu9c99A0mtRvpkz1yu75dMACliSf/2fu4gCPRRLsgez7llp92g7+GzVkbwkRVlMcYQ+0l28sBsfBQd01lQR0vNNbK3JHf/chtCtrRIcgqqnUbTTqm5n8iPHFBWMdEa0L4I1WfPbiUSC9OGwwaoP+Ro6h/gPH9o96gjZQpCft1myrKtgl7dpOaSharMuDfulk2Wd5wJoZ9XR/fxVYQos8sNEIZq8O1cjOW9L74ryKMtw6hF8A4kxGLhOSgXwszNqHoLCLoX6Cz5vb2hZVkCWxq8yn5k3IrTcw/16Jdkx6oNWjHZJmJMz8vl85sUH1ZwZocWHWcUUMo33ZlsBnqPZxwnAj5CW+vQS/xCC7Kq1FciqosYyHgN43bm8JqnHL4qgBAEtDPVrFfaWBpzWWVfXQkX/EVApU/Jr3t9D3gz10CFPsV7d0lx0P7jur8u8Q9n8r2HEi320kNf1EX4YnDioX+nWmHPN203OCOHpDEcEQ89gECMk5M9Xu6EZ94rXmrZJtP5kc0k37fvMexlxIZPuUmV7RpoCTrMVqMyP93eIq9FY/9WsqHVlydumTfEMPI1WY5ObNeHJFhyu2Y6dGB3ONQL1bQ0oboNZujX/AhnauV0A8OS2wsA3yLVk0GFZpTISU+WQ2/Gm7t8CUIgKT3BV4JkYuyNBTONQPLitpfO+TEMcuNZlodinLvkBtBA8B0W55kOAK7y21I9znnNKONo87jg9kfoZMvYlb2DrO9YovQDDhdCZjxXr5VZqbhMH4tb8t5kP/1auCv1GfzV6RVSgyNVYnruqJKEtqgNbLid1FB9EH3Qu0A92HLqdGsuC3qRm2qfyMEmz7iYJ5n/WA5BertGZ/O0SGLEBftgEjQOJhj7flGTEio3yyCHyvw/yGP6S8F3+mPvVLO6/eWMCGm7ig/mG8pjnysRTQTjDv966XhU9SYpinoxTd5mEuWdIHKMZxtBK7qeKY369njKJOP2K220Rk9/Ii+KyzNvbzyobK6oMNcwXgHjO+ssbH+blVUbLai3UblQ==\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0,\n \"finishMessage\": \"Model generated
|
||||
function call(s).\"\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
529,\n \"candidatesTokenCount\": 169,\n \"totalTokenCount\": 955,\n
|
||||
\ \"promptTokensDetails\": [\n {\n \"modality\": \"TEXT\",\n
|
||||
\ \"tokenCount\": 529\n }\n ],\n \"thoughtsTokenCount\":
|
||||
257\n },\n \"modelVersion\": \"gemini-2.5-flash\",\n \"responseId\": \"h0WCacqWA6WM_PUPl-niyQ0\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:19 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=2345
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "\nCurrent Task: Research the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}], "role": "user"}], "systemInstruction": {"parts": [{"text":
|
||||
"You are Research Analyst. An experienced analyst skilled at gathering information
|
||||
and synthesizing findings into actionable insights.\nYour personal goal is:
|
||||
Conduct thorough research and produce insightful reports"}], "role": "user"},
|
||||
"tools": [{"functionDeclarations": [{"description": "Search the web for information
|
||||
on a given topic.\n\nArgs:\n query: The search query to look up.\n\nReturns:\n Search
|
||||
results as a string.", "name": "web_search", "parameters_json_schema": {"properties":
|
||||
{"query": {"title": "Query", "type": "string"}}, "required": ["query"], "type":
|
||||
"object", "additionalProperties": false}}, {"description": "Read and extract
|
||||
content from a website URL.\n\nArgs:\n url: The URL of the website to read.\n\nReturns:\n The
|
||||
extracted content from the website.", "name": "read_website", "parameters_json_schema":
|
||||
{"properties": {"url": {"title": "Url", "type": "string"}}, "required": ["url"],
|
||||
"type": "object", "additionalProperties": false}}, {"description": "Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "name": "generate_report", "parameters_json_schema":
|
||||
{"properties": {"title": {"title": "Title", "type": "string"}, "findings": {"title":
|
||||
"Findings", "type": "string"}}, "required": ["title", "findings"], "type": "object",
|
||||
"additionalProperties": false}}]}], "generationConfig": {"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1904'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"functionCall\": {\n \"name\": \"web_search\",\n
|
||||
\ \"args\": {\n \"query\": \"AI agent market trends
|
||||
2023-2024\"\n }\n },\n \"thoughtSignature\":
|
||||
\"CoYEAXLI2nzmyDix3/QA+tMOiUwpDVoA5+RJoRW7kw3okJaVYCa5Usx7eBn4xowP7oXNynS4NfawCYqboufBXjHinq13UTcYg0Y74qIrza4KuctliGmf8G7S4QoS0Y3gqCHQKsxTdShQOg8wirnr8Rdu1eyrrhWE0XKk0HPA0Ssj7zUVoJBqHPqwyvkFyXkMtpcmtq9qXmZYfMFuSKRQnYLVLllL/BpOIL3w7MuofpviO85bvYk9gX0vsDjYWS6EdVEfC9k2BWGjhHaILXT9A1iwNPdDAg33SOC+BlPrGox0ghCr5qEKnBMZhUszqaUCykczFCq+xMIA3xDGNbTjicWb53sL/PXBYLsNty1giW3nKFe8+8eRpUsHUx7oQ82m4AUxKqk99mZjaLp8bHk+rERjFZErcw/pe/3190K0WGHH5ecB4amJCzZtVrQJ1oAZhb7/P1VZ57xmt1z/c1pQgjuvnV+cWE9blh5o6mNNFbFuzJDIO2k8qrFeeDwlCF8OOrxo8F+z1evg4yjZ1+9TLCVFTmZ0S0PI54FS5afb0RdPol2/ISNw7H/dtnO4z6LhT2NmlYqYZr8qfVoUD21rmI08NFs+f/6JW5+7eSQbax76SW+6A2IqqPPyF66MCpqtEzC+hpzVsCBcIQyRQWsdm+RNAs50gmqF6W3CcTPryWkeS7w9ORqxdiU=\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0,\n \"finishMessage\": \"Model generated
|
||||
function call(s).\"\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
319,\n \"candidatesTokenCount\": 28,\n \"totalTokenCount\": 461,\n \"promptTokensDetails\":
|
||||
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 319\n
|
||||
\ }\n ],\n \"thoughtsTokenCount\": 114\n },\n \"modelVersion\":
|
||||
\"gemini-2.5-flash\",\n \"responseId\": \"iEWCaYyJENDn_uMP4q3N8QE\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:20 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=1193
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "\nCurrent Task: Research the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}], "role": "user"}, {"parts": [{"functionCall": {"args": {"query":
|
||||
"AI agent market trends 2023-2024"}, "name": "web_search"}, "thoughtSignature":
|
||||
"CoYEAXLI2nzmyDix3_QA-tMOiUwpDVoA5-RJoRW7kw3okJaVYCa5Usx7eBn4xowP7oXNynS4NfawCYqboufBXjHinq13UTcYg0Y74qIrza4KuctliGmf8G7S4QoS0Y3gqCHQKsxTdShQOg8wirnr8Rdu1eyrrhWE0XKk0HPA0Ssj7zUVoJBqHPqwyvkFyXkMtpcmtq9qXmZYfMFuSKRQnYLVLllL_BpOIL3w7MuofpviO85bvYk9gX0vsDjYWS6EdVEfC9k2BWGjhHaILXT9A1iwNPdDAg33SOC-BlPrGox0ghCr5qEKnBMZhUszqaUCykczFCq-xMIA3xDGNbTjicWb53sL_PXBYLsNty1giW3nKFe8-8eRpUsHUx7oQ82m4AUxKqk99mZjaLp8bHk-rERjFZErcw_pe_3190K0WGHH5ecB4amJCzZtVrQJ1oAZhb7_P1VZ57xmt1z_c1pQgjuvnV-cWE9blh5o6mNNFbFuzJDIO2k8qrFeeDwlCF8OOrxo8F-z1evg4yjZ1-9TLCVFTmZ0S0PI54FS5afb0RdPol2_ISNw7H_dtnO4z6LhT2NmlYqYZr8qfVoUD21rmI08NFs-f_6JW5-7eSQbax76SW-6A2IqqPPyF66MCpqtEzC-hpzVsCBcIQyRQWsdm-RNAs50gmqF6W3CcTPryWkeS7w9ORqxdiU="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''AI agent market trends 2023-2024'': Found 3
|
||||
relevant articles about the topic including market analysis, competitor data,
|
||||
and industry trends."}}}], "role": "user"}], "systemInstruction": {"parts":
|
||||
[{"text": "You are Research Analyst. An experienced analyst skilled at gathering
|
||||
information and synthesizing findings into actionable insights.\nYour personal
|
||||
goal is: Conduct thorough research and produce insightful reports"}], "role":
|
||||
"user"}, "tools": [{"functionDeclarations": [{"description": "Search the web
|
||||
for information on a given topic.\n\nArgs:\n query: The search query to look
|
||||
up.\n\nReturns:\n Search results as a string.", "name": "web_search", "parameters_json_schema":
|
||||
{"properties": {"query": {"title": "Query", "type": "string"}}, "required":
|
||||
["query"], "type": "object", "additionalProperties": false}}, {"description":
|
||||
"Read and extract content from a website URL.\n\nArgs:\n url: The URL of
|
||||
the website to read.\n\nReturns:\n The extracted content from the website.",
|
||||
"name": "read_website", "parameters_json_schema": {"properties": {"url": {"title":
|
||||
"Url", "type": "string"}}, "required": ["url"], "type": "object", "additionalProperties":
|
||||
false}}, {"description": "Generate a structured report based on research findings.\n\nArgs:\n title:
|
||||
The title of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "name": "generate_report", "parameters_json_schema":
|
||||
{"properties": {"title": {"title": "Title", "type": "string"}, "findings": {"title":
|
||||
"Findings", "type": "string"}}, "required": ["title", "findings"], "type": "object",
|
||||
"additionalProperties": false}}]}], "generationConfig": {"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '3015'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"functionCall\": {\n \"name\": \"web_search\",\n
|
||||
\ \"args\": {\n \"query\": \"latest reports AI
|
||||
agent market analysis\"\n }\n },\n \"thoughtSignature\":
|
||||
\"CpwGAXLI2nybmVGffIN1k+T5M2HmQNlvybZRPoo/ysgNARa+9nrPdRoBZ9RC+Dee9KSk1o7O+IU9l0sWCTirQYcroEhXon+JIQUVTed/L0s//sBOR+hJnZWoaG5ucsfJQvovAQba2Wb7uViEkdySvHfRApF0atewbC+TCKZrxDAQ6Naby8nwUTauJPKlgsBsZVnlViRfIbF7pom1zvXD+d5htjMiuJr1nOuSH0EGQWC4TUiuJD23hgockzhmIpbU/bStn8PFIQNsySEzl6H5sZdlD4auwCMCD2Q+Ur05w1uLv7n8GoSZn5dkdXLR5R7dZ+kkX+xP4w841Ih2gc6rBKT5tSedN01AuJsK65NSfOXZBwakxs58WZXDQXnIQe4d2QThAX3nPdUmhvVI6sHX+ZdtQZIrhE7hRf9j/T/wvvrUao5VDv+mxXd9bcPEV2BzSXkvkAB1SbJ+5wN7Qb2j31lkiUu5uRnZOiVxL5iCS+8Z/jEl4NjpGithbcPoNpFIDOeiE/f8kf7tQJDX+YNquPbYZRJHvIfLalVQndVGNlZVN2jXT3Wwo8So3vmzIDFVjV+pj7tSRNK8hTITm6bfHS+XUZqJdm7eHCzhonyJ7/tl7LbsstPXoZU3ZN50tNpXYOK+NzgzU7iwd9SaHVXgzQRdujWgHuBmSiSd9qNHvdaNwgARVTnMj3VYpehgIuaYMzQmgM99TdC/zmzcqHa5VZSnHKHqMIVc9gjRvVwz4DUm6VLLnKnVYFClM6gofmUI6s9fThiR5EdfimaDTlRlzh6Df33jAbRA9rUTDH6uE+DjiopCvXuHjmQqK9Smyxt2vTao9H7AYIRN7yWmdVoaG0tUSL2XQ31wIW3cEyhz7ihQwFYKJnOkQ3/CiU6KV+4ldk9UY/vKWSgItVTTE6G8Di0iviiCAkmL59Uj7vnIp80+U9rDIK7WhxpAWlrDA6cGQT2LGAXQ2liXtLa31nXyfvCezhtSS8jSVm4SHaiU+INvYtpq2Q7nXPTFbjjZooyC5FePGqAH1T+sRYbR02jaa572/NuwFgBCObTfqO8G5A==\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0,\n \"finishMessage\": \"Model generated
|
||||
function call(s).\"\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
400,\n \"candidatesTokenCount\": 20,\n \"totalTokenCount\": 589,\n \"promptTokensDetails\":
|
||||
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 400\n
|
||||
\ }\n ],\n \"thoughtsTokenCount\": 169\n },\n \"modelVersion\":
|
||||
\"gemini-2.5-flash\",\n \"responseId\": \"ikWCacqBG8ve_uMPj4KFyAY\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:22 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=2125
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "\nCurrent Task: Research the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}], "role": "user"}, {"parts": [{"functionCall": {"args": {"query":
|
||||
"AI agent market trends 2023-2024"}, "name": "web_search"}, "thoughtSignature":
|
||||
"CoYEAXLI2nzmyDix3_QA-tMOiUwpDVoA5-RJoRW7kw3okJaVYCa5Usx7eBn4xowP7oXNynS4NfawCYqboufBXjHinq13UTcYg0Y74qIrza4KuctliGmf8G7S4QoS0Y3gqCHQKsxTdShQOg8wirnr8Rdu1eyrrhWE0XKk0HPA0Ssj7zUVoJBqHPqwyvkFyXkMtpcmtq9qXmZYfMFuSKRQnYLVLllL_BpOIL3w7MuofpviO85bvYk9gX0vsDjYWS6EdVEfC9k2BWGjhHaILXT9A1iwNPdDAg33SOC-BlPrGox0ghCr5qEKnBMZhUszqaUCykczFCq-xMIA3xDGNbTjicWb53sL_PXBYLsNty1giW3nKFe8-8eRpUsHUx7oQ82m4AUxKqk99mZjaLp8bHk-rERjFZErcw_pe_3190K0WGHH5ecB4amJCzZtVrQJ1oAZhb7_P1VZ57xmt1z_c1pQgjuvnV-cWE9blh5o6mNNFbFuzJDIO2k8qrFeeDwlCF8OOrxo8F-z1evg4yjZ1-9TLCVFTmZ0S0PI54FS5afb0RdPol2_ISNw7H_dtnO4z6LhT2NmlYqYZr8qfVoUD21rmI08NFs-f_6JW5-7eSQbax76SW-6A2IqqPPyF66MCpqtEzC-hpzVsCBcIQyRQWsdm-RNAs50gmqF6W3CcTPryWkeS7w9ORqxdiU="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''AI agent market trends 2023-2024'': Found 3
|
||||
relevant articles about the topic including market analysis, competitor data,
|
||||
and industry trends."}}}], "role": "user"}, {"parts": [{"functionCall": {"args":
|
||||
{"query": "latest reports AI agent market analysis"}, "name": "web_search"},
|
||||
"thoughtSignature": "CpwGAXLI2nybmVGffIN1k-T5M2HmQNlvybZRPoo_ysgNARa-9nrPdRoBZ9RC-Dee9KSk1o7O-IU9l0sWCTirQYcroEhXon-JIQUVTed_L0s__sBOR-hJnZWoaG5ucsfJQvovAQba2Wb7uViEkdySvHfRApF0atewbC-TCKZrxDAQ6Naby8nwUTauJPKlgsBsZVnlViRfIbF7pom1zvXD-d5htjMiuJr1nOuSH0EGQWC4TUiuJD23hgockzhmIpbU_bStn8PFIQNsySEzl6H5sZdlD4auwCMCD2Q-Ur05w1uLv7n8GoSZn5dkdXLR5R7dZ-kkX-xP4w841Ih2gc6rBKT5tSedN01AuJsK65NSfOXZBwakxs58WZXDQXnIQe4d2QThAX3nPdUmhvVI6sHX-ZdtQZIrhE7hRf9j_T_wvvrUao5VDv-mxXd9bcPEV2BzSXkvkAB1SbJ-5wN7Qb2j31lkiUu5uRnZOiVxL5iCS-8Z_jEl4NjpGithbcPoNpFIDOeiE_f8kf7tQJDX-YNquPbYZRJHvIfLalVQndVGNlZVN2jXT3Wwo8So3vmzIDFVjV-pj7tSRNK8hTITm6bfHS-XUZqJdm7eHCzhonyJ7_tl7LbsstPXoZU3ZN50tNpXYOK-NzgzU7iwd9SaHVXgzQRdujWgHuBmSiSd9qNHvdaNwgARVTnMj3VYpehgIuaYMzQmgM99TdC_zmzcqHa5VZSnHKHqMIVc9gjRvVwz4DUm6VLLnKnVYFClM6gofmUI6s9fThiR5EdfimaDTlRlzh6Df33jAbRA9rUTDH6uE-DjiopCvXuHjmQqK9Smyxt2vTao9H7AYIRN7yWmdVoaG0tUSL2XQ31wIW3cEyhz7ihQwFYKJnOkQ3_CiU6KV-4ldk9UY_vKWSgItVTTE6G8Di0iviiCAkmL59Uj7vnIp80-U9rDIK7WhxpAWlrDA6cGQT2LGAXQ2liXtLa31nXyfvCezhtSS8jSVm4SHaiU-INvYtpq2Q7nXPTFbjjZooyC5FePGqAH1T-sRYbR02jaa572_NuwFgBCObTfqO8G5A=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''latest reports AI agent market analysis'':
|
||||
Found 3 relevant articles about the topic including market analysis, competitor
|
||||
data, and industry trends."}}}], "role": "user"}], "systemInstruction": {"parts":
|
||||
[{"text": "You are Research Analyst. An experienced analyst skilled at gathering
|
||||
information and synthesizing findings into actionable insights.\nYour personal
|
||||
goal is: Conduct thorough research and produce insightful reports"}], "role":
|
||||
"user"}, "tools": [{"functionDeclarations": [{"description": "Search the web
|
||||
for information on a given topic.\n\nArgs:\n query: The search query to look
|
||||
up.\n\nReturns:\n Search results as a string.", "name": "web_search", "parameters_json_schema":
|
||||
{"properties": {"query": {"title": "Query", "type": "string"}}, "required":
|
||||
["query"], "type": "object", "additionalProperties": false}}, {"description":
|
||||
"Read and extract content from a website URL.\n\nArgs:\n url: The URL of
|
||||
the website to read.\n\nReturns:\n The extracted content from the website.",
|
||||
"name": "read_website", "parameters_json_schema": {"properties": {"url": {"title":
|
||||
"Url", "type": "string"}}, "required": ["url"], "type": "object", "additionalProperties":
|
||||
false}}, {"description": "Generate a structured report based on research findings.\n\nArgs:\n title:
|
||||
The title of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "name": "generate_report", "parameters_json_schema":
|
||||
{"properties": {"title": {"title": "Title", "type": "string"}, "findings": {"title":
|
||||
"Findings", "type": "string"}}, "required": ["title", "findings"], "type": "object",
|
||||
"additionalProperties": false}}]}], "generationConfig": {"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '4512'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"functionCall\": {\n \"name\": \"read_website\",\n
|
||||
\ \"args\": {\n \"url\": \"https://www.example.com/ai-agent-market-report\"\n
|
||||
\ }\n },\n \"thoughtSignature\": \"CooPAXLI2nzYy6ki8YJo4RDDzryK6qtkbIEWXCh0ZjpoRX2fgNghUrxXZUwrsrbrwEpccdvWCDpb5ZkwYMNuzMi4yRUsjfcebfd2VCwQgvWnWmitj3taAcLCUDIJX5pGt0L2O8V6ehWmrANQHGw6Qc/QVx5dMlSFeFKHtfc1M95CJz2BxZd3lnuKLCEu7LCCiqIDdd1o1y/EcGsl7OHai6WyQJg49Cvcww//Z+kfSVoAPGNedTYPIf4ImttMyofV8+yczI0IGjhFzE0Qk1Pvo84O9NyOufpPELeKY8l1yfZgSZEL0sUA6weqf1P/xzNKt6h96Rh1KpAx5iTGFtqOWJrJ8OP+ZdGJ+rA+xZQuTRtKbW/e60rC5kPgJnkhWCp1p7HTLgTGwpzzxztqL0ggURaWw8GJw8S41BcM5mFEA+a7ivMWPMLdMk6h5gr/Y8JTnLSRZFoZYHkY9bTcAFPc9gapyFlKkQDciYet/MHe2zfE7ycx0e8c0W7ISoYPHpXW/WxNekMiNdfx1eg/mEX/Y0Vjc70p+HtbnEGaBoZWJSo+cJtZdA4sNJaIuEnnVTtAdAtnoxJUOyr2jrKDAsSjHmVoeLARZO2/DuJKsEVNHzsNPMw4SrBq1DkG52Aof7KcskOfW2OyoZEUnIf23IRabKflUG/7dHGqYfLtkWRApWZYBy2eQILwsmXJ4xx27S7/02Jl0D8rX3vOQhjS7lTjrXvy8wU3biUFvbnqJuLj3ACLn7Hn1axe4dB7zIpYC1di63DDs1fQp79d2VaGRC+tVMKiQu/+yC6nCM4j8JSnpBNgvyhq3ilAr/iDHD6GkbxdBBChFbZl0KY+WkrcZpPp2g2m/beiQuzF+cM6RuaqF2W0TEjVT+OZ1ivObreXFVFWa9T5qFsTjV3E/SFlmrXdx6Kf8d0i9QeEwbzBIvvX3VNUdW1DJ95WylaUXFtljk/cqylri2j2WTPMTSV9fcM/a8UWoayUAuLzq8zgxd2Wvrm8uvGcaewAQT+yK+u5FsLFoKxaMkoakb2/1tjWfhn+MrbIoYOBIebUapUhADUJgGDTG7byEEQlbwNaa8rOZ5ZpdBrDXjtj1tsz6cqaEiCbtZWqei0myuMa0J6Z3FHoceSUgOACD/bHWSkzdW7LdKBKLxB25fKfD1hCLscE1skZ7nAEZWmrUzKz9yCiqAPfatQhHqnr3EchEB/dxbNXxCCT6IFxemhb9AsaQWjcTrlQJiuz8t4VMmu1slgEcrhweZ/PpxI/E74qvV9ljcFLcziW0BZaqepJMeBe2cLfVVki5R5kudQVuAcCEdkrwBDWAwZlO9aWTmiZ9+ggfl3F/63JzZXSM/NDc/2rJ1k65e+O+vyTzkrUwnSPnh4RPK6jeIul4SSLPgyZBwp0qHyTl4As8jpMe9Rbt0NRli6Z5eAr/IYdbicKo/pzqiupdxvu4u+jKt+F4KojU9avgWFAB01isHHO5Z1vzVJ6XDilWeah5DvHc1lkcPCXtbBGvykfFqJIBhthnFi0f/S4HV+IlOKwvKbfmL5GplD7H+DjUA5UdHjw8HoJa6uQxhbERy5dZlYqxN918aL147Afq4LuPoWUJULEsYULwUuA6HspemIKUltHacOAxZgP4OLVkB3zwssj8E6rMtU1puupHiL7J66fFaR3co71gzzlvl8R2Xi3xEQdpigxxCUAsZWMrSrITRBnKPKGF1CrFEhU6FP6bQAQ6UuhAdqLoJihwVnMTyY9fGUriwCkrQu5gK7ZQlnXyluV0J/5xWh4sOaPmwmeiUXMBPN0iGb7z24lyHaI3QXz3kGlJBnIFhseJTJo3ed66Z/LAf8I/hFC6s/sIioEmRgd4tm3Q1U05ETKrptnzo8Ac4AOTdJtbQv0uDQSkoefUbebu7x6L9Dns04VSvDPKLwlFQd81sl9DYmi9SPDxKT7S6gfG6WjJ9z35eNSR01QW1QIgAAhMU8UX4o7QQaXnUZxfZeYRMXlzu/xb4KSREvc/FeLJ+IvnPFgzryAgLi/Sipl//Eul0sjrREPYJE1GxBOIoURGa+Bsmc3yy8aWArxv/HGpbLzwjmH8TaMvB3P/4tkvT+5IjJlpe0UrR1ssqasUtwfH9yWv5+4i+EdJrJ/SJ4Hl1Vlj9zi9lEFr33Zs96kn8ZOkBHp0m7Sxr5xP+krSxQkROIpu0d02kIqQ3nob+kGbnAf0zkmH6pS3H4mG2Zksu8KcGvghx7XTl3qBOJ+ZY4vlev2cSMBfMmnbUHKvMlz4YsmTGR1JPntDguA8UJJ1UZCex4E/W3KcHwd4qvzqgMZNjdarIvGjlmnKmoL1RV7EqUsBkpk+jauY0SqoWsIIf4b6O9Y3fQRRJURLeIfGCTmlxl+df+4yjqUhxUXTaQsX2KlEJ3tZK+ZI9FdKMzqPip2oMFwf2XfLIyIuRA0NU5fDRIxqPUzYv6RQ+zhXXB1QscsAtyf1t+LsaVw//1Vfj6V3Ups4pNyiwMAZg1z9DaIHht++VfgCdqT4RLcaGI8eEDrjkOc9G/iLkLBCfOB7EZkcXT20Lc1Silxa++dZsaYp5Tni8dz6f5YWg==\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0,\n \"finishMessage\": \"Model generated
|
||||
function call(s).\"\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
465,\n \"candidatesTokenCount\": 29,\n \"totalTokenCount\": 916,\n \"promptTokensDetails\":
|
||||
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 465\n
|
||||
\ }\n ],\n \"thoughtsTokenCount\": 422\n },\n \"modelVersion\":
|
||||
\"gemini-2.5-flash\",\n \"responseId\": \"jUWCadDOIdi8_uMPxuOu4Ak\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:25 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=3079
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "\nCurrent Task: Research the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}], "role": "user"}, {"parts": [{"functionCall": {"args": {"query":
|
||||
"AI agent market trends 2023-2024"}, "name": "web_search"}, "thoughtSignature":
|
||||
"CoYEAXLI2nzmyDix3_QA-tMOiUwpDVoA5-RJoRW7kw3okJaVYCa5Usx7eBn4xowP7oXNynS4NfawCYqboufBXjHinq13UTcYg0Y74qIrza4KuctliGmf8G7S4QoS0Y3gqCHQKsxTdShQOg8wirnr8Rdu1eyrrhWE0XKk0HPA0Ssj7zUVoJBqHPqwyvkFyXkMtpcmtq9qXmZYfMFuSKRQnYLVLllL_BpOIL3w7MuofpviO85bvYk9gX0vsDjYWS6EdVEfC9k2BWGjhHaILXT9A1iwNPdDAg33SOC-BlPrGox0ghCr5qEKnBMZhUszqaUCykczFCq-xMIA3xDGNbTjicWb53sL_PXBYLsNty1giW3nKFe8-8eRpUsHUx7oQ82m4AUxKqk99mZjaLp8bHk-rERjFZErcw_pe_3190K0WGHH5ecB4amJCzZtVrQJ1oAZhb7_P1VZ57xmt1z_c1pQgjuvnV-cWE9blh5o6mNNFbFuzJDIO2k8qrFeeDwlCF8OOrxo8F-z1evg4yjZ1-9TLCVFTmZ0S0PI54FS5afb0RdPol2_ISNw7H_dtnO4z6LhT2NmlYqYZr8qfVoUD21rmI08NFs-f_6JW5-7eSQbax76SW-6A2IqqPPyF66MCpqtEzC-hpzVsCBcIQyRQWsdm-RNAs50gmqF6W3CcTPryWkeS7w9ORqxdiU="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''AI agent market trends 2023-2024'': Found 3
|
||||
relevant articles about the topic including market analysis, competitor data,
|
||||
and industry trends."}}}], "role": "user"}, {"parts": [{"functionCall": {"args":
|
||||
{"query": "latest reports AI agent market analysis"}, "name": "web_search"},
|
||||
"thoughtSignature": "CpwGAXLI2nybmVGffIN1k-T5M2HmQNlvybZRPoo_ysgNARa-9nrPdRoBZ9RC-Dee9KSk1o7O-IU9l0sWCTirQYcroEhXon-JIQUVTed_L0s__sBOR-hJnZWoaG5ucsfJQvovAQba2Wb7uViEkdySvHfRApF0atewbC-TCKZrxDAQ6Naby8nwUTauJPKlgsBsZVnlViRfIbF7pom1zvXD-d5htjMiuJr1nOuSH0EGQWC4TUiuJD23hgockzhmIpbU_bStn8PFIQNsySEzl6H5sZdlD4auwCMCD2Q-Ur05w1uLv7n8GoSZn5dkdXLR5R7dZ-kkX-xP4w841Ih2gc6rBKT5tSedN01AuJsK65NSfOXZBwakxs58WZXDQXnIQe4d2QThAX3nPdUmhvVI6sHX-ZdtQZIrhE7hRf9j_T_wvvrUao5VDv-mxXd9bcPEV2BzSXkvkAB1SbJ-5wN7Qb2j31lkiUu5uRnZOiVxL5iCS-8Z_jEl4NjpGithbcPoNpFIDOeiE_f8kf7tQJDX-YNquPbYZRJHvIfLalVQndVGNlZVN2jXT3Wwo8So3vmzIDFVjV-pj7tSRNK8hTITm6bfHS-XUZqJdm7eHCzhonyJ7_tl7LbsstPXoZU3ZN50tNpXYOK-NzgzU7iwd9SaHVXgzQRdujWgHuBmSiSd9qNHvdaNwgARVTnMj3VYpehgIuaYMzQmgM99TdC_zmzcqHa5VZSnHKHqMIVc9gjRvVwz4DUm6VLLnKnVYFClM6gofmUI6s9fThiR5EdfimaDTlRlzh6Df33jAbRA9rUTDH6uE-DjiopCvXuHjmQqK9Smyxt2vTao9H7AYIRN7yWmdVoaG0tUSL2XQ31wIW3cEyhz7ihQwFYKJnOkQ3_CiU6KV-4ldk9UY_vKWSgItVTTE6G8Di0iviiCAkmL59Uj7vnIp80-U9rDIK7WhxpAWlrDA6cGQT2LGAXQ2liXtLa31nXyfvCezhtSS8jSVm4SHaiU-INvYtpq2Q7nXPTFbjjZooyC5FePGqAH1T-sRYbR02jaa572_NuwFgBCObTfqO8G5A=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''latest reports AI agent market analysis'':
|
||||
Found 3 relevant articles about the topic including market analysis, competitor
|
||||
data, and industry trends."}}}], "role": "user"}, {"parts": [{"functionCall":
|
||||
{"args": {"url": "https://www.example.com/ai-agent-market-report"}, "name":
|
||||
"read_website"}, "thoughtSignature": "CooPAXLI2nzYy6ki8YJo4RDDzryK6qtkbIEWXCh0ZjpoRX2fgNghUrxXZUwrsrbrwEpccdvWCDpb5ZkwYMNuzMi4yRUsjfcebfd2VCwQgvWnWmitj3taAcLCUDIJX5pGt0L2O8V6ehWmrANQHGw6Qc_QVx5dMlSFeFKHtfc1M95CJz2BxZd3lnuKLCEu7LCCiqIDdd1o1y_EcGsl7OHai6WyQJg49Cvcww__Z-kfSVoAPGNedTYPIf4ImttMyofV8-yczI0IGjhFzE0Qk1Pvo84O9NyOufpPELeKY8l1yfZgSZEL0sUA6weqf1P_xzNKt6h96Rh1KpAx5iTGFtqOWJrJ8OP-ZdGJ-rA-xZQuTRtKbW_e60rC5kPgJnkhWCp1p7HTLgTGwpzzxztqL0ggURaWw8GJw8S41BcM5mFEA-a7ivMWPMLdMk6h5gr_Y8JTnLSRZFoZYHkY9bTcAFPc9gapyFlKkQDciYet_MHe2zfE7ycx0e8c0W7ISoYPHpXW_WxNekMiNdfx1eg_mEX_Y0Vjc70p-HtbnEGaBoZWJSo-cJtZdA4sNJaIuEnnVTtAdAtnoxJUOyr2jrKDAsSjHmVoeLARZO2_DuJKsEVNHzsNPMw4SrBq1DkG52Aof7KcskOfW2OyoZEUnIf23IRabKflUG_7dHGqYfLtkWRApWZYBy2eQILwsmXJ4xx27S7_02Jl0D8rX3vOQhjS7lTjrXvy8wU3biUFvbnqJuLj3ACLn7Hn1axe4dB7zIpYC1di63DDs1fQp79d2VaGRC-tVMKiQu_-yC6nCM4j8JSnpBNgvyhq3ilAr_iDHD6GkbxdBBChFbZl0KY-WkrcZpPp2g2m_beiQuzF-cM6RuaqF2W0TEjVT-OZ1ivObreXFVFWa9T5qFsTjV3E_SFlmrXdx6Kf8d0i9QeEwbzBIvvX3VNUdW1DJ95WylaUXFtljk_cqylri2j2WTPMTSV9fcM_a8UWoayUAuLzq8zgxd2Wvrm8uvGcaewAQT-yK-u5FsLFoKxaMkoakb2_1tjWfhn-MrbIoYOBIebUapUhADUJgGDTG7byEEQlbwNaa8rOZ5ZpdBrDXjtj1tsz6cqaEiCbtZWqei0myuMa0J6Z3FHoceSUgOACD_bHWSkzdW7LdKBKLxB25fKfD1hCLscE1skZ7nAEZWmrUzKz9yCiqAPfatQhHqnr3EchEB_dxbNXxCCT6IFxemhb9AsaQWjcTrlQJiuz8t4VMmu1slgEcrhweZ_PpxI_E74qvV9ljcFLcziW0BZaqepJMeBe2cLfVVki5R5kudQVuAcCEdkrwBDWAwZlO9aWTmiZ9-ggfl3F_63JzZXSM_NDc_2rJ1k65e-O-vyTzkrUwnSPnh4RPK6jeIul4SSLPgyZBwp0qHyTl4As8jpMe9Rbt0NRli6Z5eAr_IYdbicKo_pzqiupdxvu4u-jKt-F4KojU9avgWFAB01isHHO5Z1vzVJ6XDilWeah5DvHc1lkcPCXtbBGvykfFqJIBhthnFi0f_S4HV-IlOKwvKbfmL5GplD7H-DjUA5UdHjw8HoJa6uQxhbERy5dZlYqxN918aL147Afq4LuPoWUJULEsYULwUuA6HspemIKUltHacOAxZgP4OLVkB3zwssj8E6rMtU1puupHiL7J66fFaR3co71gzzlvl8R2Xi3xEQdpigxxCUAsZWMrSrITRBnKPKGF1CrFEhU6FP6bQAQ6UuhAdqLoJihwVnMTyY9fGUriwCkrQu5gK7ZQlnXyluV0J_5xWh4sOaPmwmeiUXMBPN0iGb7z24lyHaI3QXz3kGlJBnIFhseJTJo3ed66Z_LAf8I_hFC6s_sIioEmRgd4tm3Q1U05ETKrptnzo8Ac4AOTdJtbQv0uDQSkoefUbebu7x6L9Dns04VSvDPKLwlFQd81sl9DYmi9SPDxKT7S6gfG6WjJ9z35eNSR01QW1QIgAAhMU8UX4o7QQaXnUZxfZeYRMXlzu_xb4KSREvc_FeLJ-IvnPFgzryAgLi_Sipl__Eul0sjrREPYJE1GxBOIoURGa-Bsmc3yy8aWArxv_HGpbLzwjmH8TaMvB3P_4tkvT-5IjJlpe0UrR1ssqasUtwfH9yWv5-4i-EdJrJ_SJ4Hl1Vlj9zi9lEFr33Zs96kn8ZOkBHp0m7Sxr5xP-krSxQkROIpu0d02kIqQ3nob-kGbnAf0zkmH6pS3H4mG2Zksu8KcGvghx7XTl3qBOJ-ZY4vlev2cSMBfMmnbUHKvMlz4YsmTGR1JPntDguA8UJJ1UZCex4E_W3KcHwd4qvzqgMZNjdarIvGjlmnKmoL1RV7EqUsBkpk-jauY0SqoWsIIf4b6O9Y3fQRRJURLeIfGCTmlxl-df-4yjqUhxUXTaQsX2KlEJ3tZK-ZI9FdKMzqPip2oMFwf2XfLIyIuRA0NU5fDRIxqPUzYv6RQ-zhXXB1QscsAtyf1t-LsaVw__1Vfj6V3Ups4pNyiwMAZg1z9DaIHht--VfgCdqT4RLcaGI8eEDrjkOc9G_iLkLBCfOB7EZkcXT20Lc1Silxa--dZsaYp5Tni8dz6f5YWg=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "read_website", "response":
|
||||
{"result": "Content from https://www.example.com/ai-agent-market-report: This
|
||||
article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}}}], "role": "user"}],
|
||||
"systemInstruction": {"parts": [{"text": "You are Research Analyst. An experienced
|
||||
analyst skilled at gathering information and synthesizing findings into actionable
|
||||
insights.\nYour personal goal is: Conduct thorough research and produce insightful
|
||||
reports"}], "role": "user"}, "tools": [{"functionDeclarations": [{"description":
|
||||
"Search the web for information on a given topic.\n\nArgs:\n query: The search
|
||||
query to look up.\n\nReturns:\n Search results as a string.", "name": "web_search",
|
||||
"parameters_json_schema": {"properties": {"query": {"title": "Query", "type":
|
||||
"string"}}, "required": ["query"], "type": "object", "additionalProperties":
|
||||
false}}, {"description": "Read and extract content from a website URL.\n\nArgs:\n url:
|
||||
The URL of the website to read.\n\nReturns:\n The extracted content from
|
||||
the website.", "name": "read_website", "parameters_json_schema": {"properties":
|
||||
{"url": {"title": "Url", "type": "string"}}, "required": ["url"], "type": "object",
|
||||
"additionalProperties": false}}, {"description": "Generate a structured report
|
||||
based on research findings.\n\nArgs:\n title: The title of the report.\n findings:
|
||||
The research findings to include.\n\nReturns:\n A formatted report string.",
|
||||
"name": "generate_report", "parameters_json_schema": {"properties": {"title":
|
||||
{"title": "Title", "type": "string"}, "findings": {"title": "Findings", "type":
|
||||
"string"}}, "required": ["title", "findings"], "type": "object", "additionalProperties":
|
||||
false}}]}], "generationConfig": {"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '7562'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"functionCall\": {\n \"name\": \"generate_report\",\n
|
||||
\ \"args\": {\n \"findings\": \"The AI agent market
|
||||
is currently valued at $50 billion and is experiencing a strong growth rate
|
||||
of 15% year-over-year. Key players in the industry are contributing to this
|
||||
expansion, driven by increasing adoption across various sectors.\",\n \"title\":
|
||||
\"Current State of the AI Agent Market\"\n }\n },\n
|
||||
\ \"thoughtSignature\": \"CuACAXLI2nzhub94iTgphfrBnaQV13Wv0+kRJj+l9jEDfxsyNg9eGnhxRfj4cued3Mgvv1CR9vkpfDV/V9x57TVWLNwPsVvsTgZKI0pwmV355sUCRKqAyfRBwDWhn0UAl9+sYNFCKUJCp8G5QBGfrar1lYLltX/z83d4O13Wn5Ugvxco9o4CdxnnPJOWkTPETRgXA/1HSdEiwGNqt0A3lKYkGRXQx+XyK54lDwmOBg+Yx4ZVgUxANXLK1z91NF/6cpmSVgoE2sL0VrIHISYs4XdUCj1fL3R7DpnZdrrZhmqnTjEgkeR1C3BR5GJeSUmg+kmqjPSPnP0NYiZo9H9SGL/ewGz3wg+GKcILAa4nD7/tfdqIMbAff8PJemwJE4ONT5zAmJ69/NFj0i1X01v04E8f2NdHewPSsKO5mptk5qzWxoW3G3uUhXccxk62EydTsESf6WRwolsmphaGgVE9AwuhzQ==\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0,\n \"finishMessage\": \"Model generated
|
||||
function call(s).\"\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
557,\n \"candidatesTokenCount\": 73,\n \"totalTokenCount\": 700,\n \"cachedContentTokenCount\":
|
||||
330,\n \"promptTokensDetails\": [\n {\n \"modality\": \"TEXT\",\n
|
||||
\ \"tokenCount\": 557\n }\n ],\n \"cacheTokensDetails\":
|
||||
[\n {\n \"modality\": \"TEXT\",\n \"tokenCount\": 330\n
|
||||
\ }\n ],\n \"thoughtsTokenCount\": 70\n },\n \"modelVersion\":
|
||||
\"gemini-2.5-flash\",\n \"responseId\": \"jkWCacGZMLrv_uMPibCHmQU\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:26 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=1224
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"contents": [{"parts": [{"text": "\nCurrent Task: Research the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}], "role": "user"}, {"parts": [{"functionCall": {"args": {"query":
|
||||
"AI agent market trends 2023-2024"}, "name": "web_search"}, "thoughtSignature":
|
||||
"CoYEAXLI2nzmyDix3_QA-tMOiUwpDVoA5-RJoRW7kw3okJaVYCa5Usx7eBn4xowP7oXNynS4NfawCYqboufBXjHinq13UTcYg0Y74qIrza4KuctliGmf8G7S4QoS0Y3gqCHQKsxTdShQOg8wirnr8Rdu1eyrrhWE0XKk0HPA0Ssj7zUVoJBqHPqwyvkFyXkMtpcmtq9qXmZYfMFuSKRQnYLVLllL_BpOIL3w7MuofpviO85bvYk9gX0vsDjYWS6EdVEfC9k2BWGjhHaILXT9A1iwNPdDAg33SOC-BlPrGox0ghCr5qEKnBMZhUszqaUCykczFCq-xMIA3xDGNbTjicWb53sL_PXBYLsNty1giW3nKFe8-8eRpUsHUx7oQ82m4AUxKqk99mZjaLp8bHk-rERjFZErcw_pe_3190K0WGHH5ecB4amJCzZtVrQJ1oAZhb7_P1VZ57xmt1z_c1pQgjuvnV-cWE9blh5o6mNNFbFuzJDIO2k8qrFeeDwlCF8OOrxo8F-z1evg4yjZ1-9TLCVFTmZ0S0PI54FS5afb0RdPol2_ISNw7H_dtnO4z6LhT2NmlYqYZr8qfVoUD21rmI08NFs-f_6JW5-7eSQbax76SW-6A2IqqPPyF66MCpqtEzC-hpzVsCBcIQyRQWsdm-RNAs50gmqF6W3CcTPryWkeS7w9ORqxdiU="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''AI agent market trends 2023-2024'': Found 3
|
||||
relevant articles about the topic including market analysis, competitor data,
|
||||
and industry trends."}}}], "role": "user"}, {"parts": [{"functionCall": {"args":
|
||||
{"query": "latest reports AI agent market analysis"}, "name": "web_search"},
|
||||
"thoughtSignature": "CpwGAXLI2nybmVGffIN1k-T5M2HmQNlvybZRPoo_ysgNARa-9nrPdRoBZ9RC-Dee9KSk1o7O-IU9l0sWCTirQYcroEhXon-JIQUVTed_L0s__sBOR-hJnZWoaG5ucsfJQvovAQba2Wb7uViEkdySvHfRApF0atewbC-TCKZrxDAQ6Naby8nwUTauJPKlgsBsZVnlViRfIbF7pom1zvXD-d5htjMiuJr1nOuSH0EGQWC4TUiuJD23hgockzhmIpbU_bStn8PFIQNsySEzl6H5sZdlD4auwCMCD2Q-Ur05w1uLv7n8GoSZn5dkdXLR5R7dZ-kkX-xP4w841Ih2gc6rBKT5tSedN01AuJsK65NSfOXZBwakxs58WZXDQXnIQe4d2QThAX3nPdUmhvVI6sHX-ZdtQZIrhE7hRf9j_T_wvvrUao5VDv-mxXd9bcPEV2BzSXkvkAB1SbJ-5wN7Qb2j31lkiUu5uRnZOiVxL5iCS-8Z_jEl4NjpGithbcPoNpFIDOeiE_f8kf7tQJDX-YNquPbYZRJHvIfLalVQndVGNlZVN2jXT3Wwo8So3vmzIDFVjV-pj7tSRNK8hTITm6bfHS-XUZqJdm7eHCzhonyJ7_tl7LbsstPXoZU3ZN50tNpXYOK-NzgzU7iwd9SaHVXgzQRdujWgHuBmSiSd9qNHvdaNwgARVTnMj3VYpehgIuaYMzQmgM99TdC_zmzcqHa5VZSnHKHqMIVc9gjRvVwz4DUm6VLLnKnVYFClM6gofmUI6s9fThiR5EdfimaDTlRlzh6Df33jAbRA9rUTDH6uE-DjiopCvXuHjmQqK9Smyxt2vTao9H7AYIRN7yWmdVoaG0tUSL2XQ31wIW3cEyhz7ihQwFYKJnOkQ3_CiU6KV-4ldk9UY_vKWSgItVTTE6G8Di0iviiCAkmL59Uj7vnIp80-U9rDIK7WhxpAWlrDA6cGQT2LGAXQ2liXtLa31nXyfvCezhtSS8jSVm4SHaiU-INvYtpq2Q7nXPTFbjjZooyC5FePGqAH1T-sRYbR02jaa572_NuwFgBCObTfqO8G5A=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "web_search", "response":
|
||||
{"result": "Search results for ''latest reports AI agent market analysis'':
|
||||
Found 3 relevant articles about the topic including market analysis, competitor
|
||||
data, and industry trends."}}}], "role": "user"}, {"parts": [{"functionCall":
|
||||
{"args": {"url": "https://www.example.com/ai-agent-market-report"}, "name":
|
||||
"read_website"}, "thoughtSignature": "CooPAXLI2nzYy6ki8YJo4RDDzryK6qtkbIEWXCh0ZjpoRX2fgNghUrxXZUwrsrbrwEpccdvWCDpb5ZkwYMNuzMi4yRUsjfcebfd2VCwQgvWnWmitj3taAcLCUDIJX5pGt0L2O8V6ehWmrANQHGw6Qc_QVx5dMlSFeFKHtfc1M95CJz2BxZd3lnuKLCEu7LCCiqIDdd1o1y_EcGsl7OHai6WyQJg49Cvcww__Z-kfSVoAPGNedTYPIf4ImttMyofV8-yczI0IGjhFzE0Qk1Pvo84O9NyOufpPELeKY8l1yfZgSZEL0sUA6weqf1P_xzNKt6h96Rh1KpAx5iTGFtqOWJrJ8OP-ZdGJ-rA-xZQuTRtKbW_e60rC5kPgJnkhWCp1p7HTLgTGwpzzxztqL0ggURaWw8GJw8S41BcM5mFEA-a7ivMWPMLdMk6h5gr_Y8JTnLSRZFoZYHkY9bTcAFPc9gapyFlKkQDciYet_MHe2zfE7ycx0e8c0W7ISoYPHpXW_WxNekMiNdfx1eg_mEX_Y0Vjc70p-HtbnEGaBoZWJSo-cJtZdA4sNJaIuEnnVTtAdAtnoxJUOyr2jrKDAsSjHmVoeLARZO2_DuJKsEVNHzsNPMw4SrBq1DkG52Aof7KcskOfW2OyoZEUnIf23IRabKflUG_7dHGqYfLtkWRApWZYBy2eQILwsmXJ4xx27S7_02Jl0D8rX3vOQhjS7lTjrXvy8wU3biUFvbnqJuLj3ACLn7Hn1axe4dB7zIpYC1di63DDs1fQp79d2VaGRC-tVMKiQu_-yC6nCM4j8JSnpBNgvyhq3ilAr_iDHD6GkbxdBBChFbZl0KY-WkrcZpPp2g2m_beiQuzF-cM6RuaqF2W0TEjVT-OZ1ivObreXFVFWa9T5qFsTjV3E_SFlmrXdx6Kf8d0i9QeEwbzBIvvX3VNUdW1DJ95WylaUXFtljk_cqylri2j2WTPMTSV9fcM_a8UWoayUAuLzq8zgxd2Wvrm8uvGcaewAQT-yK-u5FsLFoKxaMkoakb2_1tjWfhn-MrbIoYOBIebUapUhADUJgGDTG7byEEQlbwNaa8rOZ5ZpdBrDXjtj1tsz6cqaEiCbtZWqei0myuMa0J6Z3FHoceSUgOACD_bHWSkzdW7LdKBKLxB25fKfD1hCLscE1skZ7nAEZWmrUzKz9yCiqAPfatQhHqnr3EchEB_dxbNXxCCT6IFxemhb9AsaQWjcTrlQJiuz8t4VMmu1slgEcrhweZ_PpxI_E74qvV9ljcFLcziW0BZaqepJMeBe2cLfVVki5R5kudQVuAcCEdkrwBDWAwZlO9aWTmiZ9-ggfl3F_63JzZXSM_NDc_2rJ1k65e-O-vyTzkrUwnSPnh4RPK6jeIul4SSLPgyZBwp0qHyTl4As8jpMe9Rbt0NRli6Z5eAr_IYdbicKo_pzqiupdxvu4u-jKt-F4KojU9avgWFAB01isHHO5Z1vzVJ6XDilWeah5DvHc1lkcPCXtbBGvykfFqJIBhthnFi0f_S4HV-IlOKwvKbfmL5GplD7H-DjUA5UdHjw8HoJa6uQxhbERy5dZlYqxN918aL147Afq4LuPoWUJULEsYULwUuA6HspemIKUltHacOAxZgP4OLVkB3zwssj8E6rMtU1puupHiL7J66fFaR3co71gzzlvl8R2Xi3xEQdpigxxCUAsZWMrSrITRBnKPKGF1CrFEhU6FP6bQAQ6UuhAdqLoJihwVnMTyY9fGUriwCkrQu5gK7ZQlnXyluV0J_5xWh4sOaPmwmeiUXMBPN0iGb7z24lyHaI3QXz3kGlJBnIFhseJTJo3ed66Z_LAf8I_hFC6s_sIioEmRgd4tm3Q1U05ETKrptnzo8Ac4AOTdJtbQv0uDQSkoefUbebu7x6L9Dns04VSvDPKLwlFQd81sl9DYmi9SPDxKT7S6gfG6WjJ9z35eNSR01QW1QIgAAhMU8UX4o7QQaXnUZxfZeYRMXlzu_xb4KSREvc_FeLJ-IvnPFgzryAgLi_Sipl__Eul0sjrREPYJE1GxBOIoURGa-Bsmc3yy8aWArxv_HGpbLzwjmH8TaMvB3P_4tkvT-5IjJlpe0UrR1ssqasUtwfH9yWv5-4i-EdJrJ_SJ4Hl1Vlj9zi9lEFr33Zs96kn8ZOkBHp0m7Sxr5xP-krSxQkROIpu0d02kIqQ3nob-kGbnAf0zkmH6pS3H4mG2Zksu8KcGvghx7XTl3qBOJ-ZY4vlev2cSMBfMmnbUHKvMlz4YsmTGR1JPntDguA8UJJ1UZCex4E_W3KcHwd4qvzqgMZNjdarIvGjlmnKmoL1RV7EqUsBkpk-jauY0SqoWsIIf4b6O9Y3fQRRJURLeIfGCTmlxl-df-4yjqUhxUXTaQsX2KlEJ3tZK-ZI9FdKMzqPip2oMFwf2XfLIyIuRA0NU5fDRIxqPUzYv6RQ-zhXXB1QscsAtyf1t-LsaVw__1Vfj6V3Ups4pNyiwMAZg1z9DaIHht--VfgCdqT4RLcaGI8eEDrjkOc9G_iLkLBCfOB7EZkcXT20Lc1Silxa--dZsaYp5Tni8dz6f5YWg=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "read_website", "response":
|
||||
{"result": "Content from https://www.example.com/ai-agent-market-report: This
|
||||
article discusses key insights about the topic including market size ($50B),
|
||||
growth rate (15% YoY), and major players in the industry."}}}], "role": "user"},
|
||||
{"parts": [{"functionCall": {"args": {"findings": "The AI agent market is currently
|
||||
valued at $50 billion and is experiencing a strong growth rate of 15% year-over-year.
|
||||
Key players in the industry are contributing to this expansion, driven by increasing
|
||||
adoption across various sectors.", "title": "Current State of the AI Agent Market"},
|
||||
"name": "generate_report"}, "thoughtSignature": "CuACAXLI2nzhub94iTgphfrBnaQV13Wv0-kRJj-l9jEDfxsyNg9eGnhxRfj4cued3Mgvv1CR9vkpfDV_V9x57TVWLNwPsVvsTgZKI0pwmV355sUCRKqAyfRBwDWhn0UAl9-sYNFCKUJCp8G5QBGfrar1lYLltX_z83d4O13Wn5Ugvxco9o4CdxnnPJOWkTPETRgXA_1HSdEiwGNqt0A3lKYkGRXQx-XyK54lDwmOBg-Yx4ZVgUxANXLK1z91NF_6cpmSVgoE2sL0VrIHISYs4XdUCj1fL3R7DpnZdrrZhmqnTjEgkeR1C3BR5GJeSUmg-kmqjPSPnP0NYiZo9H9SGL_ewGz3wg-GKcILAa4nD7_tfdqIMbAff8PJemwJE4ONT5zAmJ69_NFj0i1X01v04E8f2NdHewPSsKO5mptk5qzWxoW3G3uUhXccxk62EydTsESf6WRwolsmphaGgVE9AwuhzQ=="}],
|
||||
"role": "model"}, {"parts": [{"functionResponse": {"name": "generate_report",
|
||||
"response": {"result": "# Current State of the AI Agent Market\n\n## Executive
|
||||
Summary\nThe AI agent market is currently valued at $50 billion and is experiencing
|
||||
a strong growth rate of 15% year-over-year. Key players in the industry are
|
||||
contributing to this expansion, driven by increasing adoption across various
|
||||
sectors.\n\n## Conclusion\nBased on the analysis, the market shows strong growth
|
||||
potential."}}}], "role": "user"}], "systemInstruction": {"parts": [{"text":
|
||||
"You are Research Analyst. An experienced analyst skilled at gathering information
|
||||
and synthesizing findings into actionable insights.\nYour personal goal is:
|
||||
Conduct thorough research and produce insightful reports"}], "role": "user"},
|
||||
"tools": [{"functionDeclarations": [{"description": "Search the web for information
|
||||
on a given topic.\n\nArgs:\n query: The search query to look up.\n\nReturns:\n Search
|
||||
results as a string.", "name": "web_search", "parameters_json_schema": {"properties":
|
||||
{"query": {"title": "Query", "type": "string"}}, "required": ["query"], "type":
|
||||
"object", "additionalProperties": false}}, {"description": "Read and extract
|
||||
content from a website URL.\n\nArgs:\n url: The URL of the website to read.\n\nReturns:\n The
|
||||
extracted content from the website.", "name": "read_website", "parameters_json_schema":
|
||||
{"properties": {"url": {"title": "Url", "type": "string"}}, "required": ["url"],
|
||||
"type": "object", "additionalProperties": false}}, {"description": "Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.", "name": "generate_report", "parameters_json_schema":
|
||||
{"properties": {"title": {"title": "Title", "type": "string"}, "findings": {"title":
|
||||
"Findings", "type": "string"}}, "required": ["title", "findings"], "type": "object",
|
||||
"additionalProperties": false}}]}], "generationConfig": {"stopSequences": ["\nObservation:"]}}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- '*/*'
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '8941'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- generativelanguage.googleapis.com
|
||||
x-goog-api-client:
|
||||
- google-genai-sdk/1.49.0 gl-python/3.13.3
|
||||
x-goog-api-key:
|
||||
- X-GOOG-API-KEY-XXX
|
||||
method: POST
|
||||
uri: https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"candidates\": [\n {\n \"content\": {\n \"parts\":
|
||||
[\n {\n \"text\": \"The research on the current state
|
||||
of the AI agent market has been completed. A report has been generated with
|
||||
the following key findings:\\n\\n**Current State of the AI Agent Market**\\n\\n**Executive
|
||||
Summary**\\nThe AI agent market is currently valued at $50 billion and is
|
||||
experiencing a strong growth rate of 15% year-over-year. Key players in the
|
||||
industry are contributing to this expansion, driven by increasing adoption
|
||||
across various sectors.\\n\\n**Conclusion**\\nBased on the analysis, the market
|
||||
shows strong growth potential.\",\n \"thoughtSignature\": \"CpIDAXLI2nwVVOjjKtAsnvvRhuJU79oCZksDIi1i7PcIr+FkXVHX8sS8kM0optXLnRQWDRKKxUDKA9C1myhIfnDfc3ef44xc4UaczwM80/TbYanden25qpZRA2kztBz9HiWEPyGjeX8M/8BGAj7mh3q6hwPtTFtmhFTzlw190YQoZLELqOyQzTSECt8roXPdWN1XhU/NbHg4x+H3IFSQ2HZKxbY/JC6tx5FYYh444tIT4798iVHI5HOUVb1pfdLfV45ju/DOD+pTONuqVcTX+jgusjoaH32pdu4Q19atg5BR6zanqwv93vkYPXx0hF4rI8FHtV9jrqwtjLqzXvh7LANtNpCvO3HG++lIoeRTy5RzfYQRkLkrfuLWW+xkGDYQh+CQ7jbeurx344pHBjzZTVDaSNTA0QMTYwDH7YUkxIsyw5Hv1F8tpVvjgoKqvJnar1d/EvrbiOwygpiEZOrmPEn/DKp4qPk2+hhFS4JpcnNGva9cFM22ObwHydIQdoXHOX3wci0nhshAZ0e8hd5u820gfrya\"\n
|
||||
\ }\n ],\n \"role\": \"model\"\n },\n \"finishReason\":
|
||||
\"STOP\",\n \"index\": 0\n }\n ],\n \"usageMetadata\": {\n \"promptTokenCount\":
|
||||
727,\n \"candidatesTokenCount\": 108,\n \"totalTokenCount\": 910,\n
|
||||
\ \"cachedContentTokenCount\": 375,\n \"promptTokensDetails\": [\n {\n
|
||||
\ \"modality\": \"TEXT\",\n \"tokenCount\": 727\n }\n ],\n
|
||||
\ \"cacheTokensDetails\": [\n {\n \"modality\": \"TEXT\",\n
|
||||
\ \"tokenCount\": 375\n }\n ],\n \"thoughtsTokenCount\":
|
||||
75\n },\n \"modelVersion\": \"gemini-2.5-flash\",\n \"responseId\": \"kUWCabvgOafg_uMP06Ga0QI\"\n}\n"
|
||||
headers:
|
||||
Alt-Svc:
|
||||
- h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
|
||||
Content-Type:
|
||||
- application/json; charset=UTF-8
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:30 GMT
|
||||
Server:
|
||||
- scaffolding on HTTPServer2
|
||||
Server-Timing:
|
||||
- gfet4t7; dur=3125
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
Vary:
|
||||
- Origin
|
||||
- X-Origin
|
||||
- Referer
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
X-Frame-Options:
|
||||
- X-FRAME-OPTIONS-XXX
|
||||
X-XSS-Protection:
|
||||
- '0'
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -1,708 +0,0 @@
|
||||
interactions:
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are a strategic planning assistant.
|
||||
Create minimal, effective execution plans. Prefer fewer steps over more."},{"role":"user","content":"Create
|
||||
a focused execution plan for the following task:\n\n## Task\nResearch the current
|
||||
state of the AI agent market:\n1. Search for recent information about AI agents
|
||||
and their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step.\n\n## Expected Output\nComplete the task successfully\n\n## Available
|
||||
Tools\nweb_search, read_website, generate_report\n\n## Instructions\nCreate
|
||||
ONLY the essential steps needed to complete this task. Use the MINIMUM number
|
||||
of steps required - do NOT pad your plan with unnecessary steps. Most tasks
|
||||
need only 2-5 steps.\n\nFor each step:\n- State the specific action to take\n-
|
||||
Specify which tool to use (if any)\n- Note dependencies on previous steps if
|
||||
this step requires their output\n- If a step involves multiple items (e.g.,
|
||||
research 3 competitors), note this explicitly\n\nDo NOT include:\n- Setup or
|
||||
preparation steps that are obvious\n- Verification steps unless critical\n-
|
||||
Documentation or cleanup steps unless explicitly required\n- Generic steps like
|
||||
\"review results\" or \"finalize output\"\n\nAfter your plan, state:\n- \"READY:
|
||||
I am ready to execute the task.\" if the plan is complete\n- \"NOT READY: I
|
||||
need to refine my plan because [reason].\" if you need more thinking"}],"model":"gpt-4o","tool_choice":"auto","tools":[{"type":"function","function":{"name":"create_reasoning_plan","description":"Create
|
||||
or refine a reasoning plan for a task with structured steps","strict":true,"parameters":{"type":"object","properties":{"plan":{"type":"string","description":"A
|
||||
brief summary of the overall plan."},"steps":{"type":"array","description":"List
|
||||
of discrete steps to execute the plan","items":{"type":"object","properties":{"step_number":{"type":"integer","description":"Step
|
||||
number (1-based)"},"description":{"type":"string","description":"What to do
|
||||
in this step"},"tool_to_use":{"type":["string","null"],"description":"Tool to
|
||||
use for this step, or null if no tool needed"},"depends_on":{"type":"array","items":{"type":"integer"},"description":"Step
|
||||
numbers this step depends on (empty array if none)"}},"required":["step_number","description","tool_to_use","depends_on"],"additionalProperties":false}},"ready":{"type":"boolean","description":"Whether
|
||||
the agent is ready to execute the task."}},"required":["plan","steps","ready"],"additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '2619'
|
||||
content-type:
|
||||
- application/json
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5Fu3HzCCoZJXtY9WqBmBv4QA4PS8\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770145143,\n \"model\": \"gpt-4o-2024-08-06\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_bVEiQHpiVX9FEfuWVwTe8XGj\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"create_reasoning_plan\",\n
|
||||
\ \"arguments\": \"{\\\"plan\\\":\\\"Research the current state
|
||||
of the AI agent market by gathering recent market trend data, reading in-depth
|
||||
content from a reliable industry source, and generating a concise report.\\\",\\\"steps\\\":[{\\\"step_number\\\":1,\\\"description\\\":\\\"Search
|
||||
for recent information about AI agents and their market trends.\\\",\\\"tool_to_use\\\":\\\"web_search\\\",\\\"depends_on\\\":[]},{\\\"step_number\\\":2,\\\"description\\\":\\\"Read
|
||||
detailed content from a relevant industry source found during the search.\\\",\\\"tool_to_use\\\":\\\"read_website\\\",\\\"depends_on\\\":[1]},{\\\"step_number\\\":3,\\\"description\\\":\\\"Generate
|
||||
a brief report summarizing the key findings from the gathered information.\\\",\\\"tool_to_use\\\":\\\"generate_report\\\",\\\"depends_on\\\":[1,2]}],\\\"ready\\\":true}\"\n
|
||||
\ }\n }\n ],\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 480,\n \"completion_tokens\":
|
||||
153,\n \"total_tokens\": 633,\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_fa7f5b168b\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:05 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Set-Cookie:
|
||||
- SET-COOKIE-XXX
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '2629'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Research Analyst. An experienced
|
||||
analyst skilled at gathering information and synthesizing findings into actionable
|
||||
insights.\nYour personal goal is: Conduct thorough research and produce insightful
|
||||
reports"},{"role":"user","content":"\nCurrent Task: Research the current state
|
||||
of the AI agent market:\n1. Search for recent information about AI agents and
|
||||
their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."}],"model":"gpt-4o","tool_choice":"auto","tools":[{"type":"function","function":{"name":"web_search","description":"Search
|
||||
the web for information on a given topic.\n\nArgs:\n query: The search query
|
||||
to look up.\n\nReturns:\n Search results as a string.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"read_website","description":"Read
|
||||
and extract content from a website URL.\n\nArgs:\n url: The URL of the website
|
||||
to read.\n\nReturns:\n The extracted content from the website.","strict":true,"parameters":{"properties":{"url":{"title":"Url","type":"string"}},"required":["url"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"generate_report","description":"Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.","strict":true,"parameters":{"properties":{"title":{"title":"Title","type":"string"},"findings":{"title":"Findings","type":"string"}},"required":["title","findings"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '1849'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5Fu6H5Oz7CA6xtmPwoBDIAr59nyJ\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770145146,\n \"model\": \"gpt-4o-2024-08-06\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_QlnPEA94TbaFA83eRDhOHXRY\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"web_search\",\n
|
||||
\ \"arguments\": \"{\\\"query\\\":\\\"current state of AI agent
|
||||
market 2023\\\"}\"\n }\n }\n ],\n \"refusal\":
|
||||
null,\n \"annotations\": []\n },\n \"logprobs\": null,\n
|
||||
\ \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\":
|
||||
267,\n \"completion_tokens\": 22,\n \"total_tokens\": 289,\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_fa7f5b168b\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:07 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '752'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Research Analyst. An experienced
|
||||
analyst skilled at gathering information and synthesizing findings into actionable
|
||||
insights.\nYour personal goal is: Conduct thorough research and produce insightful
|
||||
reports"},{"role":"user","content":"\nCurrent Task: Research the current state
|
||||
of the AI agent market:\n1. Search for recent information about AI agents and
|
||||
their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_QlnPEA94TbaFA83eRDhOHXRY","type":"function","function":{"name":"web_search","arguments":"{\"query\":\"current
|
||||
state of AI agent market 2023\"}"}}]},{"role":"tool","tool_call_id":"call_QlnPEA94TbaFA83eRDhOHXRY","name":"web_search","content":"Search
|
||||
results for ''current state of AI agent market 2023'': Found 3 relevant articles
|
||||
about the topic including market analysis, competitor data, and industry trends."}],"model":"gpt-4o","tool_choice":"auto","tools":[{"type":"function","function":{"name":"web_search","description":"Search
|
||||
the web for information on a given topic.\n\nArgs:\n query: The search query
|
||||
to look up.\n\nReturns:\n Search results as a string.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"read_website","description":"Read
|
||||
and extract content from a website URL.\n\nArgs:\n url: The URL of the website
|
||||
to read.\n\nReturns:\n The extracted content from the website.","strict":true,"parameters":{"properties":{"url":{"title":"Url","type":"string"}},"required":["url"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"generate_report","description":"Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.","strict":true,"parameters":{"properties":{"title":{"title":"Title","type":"string"},"findings":{"title":"Findings","type":"string"}},"required":["title","findings"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '2320'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5Fu7QFl2h9pGJ0uhX6g4Fi4MMzMX\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770145147,\n \"model\": \"gpt-4o-2024-08-06\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_sOaxpAdq5dvpRhUJMAct2oNP\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"read_website\",\n
|
||||
\ \"arguments\": \"{\\\"url\\\": \\\"https://www.example.com/ai-agent-market-analysis-2023\\\"}\"\n
|
||||
\ }\n },\n {\n \"id\": \"call_1GRSbggp4SYHg5WqAUQx5Dce\",\n
|
||||
\ \"type\": \"function\",\n \"function\": {\n \"name\":
|
||||
\"read_website\",\n \"arguments\": \"{\\\"url\\\": \\\"https://www.example.com/ai-agent-competitor-data-2023\\\"}\"\n
|
||||
\ }\n },\n {\n \"id\": \"call_43s9ebATowN3hA5piPjL2z5N\",\n
|
||||
\ \"type\": \"function\",\n \"function\": {\n \"name\":
|
||||
\"read_website\",\n \"arguments\": \"{\\\"url\\\": \\\"https://www.example.com/ai-agent-industry-trends-2023\\\"}\"\n
|
||||
\ }\n }\n ],\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 330,\n \"completion_tokens\":
|
||||
101,\n \"total_tokens\": 431,\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_fa7f5b168b\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:09 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '1885'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Research Analyst. An experienced
|
||||
analyst skilled at gathering information and synthesizing findings into actionable
|
||||
insights.\nYour personal goal is: Conduct thorough research and produce insightful
|
||||
reports"},{"role":"user","content":"\nCurrent Task: Research the current state
|
||||
of the AI agent market:\n1. Search for recent information about AI agents and
|
||||
their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_QlnPEA94TbaFA83eRDhOHXRY","type":"function","function":{"name":"web_search","arguments":"{\"query\":\"current
|
||||
state of AI agent market 2023\"}"}}]},{"role":"tool","tool_call_id":"call_QlnPEA94TbaFA83eRDhOHXRY","name":"web_search","content":"Search
|
||||
results for ''current state of AI agent market 2023'': Found 3 relevant articles
|
||||
about the topic including market analysis, competitor data, and industry trends."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_sOaxpAdq5dvpRhUJMAct2oNP","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-market-analysis-2023\"}"}},{"id":"call_1GRSbggp4SYHg5WqAUQx5Dce","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-competitor-data-2023\"}"}},{"id":"call_43s9ebATowN3hA5piPjL2z5N","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-industry-trends-2023\"}"}}]},{"role":"tool","tool_call_id":"call_sOaxpAdq5dvpRhUJMAct2oNP","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-market-analysis-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."},{"role":"tool","tool_call_id":"call_1GRSbggp4SYHg5WqAUQx5Dce","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-competitor-data-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."},{"role":"tool","tool_call_id":"call_43s9ebATowN3hA5piPjL2z5N","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-industry-trends-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."}],"model":"gpt-4o","tool_choice":"auto","tools":[{"type":"function","function":{"name":"web_search","description":"Search
|
||||
the web for information on a given topic.\n\nArgs:\n query: The search query
|
||||
to look up.\n\nReturns:\n Search results as a string.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"read_website","description":"Read
|
||||
and extract content from a website URL.\n\nArgs:\n url: The URL of the website
|
||||
to read.\n\nReturns:\n The extracted content from the website.","strict":true,"parameters":{"properties":{"url":{"title":"Url","type":"string"}},"required":["url"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"generate_report","description":"Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.","strict":true,"parameters":{"properties":{"title":{"title":"Title","type":"string"},"findings":{"title":"Findings","type":"string"}},"required":["title","findings"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '3811'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5Fu95gX9R1zxpiJUa1wSOzIGA9CL\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770145149,\n \"model\": \"gpt-4o-2024-08-06\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n
|
||||
\ \"id\": \"call_QjEKbvT6OnKkCOTvwTu0TmAK\",\n \"type\":
|
||||
\"function\",\n \"function\": {\n \"name\": \"generate_report\",\n
|
||||
\ \"arguments\": \"{\\\"title\\\":\\\"Current State of the AI
|
||||
Agent Market 2023\\\",\\\"findings\\\":\\\"1. Market Size: The AI agent market
|
||||
is currently valued at $50 billion.\\\\n2. Growth Rate: The industry is experiencing
|
||||
a growth rate of 15% year-over-year.\\\\n3. Major Players: Significant companies
|
||||
in this space include tech giants and specialized AI startups.\\\\n4. Market
|
||||
Trends: The demand for AI agents is being driven by improvements in machine
|
||||
learning algorithms and increasing adoption in customer service and automation
|
||||
processes.\\\\n5. Competitive Landscape: The market is competitive with ongoing
|
||||
innovation and investment in developing more advanced AI capabilities.\\\\n6.
|
||||
Future Prospects: Continued growth is expected as businesses further integrate
|
||||
AI agents into their operations for efficiency gains and customer engagement.\\\"}\"\n
|
||||
\ }\n }\n ],\n \"refusal\": null,\n \"annotations\":
|
||||
[]\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n
|
||||
\ }\n ],\n \"usage\": {\n \"prompt_tokens\": 587,\n \"completion_tokens\":
|
||||
163,\n \"total_tokens\": 750,\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_fa7f5b168b\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:12 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3444'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
- request:
|
||||
body: '{"messages":[{"role":"system","content":"You are Research Analyst. An experienced
|
||||
analyst skilled at gathering information and synthesizing findings into actionable
|
||||
insights.\nYour personal goal is: Conduct thorough research and produce insightful
|
||||
reports"},{"role":"user","content":"\nCurrent Task: Research the current state
|
||||
of the AI agent market:\n1. Search for recent information about AI agents and
|
||||
their market trends\n2. Read detailed content from a relevant industry source\n3.
|
||||
Generate a brief report summarizing the key findings\n\nUse the available tools
|
||||
for each step."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_QlnPEA94TbaFA83eRDhOHXRY","type":"function","function":{"name":"web_search","arguments":"{\"query\":\"current
|
||||
state of AI agent market 2023\"}"}}]},{"role":"tool","tool_call_id":"call_QlnPEA94TbaFA83eRDhOHXRY","name":"web_search","content":"Search
|
||||
results for ''current state of AI agent market 2023'': Found 3 relevant articles
|
||||
about the topic including market analysis, competitor data, and industry trends."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_sOaxpAdq5dvpRhUJMAct2oNP","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-market-analysis-2023\"}"}},{"id":"call_1GRSbggp4SYHg5WqAUQx5Dce","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-competitor-data-2023\"}"}},{"id":"call_43s9ebATowN3hA5piPjL2z5N","type":"function","function":{"name":"read_website","arguments":"{\"url\":
|
||||
\"https://www.example.com/ai-agent-industry-trends-2023\"}"}}]},{"role":"tool","tool_call_id":"call_sOaxpAdq5dvpRhUJMAct2oNP","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-market-analysis-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."},{"role":"tool","tool_call_id":"call_1GRSbggp4SYHg5WqAUQx5Dce","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-competitor-data-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."},{"role":"tool","tool_call_id":"call_43s9ebATowN3hA5piPjL2z5N","name":"read_website","content":"Content
|
||||
from https://www.example.com/ai-agent-industry-trends-2023: This article discusses
|
||||
key insights about the topic including market size ($50B), growth rate (15%
|
||||
YoY), and major players in the industry."},{"role":"assistant","content":null,"tool_calls":[{"id":"call_QjEKbvT6OnKkCOTvwTu0TmAK","type":"function","function":{"name":"generate_report","arguments":"{\"title\":\"Current
|
||||
State of the AI Agent Market 2023\",\"findings\":\"1. Market Size: The AI agent
|
||||
market is currently valued at $50 billion.\\n2. Growth Rate: The industry is
|
||||
experiencing a growth rate of 15% year-over-year.\\n3. Major Players: Significant
|
||||
companies in this space include tech giants and specialized AI startups.\\n4.
|
||||
Market Trends: The demand for AI agents is being driven by improvements in machine
|
||||
learning algorithms and increasing adoption in customer service and automation
|
||||
processes.\\n5. Competitive Landscape: The market is competitive with ongoing
|
||||
innovation and investment in developing more advanced AI capabilities.\\n6.
|
||||
Future Prospects: Continued growth is expected as businesses further integrate
|
||||
AI agents into their operations for efficiency gains and customer engagement.\"}"}}]},{"role":"tool","tool_call_id":"call_QjEKbvT6OnKkCOTvwTu0TmAK","name":"generate_report","content":"#
|
||||
Current State of the AI Agent Market 2023\n\n## Executive Summary\n1. Market
|
||||
Size: The AI agent market is currently valued at $50 billion.\n2. Growth Rate:
|
||||
The industry is experiencing a growth rate of 15% year-over-year.\n3. Major
|
||||
Players: Significant companies in this space include tech giants and specialized
|
||||
AI startups.\n4. Market Trends: The demand for AI agents is being driven by
|
||||
improvements in machine learning algorithms and increasing adoption in customer
|
||||
service and automation processes.\n5. Competitive Landscape: The market is competitive
|
||||
with ongoing innovation and investment in developing more advanced AI capabilities.\n6.
|
||||
Future Prospects: Continued growth is expected as businesses further integrate
|
||||
AI agents into their operations for efficiency gains and customer engagement.\n\n##
|
||||
Conclusion\nBased on the analysis, the market shows strong growth potential."}],"model":"gpt-4o","tool_choice":"auto","tools":[{"type":"function","function":{"name":"web_search","description":"Search
|
||||
the web for information on a given topic.\n\nArgs:\n query: The search query
|
||||
to look up.\n\nReturns:\n Search results as a string.","strict":true,"parameters":{"properties":{"query":{"title":"Query","type":"string"}},"required":["query"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"read_website","description":"Read
|
||||
and extract content from a website URL.\n\nArgs:\n url: The URL of the website
|
||||
to read.\n\nReturns:\n The extracted content from the website.","strict":true,"parameters":{"properties":{"url":{"title":"Url","type":"string"}},"required":["url"],"type":"object","additionalProperties":false}}},{"type":"function","function":{"name":"generate_report","description":"Generate
|
||||
a structured report based on research findings.\n\nArgs:\n title: The title
|
||||
of the report.\n findings: The research findings to include.\n\nReturns:\n A
|
||||
formatted report string.","strict":true,"parameters":{"properties":{"title":{"title":"Title","type":"string"},"findings":{"title":"Findings","type":"string"}},"required":["title","findings"],"type":"object","additionalProperties":false}}}]}'
|
||||
headers:
|
||||
User-Agent:
|
||||
- X-USER-AGENT-XXX
|
||||
accept:
|
||||
- application/json
|
||||
accept-encoding:
|
||||
- ACCEPT-ENCODING-XXX
|
||||
authorization:
|
||||
- AUTHORIZATION-XXX
|
||||
connection:
|
||||
- keep-alive
|
||||
content-length:
|
||||
- '5771'
|
||||
content-type:
|
||||
- application/json
|
||||
cookie:
|
||||
- COOKIE-XXX
|
||||
host:
|
||||
- api.openai.com
|
||||
x-stainless-arch:
|
||||
- X-STAINLESS-ARCH-XXX
|
||||
x-stainless-async:
|
||||
- 'false'
|
||||
x-stainless-lang:
|
||||
- python
|
||||
x-stainless-os:
|
||||
- X-STAINLESS-OS-XXX
|
||||
x-stainless-package-version:
|
||||
- 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.13.3
|
||||
method: POST
|
||||
uri: https://api.openai.com/v1/chat/completions
|
||||
response:
|
||||
body:
|
||||
string: "{\n \"id\": \"chatcmpl-D5FuCTJhAII96iBV05ECT71cV6QmJ\",\n \"object\":
|
||||
\"chat.completion\",\n \"created\": 1770145152,\n \"model\": \"gpt-4o-2024-08-06\",\n
|
||||
\ \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\":
|
||||
\"assistant\",\n \"content\": \"The research on the current state of
|
||||
the AI agent market indicates a robust and rapidly growing industry. Here\u2019s
|
||||
a summary of the findings:\\n\\n1. **Market Size**: The AI agent market is
|
||||
currently valued at $50 billion.\\n2. **Growth Rate**: It is experiencing
|
||||
a significant growth rate of 15% year-over-year.\\n3. **Major Players**: The
|
||||
market is dominated by tech giants and specialized AI startups.\\n4. **Market
|
||||
Trends**: The increasing adoption of machine learning algorithms and the integration
|
||||
of AI in customer service and automation are key drivers.\\n5. **Competitive
|
||||
Landscape**: There is substantial competition and continuous innovation in
|
||||
AI capabilities.\\n6. **Future Prospects**: The sector is expected to keep
|
||||
growing as businesses increasingly use AI agents for efficiency and improved
|
||||
customer engagement.\\n\\nThis analysis highlights significant opportunities
|
||||
in the AI agent sector, underlining its importance in future technological
|
||||
advancements.\",\n \"refusal\": null,\n \"annotations\": []\n
|
||||
\ },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n
|
||||
\ ],\n \"usage\": {\n \"prompt_tokens\": 920,\n \"completion_tokens\":
|
||||
182,\n \"total_tokens\": 1102,\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_fa7f5b168b\"\n}\n"
|
||||
headers:
|
||||
CF-RAY:
|
||||
- CF-RAY-XXX
|
||||
Connection:
|
||||
- keep-alive
|
||||
Content-Type:
|
||||
- application/json
|
||||
Date:
|
||||
- Tue, 03 Feb 2026 18:59:16 GMT
|
||||
Server:
|
||||
- cloudflare
|
||||
Strict-Transport-Security:
|
||||
- STS-XXX
|
||||
Transfer-Encoding:
|
||||
- chunked
|
||||
X-Content-Type-Options:
|
||||
- X-CONTENT-TYPE-XXX
|
||||
access-control-expose-headers:
|
||||
- ACCESS-CONTROL-XXX
|
||||
alt-svc:
|
||||
- h3=":443"; ma=86400
|
||||
cf-cache-status:
|
||||
- DYNAMIC
|
||||
openai-organization:
|
||||
- OPENAI-ORG-XXX
|
||||
openai-processing-ms:
|
||||
- '3456'
|
||||
openai-project:
|
||||
- OPENAI-PROJECT-XXX
|
||||
openai-version:
|
||||
- '2020-10-01'
|
||||
x-openai-proxy-wasm:
|
||||
- v0.1
|
||||
x-ratelimit-limit-requests:
|
||||
- X-RATELIMIT-LIMIT-REQUESTS-XXX
|
||||
x-ratelimit-limit-tokens:
|
||||
- X-RATELIMIT-LIMIT-TOKENS-XXX
|
||||
x-ratelimit-remaining-requests:
|
||||
- X-RATELIMIT-REMAINING-REQUESTS-XXX
|
||||
x-ratelimit-remaining-tokens:
|
||||
- X-RATELIMIT-REMAINING-TOKENS-XXX
|
||||
x-ratelimit-reset-requests:
|
||||
- X-RATELIMIT-RESET-REQUESTS-XXX
|
||||
x-ratelimit-reset-tokens:
|
||||
- X-RATELIMIT-RESET-TOKENS-XXX
|
||||
x-request-id:
|
||||
- X-REQUEST-ID-XXX
|
||||
status:
|
||||
code: 200
|
||||
message: OK
|
||||
version: 1
|
||||
@@ -437,17 +437,36 @@ def test_bedrock_aws_credentials_configuration():
|
||||
"""
|
||||
Test that AWS credentials configuration works properly
|
||||
"""
|
||||
aws_access_key_id = "test-access-key"
|
||||
aws_secret_access_key = "test-secret-key"
|
||||
aws_region_name = "us-east-1"
|
||||
|
||||
|
||||
# Test with environment variables
|
||||
with patch.dict(os.environ, {
|
||||
"AWS_ACCESS_KEY_ID": "test-access-key",
|
||||
"AWS_SECRET_ACCESS_KEY": "test-secret-key",
|
||||
"AWS_DEFAULT_REGION": "us-east-1"
|
||||
"AWS_ACCESS_KEY_ID": aws_access_key_id,
|
||||
"AWS_SECRET_ACCESS_KEY": aws_secret_access_key,
|
||||
"AWS_DEFAULT_REGION": aws_region_name
|
||||
}):
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0")
|
||||
|
||||
from crewai.llms.providers.bedrock.completion import BedrockCompletion
|
||||
assert isinstance(llm, BedrockCompletion)
|
||||
assert llm.region_name == "us-east-1"
|
||||
assert llm.region_name == aws_region_name
|
||||
assert llm.aws_access_key_id == aws_access_key_id
|
||||
assert llm.aws_secret_access_key == aws_secret_access_key
|
||||
|
||||
# Test with litellm environment variables
|
||||
with patch.dict(os.environ, {
|
||||
"AWS_ACCESS_KEY_ID": aws_access_key_id,
|
||||
"AWS_SECRET_ACCESS_KEY": aws_secret_access_key,
|
||||
"AWS_REGION_NAME": aws_region_name
|
||||
}):
|
||||
llm = LLM(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0")
|
||||
|
||||
from crewai.llms.providers.bedrock.completion import BedrockCompletion
|
||||
assert isinstance(llm, BedrockCompletion)
|
||||
assert llm.region_name == aws_region_name
|
||||
|
||||
# Test with explicit credentials
|
||||
llm_explicit = LLM(
|
||||
|
||||
@@ -3,6 +3,8 @@ from typing import Callable
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from crewai.agent import Agent
|
||||
from crewai.crew import Crew
|
||||
from crewai.task import Task
|
||||
@@ -230,3 +232,204 @@ def test_max_usage_count_is_respected():
|
||||
crew.kickoff()
|
||||
assert tool.max_usage_count == 5
|
||||
assert tool.current_usage_count == 5
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Schema Validation in run() Tests
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class CodeExecutorInput(BaseModel):
|
||||
code: str = Field(description="The code to execute")
|
||||
language: str = Field(default="python", description="Programming language")
|
||||
|
||||
|
||||
class CodeExecutorTool(BaseTool):
|
||||
name: str = "code_executor"
|
||||
description: str = "Execute code snippets"
|
||||
args_schema: type[BaseModel] = CodeExecutorInput
|
||||
|
||||
def _run(self, code: str, language: str = "python") -> str:
|
||||
return f"Executed {language}: {code}"
|
||||
|
||||
|
||||
class TestBaseToolRunValidation:
|
||||
"""Tests for args_schema validation in BaseTool.run()."""
|
||||
|
||||
def test_run_with_valid_kwargs_passes_validation(self) -> None:
|
||||
"""Valid keyword arguments should pass schema validation and execute."""
|
||||
t = CodeExecutorTool()
|
||||
result = t.run(code="print('hello')")
|
||||
assert result == "Executed python: print('hello')"
|
||||
|
||||
def test_run_with_all_kwargs_passes_validation(self) -> None:
|
||||
"""All keyword arguments including optional ones should pass."""
|
||||
t = CodeExecutorTool()
|
||||
result = t.run(code="console.log('hi')", language="javascript")
|
||||
assert result == "Executed javascript: console.log('hi')"
|
||||
|
||||
def test_run_with_missing_required_kwarg_raises(self) -> None:
|
||||
"""Missing required kwargs should raise ValueError from schema validation."""
|
||||
t = CodeExecutorTool()
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
t.run(language="python")
|
||||
|
||||
def test_run_with_wrong_field_name_raises(self) -> None:
|
||||
"""Kwargs not matching any schema field should trigger validation error
|
||||
for missing required fields."""
|
||||
t = CodeExecutorTool()
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
t.run(wrong_arg="value")
|
||||
|
||||
def test_run_with_positional_args_skips_validation(self) -> None:
|
||||
"""Positional-arg calls should bypass schema validation (backwards compat)."""
|
||||
class SimpleTool(BaseTool):
|
||||
name: str = "simple"
|
||||
description: str = "A simple tool"
|
||||
|
||||
def _run(self, question: str) -> str:
|
||||
return question
|
||||
|
||||
t = SimpleTool()
|
||||
result = t.run("What is life?")
|
||||
assert result == "What is life?"
|
||||
|
||||
def test_run_strips_extra_kwargs_from_llm(self) -> None:
|
||||
"""Extra kwargs not in the schema should be silently stripped,
|
||||
preventing unexpected-keyword crashes in _run."""
|
||||
t = CodeExecutorTool()
|
||||
result = t.run(code="1+1", extra_hallucinated_field="junk")
|
||||
assert result == "Executed python: 1+1"
|
||||
|
||||
def test_run_increments_usage_after_validation(self) -> None:
|
||||
"""Usage count should still increment after validated execution."""
|
||||
t = CodeExecutorTool()
|
||||
assert t.current_usage_count == 0
|
||||
t.run(code="x = 1")
|
||||
assert t.current_usage_count == 1
|
||||
|
||||
def test_run_does_not_increment_usage_on_validation_error(self) -> None:
|
||||
"""Usage count should NOT increment when validation fails."""
|
||||
t = CodeExecutorTool()
|
||||
assert t.current_usage_count == 0
|
||||
with pytest.raises(ValueError):
|
||||
t.run(wrong="bad")
|
||||
assert t.current_usage_count == 0
|
||||
|
||||
|
||||
class TestToolDecoratorRunValidation:
|
||||
"""Tests for args_schema validation in Tool.run() (decorator-based tools)."""
|
||||
|
||||
def test_decorator_tool_run_validates_kwargs(self) -> None:
|
||||
"""Decorator-created tools should also validate kwargs against schema."""
|
||||
@tool("execute_code")
|
||||
def execute_code(code: str, language: str = "python") -> str:
|
||||
"""Execute a code snippet."""
|
||||
return f"Executed {language}: {code}"
|
||||
|
||||
result = execute_code.run(code="x = 1")
|
||||
assert result == "Executed python: x = 1"
|
||||
|
||||
def test_decorator_tool_run_rejects_missing_required(self) -> None:
|
||||
"""Decorator tools should reject missing required args via validation."""
|
||||
@tool("execute_code")
|
||||
def execute_code(code: str) -> str:
|
||||
"""Execute a code snippet."""
|
||||
return f"Executed: {code}"
|
||||
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
execute_code.run(wrong_arg="value")
|
||||
|
||||
def test_decorator_tool_positional_args_still_work(self) -> None:
|
||||
"""Positional args to decorator tools should bypass validation."""
|
||||
@tool("greet")
|
||||
def greet(name: str) -> str:
|
||||
"""Greet someone."""
|
||||
return f"Hello, {name}!"
|
||||
|
||||
result = greet.run("World")
|
||||
assert result == "Hello, World!"
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Async arun() Schema Validation Tests
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class AsyncCodeExecutorTool(BaseTool):
|
||||
name: str = "async_code_executor"
|
||||
description: str = "Execute code snippets asynchronously"
|
||||
args_schema: type[BaseModel] = CodeExecutorInput
|
||||
|
||||
async def _arun(self, code: str, language: str = "python") -> str:
|
||||
return f"Async executed {language}: {code}"
|
||||
|
||||
def _run(self, code: str, language: str = "python") -> str:
|
||||
return f"Executed {language}: {code}"
|
||||
|
||||
|
||||
class TestBaseToolArunValidation:
|
||||
"""Tests for args_schema validation in BaseTool.arun()."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_arun_with_valid_kwargs_passes_validation(self) -> None:
|
||||
"""Valid keyword arguments should pass schema validation in arun."""
|
||||
t = AsyncCodeExecutorTool()
|
||||
result = await t.arun(code="print('hello')")
|
||||
assert result == "Async executed python: print('hello')"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_arun_with_missing_required_kwarg_raises(self) -> None:
|
||||
"""Missing required kwargs should raise ValueError in arun."""
|
||||
t = AsyncCodeExecutorTool()
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
await t.arun(language="python")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_arun_with_wrong_field_name_raises(self) -> None:
|
||||
"""Kwargs not matching schema fields should trigger validation error in arun."""
|
||||
t = AsyncCodeExecutorTool()
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
await t.arun(wrong_arg="value")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_arun_strips_extra_kwargs(self) -> None:
|
||||
"""Extra kwargs not in the schema should be stripped in arun."""
|
||||
t = AsyncCodeExecutorTool()
|
||||
result = await t.arun(code="1+1", extra_field="junk")
|
||||
assert result == "Async executed python: 1+1"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_arun_does_not_increment_usage_on_validation_error(self) -> None:
|
||||
"""Usage count should NOT increment when arun validation fails."""
|
||||
t = AsyncCodeExecutorTool()
|
||||
assert t.current_usage_count == 0
|
||||
with pytest.raises(ValueError):
|
||||
await t.arun(wrong="bad")
|
||||
assert t.current_usage_count == 0
|
||||
|
||||
|
||||
class TestToolDecoratorArunValidation:
|
||||
"""Tests for args_schema validation in Tool.arun() (decorator-based async tools)."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_decorator_tool_arun_validates_kwargs(self) -> None:
|
||||
"""Async decorator tools should validate kwargs in arun."""
|
||||
@tool("async_execute")
|
||||
async def async_execute(code: str, language: str = "python") -> str:
|
||||
"""Execute code asynchronously."""
|
||||
return f"Async {language}: {code}"
|
||||
|
||||
result = await async_execute.arun(code="x = 1")
|
||||
assert result == "Async python: x = 1"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_async_decorator_tool_arun_rejects_missing_required(self) -> None:
|
||||
"""Async decorator tools should reject missing required args in arun."""
|
||||
@tool("async_execute")
|
||||
async def async_execute(code: str) -> str:
|
||||
"""Execute code asynchronously."""
|
||||
return f"Async: {code}"
|
||||
|
||||
with pytest.raises(ValueError, match="validation failed"):
|
||||
await async_execute.arun(wrong_arg="value")
|
||||
|
||||
@@ -17,6 +17,7 @@ from crewai.utilities.agent_utils import (
|
||||
_format_messages_for_summary,
|
||||
_split_messages_into_chunks,
|
||||
convert_tools_to_openai_schema,
|
||||
parse_tool_call_args,
|
||||
summarize_messages,
|
||||
)
|
||||
|
||||
@@ -922,3 +923,56 @@ class TestParallelSummarizationVCR:
|
||||
assert summary_msg["role"] == "user"
|
||||
assert "files" in summary_msg
|
||||
assert "report.pdf" in summary_msg["files"]
|
||||
|
||||
|
||||
class TestParseToolCallArgs:
|
||||
"""Unit tests for parse_tool_call_args."""
|
||||
|
||||
def test_valid_json_string_returns_dict(self) -> None:
|
||||
args_dict, error = parse_tool_call_args('{"code": "print(1)"}', "run_code", "call_1")
|
||||
assert error is None
|
||||
assert args_dict == {"code": "print(1)"}
|
||||
|
||||
def test_malformed_json_returns_error_dict(self) -> None:
|
||||
args_dict, error = parse_tool_call_args('{"code": "print("hi")"}', "run_code", "call_1")
|
||||
assert args_dict is None
|
||||
assert error is not None
|
||||
assert error["call_id"] == "call_1"
|
||||
assert error["func_name"] == "run_code"
|
||||
assert error["from_cache"] is False
|
||||
assert "Failed to parse tool arguments as JSON" in error["result"]
|
||||
assert "run_code" in error["result"]
|
||||
|
||||
def test_malformed_json_preserves_original_tool(self) -> None:
|
||||
mock_tool = object()
|
||||
_, error = parse_tool_call_args("{bad}", "my_tool", "call_2", original_tool=mock_tool)
|
||||
assert error is not None
|
||||
assert error["original_tool"] is mock_tool
|
||||
|
||||
def test_malformed_json_original_tool_defaults_to_none(self) -> None:
|
||||
_, error = parse_tool_call_args("{bad}", "my_tool", "call_3")
|
||||
assert error is not None
|
||||
assert error["original_tool"] is None
|
||||
|
||||
def test_dict_input_returned_directly(self) -> None:
|
||||
func_args = {"code": "x = 42"}
|
||||
args_dict, error = parse_tool_call_args(func_args, "run_code", "call_4")
|
||||
assert error is None
|
||||
assert args_dict == {"code": "x = 42"}
|
||||
|
||||
def test_empty_dict_input_returned_directly(self) -> None:
|
||||
args_dict, error = parse_tool_call_args({}, "run_code", "call_5")
|
||||
assert error is None
|
||||
assert args_dict == {}
|
||||
|
||||
def test_valid_json_with_nested_values(self) -> None:
|
||||
args_dict, error = parse_tool_call_args(
|
||||
'{"query": "hello", "options": {"limit": 10}}', "search", "call_6"
|
||||
)
|
||||
assert error is None
|
||||
assert args_dict == {"query": "hello", "options": {"limit": 10}}
|
||||
|
||||
def test_error_result_has_correct_keys(self) -> None:
|
||||
_, error = parse_tool_call_args("{bad json}", "tool", "call_7")
|
||||
assert error is not None
|
||||
assert set(error.keys()) == {"call_id", "func_name", "result", "from_cache", "original_tool"}
|
||||
|
||||
@@ -81,7 +81,7 @@ def test_create_llm_from_env_with_unaccepted_attributes() -> None:
|
||||
"OPENAI_API_KEY": "fake-key",
|
||||
"AWS_ACCESS_KEY_ID": "fake-access-key",
|
||||
"AWS_SECRET_ACCESS_KEY": "fake-secret-key",
|
||||
"AWS_REGION_NAME": "us-west-2",
|
||||
"AWS_DEFAULT_REGION": "us-west-2",
|
||||
},
|
||||
):
|
||||
llm = create_llm(llm_value=None)
|
||||
@@ -89,7 +89,7 @@ def test_create_llm_from_env_with_unaccepted_attributes() -> None:
|
||||
assert llm.model == "gpt-3.5-turbo"
|
||||
assert not hasattr(llm, "AWS_ACCESS_KEY_ID")
|
||||
assert not hasattr(llm, "AWS_SECRET_ACCESS_KEY")
|
||||
assert not hasattr(llm, "AWS_REGION_NAME")
|
||||
assert not hasattr(llm, "AWS_DEFAULT_REGION")
|
||||
|
||||
|
||||
def test_create_llm_with_partial_attributes() -> None:
|
||||
|
||||
@@ -1,389 +0,0 @@
|
||||
"""Tests for planning types (PlanStep, TodoItem, TodoList)."""
|
||||
|
||||
import pytest
|
||||
from uuid import UUID
|
||||
|
||||
from crewai.utilities.planning_types import (
|
||||
PlanStep,
|
||||
TodoItem,
|
||||
TodoList,
|
||||
TodoStatus,
|
||||
)
|
||||
|
||||
|
||||
class TestPlanStep:
|
||||
"""Tests for the PlanStep model."""
|
||||
|
||||
def test_plan_step_with_required_fields(self):
|
||||
"""Test PlanStep creation with only required fields."""
|
||||
step = PlanStep(
|
||||
step_number=1,
|
||||
description="Research the topic",
|
||||
)
|
||||
|
||||
assert step.step_number == 1
|
||||
assert step.description == "Research the topic"
|
||||
assert step.tool_to_use is None
|
||||
assert step.depends_on == []
|
||||
|
||||
def test_plan_step_with_all_fields(self):
|
||||
"""Test PlanStep creation with all fields."""
|
||||
step = PlanStep(
|
||||
step_number=2,
|
||||
description="Search for information",
|
||||
tool_to_use="search_tool",
|
||||
depends_on=[1],
|
||||
)
|
||||
|
||||
assert step.step_number == 2
|
||||
assert step.description == "Search for information"
|
||||
assert step.tool_to_use == "search_tool"
|
||||
assert step.depends_on == [1]
|
||||
|
||||
def test_plan_step_with_multiple_dependencies(self):
|
||||
"""Test PlanStep with multiple dependencies."""
|
||||
step = PlanStep(
|
||||
step_number=4,
|
||||
description="Synthesize results",
|
||||
depends_on=[1, 2, 3],
|
||||
)
|
||||
|
||||
assert step.depends_on == [1, 2, 3]
|
||||
|
||||
def test_plan_step_requires_step_number(self):
|
||||
"""Test that step_number is required."""
|
||||
with pytest.raises(ValueError):
|
||||
PlanStep(description="Missing step number")
|
||||
|
||||
def test_plan_step_requires_description(self):
|
||||
"""Test that description is required."""
|
||||
with pytest.raises(ValueError):
|
||||
PlanStep(step_number=1)
|
||||
|
||||
def test_plan_step_serialization(self):
|
||||
"""Test PlanStep can be serialized to dict."""
|
||||
step = PlanStep(
|
||||
step_number=1,
|
||||
description="Test step",
|
||||
tool_to_use="test_tool",
|
||||
depends_on=[],
|
||||
)
|
||||
|
||||
data = step.model_dump()
|
||||
assert data["step_number"] == 1
|
||||
assert data["description"] == "Test step"
|
||||
assert data["tool_to_use"] == "test_tool"
|
||||
assert data["depends_on"] == []
|
||||
|
||||
|
||||
class TestTodoItem:
|
||||
"""Tests for the TodoItem model."""
|
||||
|
||||
def test_todo_item_with_required_fields(self):
|
||||
"""Test TodoItem creation with only required fields."""
|
||||
todo = TodoItem(
|
||||
step_number=1,
|
||||
description="First task",
|
||||
)
|
||||
|
||||
assert todo.step_number == 1
|
||||
assert todo.description == "First task"
|
||||
assert todo.status == "pending"
|
||||
assert todo.tool_to_use is None
|
||||
assert todo.depends_on == []
|
||||
assert todo.result is None
|
||||
# ID should be auto-generated
|
||||
assert todo.id is not None
|
||||
# Verify it's a valid UUID
|
||||
UUID(todo.id)
|
||||
|
||||
def test_todo_item_with_all_fields(self):
|
||||
"""Test TodoItem creation with all fields."""
|
||||
todo = TodoItem(
|
||||
id="custom-id-123",
|
||||
step_number=2,
|
||||
description="Second task",
|
||||
tool_to_use="search_tool",
|
||||
status="running",
|
||||
depends_on=[1],
|
||||
result="Task completed",
|
||||
)
|
||||
|
||||
assert todo.id == "custom-id-123"
|
||||
assert todo.step_number == 2
|
||||
assert todo.description == "Second task"
|
||||
assert todo.tool_to_use == "search_tool"
|
||||
assert todo.status == "running"
|
||||
assert todo.depends_on == [1]
|
||||
assert todo.result == "Task completed"
|
||||
|
||||
def test_todo_item_status_values(self):
|
||||
"""Test all valid status values."""
|
||||
for status in ["pending", "running", "completed"]:
|
||||
todo = TodoItem(
|
||||
step_number=1,
|
||||
description="Test",
|
||||
status=status,
|
||||
)
|
||||
assert todo.status == status
|
||||
|
||||
def test_todo_item_auto_generates_unique_ids(self):
|
||||
"""Test that each TodoItem gets a unique auto-generated ID."""
|
||||
todo1 = TodoItem(step_number=1, description="Task 1")
|
||||
todo2 = TodoItem(step_number=2, description="Task 2")
|
||||
|
||||
assert todo1.id != todo2.id
|
||||
|
||||
def test_todo_item_serialization(self):
|
||||
"""Test TodoItem can be serialized to dict."""
|
||||
todo = TodoItem(
|
||||
step_number=1,
|
||||
description="Test task",
|
||||
status="pending",
|
||||
)
|
||||
|
||||
data = todo.model_dump()
|
||||
assert "id" in data
|
||||
assert data["step_number"] == 1
|
||||
assert data["description"] == "Test task"
|
||||
assert data["status"] == "pending"
|
||||
|
||||
|
||||
class TestTodoList:
|
||||
"""Tests for the TodoList model."""
|
||||
|
||||
@pytest.fixture
|
||||
def empty_todo_list(self):
|
||||
"""Create an empty TodoList."""
|
||||
return TodoList()
|
||||
|
||||
@pytest.fixture
|
||||
def sample_todo_list(self):
|
||||
"""Create a TodoList with sample items."""
|
||||
return TodoList(
|
||||
items=[
|
||||
TodoItem(step_number=1, description="Step 1", status="completed"),
|
||||
TodoItem(step_number=2, description="Step 2", status="running"),
|
||||
TodoItem(step_number=3, description="Step 3", status="pending"),
|
||||
TodoItem(step_number=4, description="Step 4", status="pending"),
|
||||
]
|
||||
)
|
||||
|
||||
def test_empty_todo_list(self, empty_todo_list):
|
||||
"""Test empty TodoList properties."""
|
||||
assert empty_todo_list.items == []
|
||||
assert empty_todo_list.current_todo is None
|
||||
assert empty_todo_list.next_pending is None
|
||||
assert empty_todo_list.is_complete is False
|
||||
assert empty_todo_list.pending_count == 0
|
||||
assert empty_todo_list.completed_count == 0
|
||||
|
||||
def test_current_todo_property(self, sample_todo_list):
|
||||
"""Test current_todo returns the running item."""
|
||||
current = sample_todo_list.current_todo
|
||||
assert current is not None
|
||||
assert current.step_number == 2
|
||||
assert current.status == "running"
|
||||
|
||||
def test_current_todo_returns_none_when_no_running(self):
|
||||
"""Test current_todo returns None when no running items."""
|
||||
todo_list = TodoList(
|
||||
items=[
|
||||
TodoItem(step_number=1, description="Step 1", status="completed"),
|
||||
TodoItem(step_number=2, description="Step 2", status="pending"),
|
||||
]
|
||||
)
|
||||
assert todo_list.current_todo is None
|
||||
|
||||
def test_next_pending_property(self, sample_todo_list):
|
||||
"""Test next_pending returns the first pending item."""
|
||||
next_item = sample_todo_list.next_pending
|
||||
assert next_item is not None
|
||||
assert next_item.step_number == 3
|
||||
assert next_item.status == "pending"
|
||||
|
||||
def test_next_pending_returns_none_when_no_pending(self):
|
||||
"""Test next_pending returns None when no pending items."""
|
||||
todo_list = TodoList(
|
||||
items=[
|
||||
TodoItem(step_number=1, description="Step 1", status="completed"),
|
||||
TodoItem(step_number=2, description="Step 2", status="completed"),
|
||||
]
|
||||
)
|
||||
assert todo_list.next_pending is None
|
||||
|
||||
def test_is_complete_property_when_complete(self):
|
||||
"""Test is_complete returns True when all items completed."""
|
||||
todo_list = TodoList(
|
||||
items=[
|
||||
TodoItem(step_number=1, description="Step 1", status="completed"),
|
||||
TodoItem(step_number=2, description="Step 2", status="completed"),
|
||||
]
|
||||
)
|
||||
assert todo_list.is_complete is True
|
||||
|
||||
def test_is_complete_property_when_not_complete(self, sample_todo_list):
|
||||
"""Test is_complete returns False when items are pending."""
|
||||
assert sample_todo_list.is_complete is False
|
||||
|
||||
def test_is_complete_false_for_empty_list(self, empty_todo_list):
|
||||
"""Test is_complete returns False for empty list."""
|
||||
assert empty_todo_list.is_complete is False
|
||||
|
||||
def test_pending_count(self, sample_todo_list):
|
||||
"""Test pending_count returns correct count."""
|
||||
assert sample_todo_list.pending_count == 2
|
||||
|
||||
def test_completed_count(self, sample_todo_list):
|
||||
"""Test completed_count returns correct count."""
|
||||
assert sample_todo_list.completed_count == 1
|
||||
|
||||
def test_get_by_step_number(self, sample_todo_list):
|
||||
"""Test get_by_step_number returns correct item."""
|
||||
item = sample_todo_list.get_by_step_number(3)
|
||||
assert item is not None
|
||||
assert item.step_number == 3
|
||||
assert item.description == "Step 3"
|
||||
|
||||
def test_get_by_step_number_returns_none_for_missing(self, sample_todo_list):
|
||||
"""Test get_by_step_number returns None for non-existent step."""
|
||||
item = sample_todo_list.get_by_step_number(99)
|
||||
assert item is None
|
||||
|
||||
def test_mark_running(self, sample_todo_list):
|
||||
"""Test mark_running changes status correctly."""
|
||||
sample_todo_list.mark_running(3)
|
||||
item = sample_todo_list.get_by_step_number(3)
|
||||
assert item.status == "running"
|
||||
|
||||
def test_mark_running_does_nothing_for_missing(self, sample_todo_list):
|
||||
"""Test mark_running handles missing step gracefully."""
|
||||
# Should not raise an error
|
||||
sample_todo_list.mark_running(99)
|
||||
|
||||
def test_mark_completed(self, sample_todo_list):
|
||||
"""Test mark_completed changes status correctly."""
|
||||
sample_todo_list.mark_completed(3)
|
||||
item = sample_todo_list.get_by_step_number(3)
|
||||
assert item.status == "completed"
|
||||
assert item.result is None
|
||||
|
||||
def test_mark_completed_with_result(self, sample_todo_list):
|
||||
"""Test mark_completed with result."""
|
||||
sample_todo_list.mark_completed(3, result="Task output")
|
||||
item = sample_todo_list.get_by_step_number(3)
|
||||
assert item.status == "completed"
|
||||
assert item.result == "Task output"
|
||||
|
||||
def test_mark_completed_does_nothing_for_missing(self, sample_todo_list):
|
||||
"""Test mark_completed handles missing step gracefully."""
|
||||
# Should not raise an error
|
||||
sample_todo_list.mark_completed(99, result="Some result")
|
||||
|
||||
def test_todo_list_workflow(self):
|
||||
"""Test a complete workflow through TodoList."""
|
||||
# Create a todo list with 3 items
|
||||
todo_list = TodoList(
|
||||
items=[
|
||||
TodoItem(
|
||||
step_number=1,
|
||||
description="Research",
|
||||
tool_to_use="search_tool",
|
||||
),
|
||||
TodoItem(
|
||||
step_number=2,
|
||||
description="Analyze",
|
||||
depends_on=[1],
|
||||
),
|
||||
TodoItem(
|
||||
step_number=3,
|
||||
description="Report",
|
||||
depends_on=[1, 2],
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
# Initial state
|
||||
assert todo_list.pending_count == 3
|
||||
assert todo_list.completed_count == 0
|
||||
assert todo_list.is_complete is False
|
||||
|
||||
# Start first task
|
||||
todo_list.mark_running(1)
|
||||
assert todo_list.current_todo.step_number == 1
|
||||
assert todo_list.next_pending.step_number == 2
|
||||
|
||||
# Complete first task
|
||||
todo_list.mark_completed(1, result="Research done")
|
||||
assert todo_list.current_todo is None
|
||||
assert todo_list.completed_count == 1
|
||||
|
||||
# Start and complete second task
|
||||
todo_list.mark_running(2)
|
||||
todo_list.mark_completed(2, result="Analysis complete")
|
||||
assert todo_list.completed_count == 2
|
||||
|
||||
# Start and complete third task
|
||||
todo_list.mark_running(3)
|
||||
todo_list.mark_completed(3, result="Report generated")
|
||||
|
||||
# Final state
|
||||
assert todo_list.is_complete is True
|
||||
assert todo_list.pending_count == 0
|
||||
assert todo_list.completed_count == 3
|
||||
assert todo_list.current_todo is None
|
||||
assert todo_list.next_pending is None
|
||||
|
||||
|
||||
class TestTodoFromPlanStep:
|
||||
"""Tests for converting PlanStep to TodoItem."""
|
||||
|
||||
def test_convert_plan_step_to_todo_item(self):
|
||||
"""Test converting a PlanStep to TodoItem."""
|
||||
step = PlanStep(
|
||||
step_number=1,
|
||||
description="Search for information",
|
||||
tool_to_use="search_tool",
|
||||
depends_on=[],
|
||||
)
|
||||
|
||||
todo = TodoItem(
|
||||
step_number=step.step_number,
|
||||
description=step.description,
|
||||
tool_to_use=step.tool_to_use,
|
||||
depends_on=step.depends_on,
|
||||
status="pending",
|
||||
)
|
||||
|
||||
assert todo.step_number == step.step_number
|
||||
assert todo.description == step.description
|
||||
assert todo.tool_to_use == step.tool_to_use
|
||||
assert todo.depends_on == step.depends_on
|
||||
assert todo.status == "pending"
|
||||
|
||||
def test_convert_multiple_plan_steps_to_todo_list(self):
|
||||
"""Test converting multiple PlanSteps to a TodoList."""
|
||||
steps = [
|
||||
PlanStep(step_number=1, description="Step 1", tool_to_use="tool1"),
|
||||
PlanStep(step_number=2, description="Step 2", depends_on=[1]),
|
||||
PlanStep(step_number=3, description="Step 3", depends_on=[1, 2]),
|
||||
]
|
||||
|
||||
todos = []
|
||||
for step in steps:
|
||||
todo = TodoItem(
|
||||
step_number=step.step_number,
|
||||
description=step.description,
|
||||
tool_to_use=step.tool_to_use,
|
||||
depends_on=step.depends_on,
|
||||
status="pending",
|
||||
)
|
||||
todos.append(todo)
|
||||
|
||||
todo_list = TodoList(items=todos)
|
||||
|
||||
assert len(todo_list.items) == 3
|
||||
assert todo_list.pending_count == 3
|
||||
assert todo_list.items[0].tool_to_use == "tool1"
|
||||
assert todo_list.items[1].depends_on == [1]
|
||||
assert todo_list.items[2].depends_on == [1, 2]
|
||||
@@ -1,698 +0,0 @@
|
||||
"""Tests for structured planning with steps and todo generation.
|
||||
|
||||
These tests verify that the planning system correctly generates structured
|
||||
PlanStep objects and converts them to TodoItems across different LLM providers.
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from crewai import Agent, PlanningConfig, Task
|
||||
from crewai.llm import LLM
|
||||
from crewai.utilities.planning_types import PlanStep, TodoItem, TodoList
|
||||
from crewai.utilities.reasoning_handler import (
|
||||
FUNCTION_SCHEMA,
|
||||
AgentReasoning,
|
||||
ReasoningPlan,
|
||||
)
|
||||
|
||||
|
||||
class TestFunctionSchema:
|
||||
"""Tests for the FUNCTION_SCHEMA used in structured planning."""
|
||||
|
||||
def test_schema_has_required_structure(self):
|
||||
"""Test that FUNCTION_SCHEMA has the correct structure."""
|
||||
assert FUNCTION_SCHEMA["type"] == "function"
|
||||
assert "function" in FUNCTION_SCHEMA
|
||||
assert FUNCTION_SCHEMA["function"]["name"] == "create_reasoning_plan"
|
||||
|
||||
def test_schema_parameters_structure(self):
|
||||
"""Test that parameters have correct structure."""
|
||||
params = FUNCTION_SCHEMA["function"]["parameters"]
|
||||
assert params["type"] == "object"
|
||||
assert "properties" in params
|
||||
assert "required" in params
|
||||
|
||||
def test_schema_has_plan_property(self):
|
||||
"""Test that schema includes plan property."""
|
||||
props = FUNCTION_SCHEMA["function"]["parameters"]["properties"]
|
||||
assert "plan" in props
|
||||
assert props["plan"]["type"] == "string"
|
||||
|
||||
def test_schema_has_steps_property(self):
|
||||
"""Test that schema includes steps array property."""
|
||||
props = FUNCTION_SCHEMA["function"]["parameters"]["properties"]
|
||||
assert "steps" in props
|
||||
assert props["steps"]["type"] == "array"
|
||||
|
||||
def test_schema_steps_items_structure(self):
|
||||
"""Test that steps items have correct structure."""
|
||||
items = FUNCTION_SCHEMA["function"]["parameters"]["properties"]["steps"]["items"]
|
||||
assert items["type"] == "object"
|
||||
assert "properties" in items
|
||||
assert "required" in items
|
||||
assert "additionalProperties" in items
|
||||
assert items["additionalProperties"] is False
|
||||
|
||||
def test_schema_step_properties(self):
|
||||
"""Test that step items have all required properties."""
|
||||
step_props = FUNCTION_SCHEMA["function"]["parameters"]["properties"]["steps"]["items"]["properties"]
|
||||
|
||||
assert "step_number" in step_props
|
||||
assert step_props["step_number"]["type"] == "integer"
|
||||
|
||||
assert "description" in step_props
|
||||
assert step_props["description"]["type"] == "string"
|
||||
|
||||
assert "tool_to_use" in step_props
|
||||
# tool_to_use should be nullable
|
||||
assert step_props["tool_to_use"]["type"] == ["string", "null"]
|
||||
|
||||
assert "depends_on" in step_props
|
||||
assert step_props["depends_on"]["type"] == "array"
|
||||
|
||||
def test_schema_step_required_fields(self):
|
||||
"""Test that step required fields are correct."""
|
||||
required = FUNCTION_SCHEMA["function"]["parameters"]["properties"]["steps"]["items"]["required"]
|
||||
assert "step_number" in required
|
||||
assert "description" in required
|
||||
assert "tool_to_use" in required
|
||||
assert "depends_on" in required
|
||||
|
||||
def test_schema_has_ready_property(self):
|
||||
"""Test that schema includes ready property."""
|
||||
props = FUNCTION_SCHEMA["function"]["parameters"]["properties"]
|
||||
assert "ready" in props
|
||||
assert props["ready"]["type"] == "boolean"
|
||||
|
||||
def test_schema_top_level_required(self):
|
||||
"""Test that top-level required fields are correct."""
|
||||
required = FUNCTION_SCHEMA["function"]["parameters"]["required"]
|
||||
assert "plan" in required
|
||||
assert "steps" in required
|
||||
assert "ready" in required
|
||||
|
||||
def test_schema_top_level_additional_properties(self):
|
||||
"""Test that additionalProperties is False at top level."""
|
||||
params = FUNCTION_SCHEMA["function"]["parameters"]
|
||||
assert params["additionalProperties"] is False
|
||||
|
||||
|
||||
class TestReasoningPlan:
|
||||
"""Tests for the ReasoningPlan model with structured steps."""
|
||||
|
||||
def test_reasoning_plan_with_empty_steps(self):
|
||||
"""Test ReasoningPlan can be created with empty steps."""
|
||||
plan = ReasoningPlan(
|
||||
plan="Simple plan",
|
||||
steps=[],
|
||||
ready=True,
|
||||
)
|
||||
|
||||
assert plan.plan == "Simple plan"
|
||||
assert plan.steps == []
|
||||
assert plan.ready is True
|
||||
|
||||
def test_reasoning_plan_with_steps(self):
|
||||
"""Test ReasoningPlan with structured steps."""
|
||||
steps = [
|
||||
PlanStep(step_number=1, description="First step", tool_to_use="tool1"),
|
||||
PlanStep(step_number=2, description="Second step", depends_on=[1]),
|
||||
]
|
||||
|
||||
plan = ReasoningPlan(
|
||||
plan="Multi-step plan",
|
||||
steps=steps,
|
||||
ready=True,
|
||||
)
|
||||
|
||||
assert plan.plan == "Multi-step plan"
|
||||
assert len(plan.steps) == 2
|
||||
assert plan.steps[0].step_number == 1
|
||||
assert plan.steps[1].depends_on == [1]
|
||||
|
||||
|
||||
class TestAgentReasoningWithMockedLLM:
|
||||
"""Tests for AgentReasoning with mocked LLM responses."""
|
||||
|
||||
@pytest.fixture
|
||||
def mock_agent(self):
|
||||
"""Create a mock agent for testing."""
|
||||
agent = MagicMock()
|
||||
agent.role = "Test Agent"
|
||||
agent.goal = "Test goal"
|
||||
agent.backstory = "Test backstory"
|
||||
agent.verbose = False
|
||||
agent.planning_config = PlanningConfig()
|
||||
agent.i18n = MagicMock()
|
||||
agent.i18n.retrieve.return_value = "Test prompt: {description}"
|
||||
# Mock the llm attribute
|
||||
agent.llm = MagicMock()
|
||||
agent.llm.supports_function_calling.return_value = True
|
||||
return agent
|
||||
|
||||
def test_parse_steps_from_function_response(self, mock_agent):
|
||||
"""Test that steps are correctly parsed from LLM function response."""
|
||||
# Mock the LLM response with structured steps
|
||||
mock_response = json.dumps({
|
||||
"plan": "Research and analyze",
|
||||
"steps": [
|
||||
{
|
||||
"step_number": 1,
|
||||
"description": "Search for information",
|
||||
"tool_to_use": "search_tool",
|
||||
"depends_on": [],
|
||||
},
|
||||
{
|
||||
"step_number": 2,
|
||||
"description": "Analyze results",
|
||||
"tool_to_use": None,
|
||||
"depends_on": [1],
|
||||
},
|
||||
],
|
||||
"ready": True,
|
||||
})
|
||||
|
||||
mock_agent.llm.call.return_value = mock_response
|
||||
|
||||
handler = AgentReasoning(
|
||||
agent=mock_agent,
|
||||
task=None,
|
||||
description="Test task",
|
||||
expected_output="Test output",
|
||||
)
|
||||
|
||||
# Call the function parsing method
|
||||
plan, steps, ready = handler._call_with_function(
|
||||
prompt="Test prompt",
|
||||
plan_type="create_plan",
|
||||
)
|
||||
|
||||
assert plan == "Research and analyze"
|
||||
assert len(steps) == 2
|
||||
assert steps[0].step_number == 1
|
||||
assert steps[0].tool_to_use == "search_tool"
|
||||
assert steps[1].depends_on == [1]
|
||||
assert ready is True
|
||||
|
||||
def test_parse_steps_handles_missing_optional_fields(self, mock_agent):
|
||||
"""Test that missing optional fields are handled correctly."""
|
||||
mock_response = json.dumps({
|
||||
"plan": "Simple plan",
|
||||
"steps": [
|
||||
{
|
||||
"step_number": 1,
|
||||
"description": "Do something",
|
||||
"tool_to_use": None,
|
||||
"depends_on": [],
|
||||
},
|
||||
],
|
||||
"ready": True,
|
||||
})
|
||||
|
||||
mock_agent.llm.call.return_value = mock_response
|
||||
|
||||
handler = AgentReasoning(
|
||||
agent=mock_agent,
|
||||
task=None,
|
||||
description="Test task",
|
||||
expected_output="Test output",
|
||||
)
|
||||
|
||||
plan, steps, ready = handler._call_with_function(
|
||||
prompt="Test prompt",
|
||||
plan_type="create_plan",
|
||||
)
|
||||
|
||||
assert len(steps) == 1
|
||||
assert steps[0].tool_to_use is None
|
||||
assert steps[0].depends_on == []
|
||||
|
||||
def test_parse_steps_with_missing_fields_uses_defaults(self, mock_agent):
|
||||
"""Test that steps with missing fields get default values."""
|
||||
mock_response = json.dumps({
|
||||
"plan": "Plan with step missing fields",
|
||||
"steps": [
|
||||
{"step_number": 1, "description": "Valid step", "tool_to_use": None, "depends_on": []},
|
||||
{"step_number": 2}, # Missing description, tool_to_use, depends_on
|
||||
{"step_number": 3, "description": "Another valid", "tool_to_use": None, "depends_on": []},
|
||||
],
|
||||
"ready": True,
|
||||
})
|
||||
|
||||
mock_agent.llm.call.return_value = mock_response
|
||||
|
||||
handler = AgentReasoning(
|
||||
agent=mock_agent,
|
||||
task=None,
|
||||
description="Test task",
|
||||
expected_output="Test output",
|
||||
)
|
||||
|
||||
plan, steps, ready = handler._call_with_function(
|
||||
prompt="Test prompt",
|
||||
plan_type="create_plan",
|
||||
)
|
||||
|
||||
# All 3 steps should be parsed, with defaults for missing fields
|
||||
assert len(steps) == 3
|
||||
assert steps[0].step_number == 1
|
||||
assert steps[0].description == "Valid step"
|
||||
assert steps[1].step_number == 2
|
||||
assert steps[1].description == "" # Default value
|
||||
assert steps[2].step_number == 3
|
||||
|
||||
|
||||
class TestTodoCreationFromPlan:
|
||||
"""Tests for converting plan steps to todo items."""
|
||||
|
||||
def test_create_todos_from_plan_steps(self):
|
||||
"""Test creating TodoList from PlanSteps."""
|
||||
steps = [
|
||||
PlanStep(
|
||||
step_number=1,
|
||||
description="Research competitors",
|
||||
tool_to_use="search_tool",
|
||||
depends_on=[],
|
||||
),
|
||||
PlanStep(
|
||||
step_number=2,
|
||||
description="Analyze data",
|
||||
tool_to_use=None,
|
||||
depends_on=[1],
|
||||
),
|
||||
PlanStep(
|
||||
step_number=3,
|
||||
description="Generate report",
|
||||
tool_to_use="write_tool",
|
||||
depends_on=[1, 2],
|
||||
),
|
||||
]
|
||||
|
||||
# Convert steps to todos (mirroring agent_executor._create_todos_from_plan)
|
||||
todos = []
|
||||
for step in steps:
|
||||
todo = TodoItem(
|
||||
step_number=step.step_number,
|
||||
description=step.description,
|
||||
tool_to_use=step.tool_to_use,
|
||||
depends_on=step.depends_on,
|
||||
status="pending",
|
||||
)
|
||||
todos.append(todo)
|
||||
|
||||
todo_list = TodoList(items=todos)
|
||||
|
||||
assert len(todo_list.items) == 3
|
||||
assert todo_list.pending_count == 3
|
||||
assert todo_list.completed_count == 0
|
||||
|
||||
# Verify todo properties match step properties
|
||||
assert todo_list.items[0].description == "Research competitors"
|
||||
assert todo_list.items[0].tool_to_use == "search_tool"
|
||||
assert todo_list.items[1].depends_on == [1]
|
||||
assert todo_list.items[2].depends_on == [1, 2]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Provider-Specific Integration Tests (VCR recorded)
|
||||
# =============================================================================
|
||||
|
||||
|
||||
# Common test tools used across provider tests
|
||||
def create_research_tools():
|
||||
"""Create research tools for testing structured planning."""
|
||||
from crewai.tools import tool
|
||||
|
||||
@tool
|
||||
def web_search(query: str) -> str:
|
||||
"""Search the web for information on a given topic.
|
||||
|
||||
Args:
|
||||
query: The search query to look up.
|
||||
|
||||
Returns:
|
||||
Search results as a string.
|
||||
"""
|
||||
# Simulated search results for testing
|
||||
return f"Search results for '{query}': Found 3 relevant articles about the topic including market analysis, competitor data, and industry trends."
|
||||
|
||||
@tool
|
||||
def read_website(url: str) -> str:
|
||||
"""Read and extract content from a website URL.
|
||||
|
||||
Args:
|
||||
url: The URL of the website to read.
|
||||
|
||||
Returns:
|
||||
The extracted content from the website.
|
||||
"""
|
||||
# Simulated website content for testing
|
||||
return f"Content from {url}: This article discusses key insights about the topic including market size ($50B), growth rate (15% YoY), and major players in the industry."
|
||||
|
||||
@tool
|
||||
def generate_report(title: str, findings: str) -> str:
|
||||
"""Generate a structured report based on research findings.
|
||||
|
||||
Args:
|
||||
title: The title of the report.
|
||||
findings: The research findings to include.
|
||||
|
||||
Returns:
|
||||
A formatted report string.
|
||||
"""
|
||||
return f"# {title}\n\n## Executive Summary\n{findings}\n\n## Conclusion\nBased on the analysis, the market shows strong growth potential."
|
||||
|
||||
return web_search, read_website, generate_report
|
||||
|
||||
|
||||
RESEARCH_TASK = """Research the current state of the AI agent market:
|
||||
1. Search for recent information about AI agents and their market trends
|
||||
2. Read detailed content from a relevant industry source
|
||||
3. Generate a brief report summarizing the key findings
|
||||
|
||||
Use the available tools for each step."""
|
||||
|
||||
|
||||
class TestOpenAIStructuredPlanning:
|
||||
"""Integration tests for OpenAI structured planning with research workflow."""
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_openai_research_workflow_generates_steps(self):
|
||||
"""Test that OpenAI generates structured plan steps for a research task."""
|
||||
web_search, read_website, generate_report = create_research_tools()
|
||||
llm = LLM(model="gpt-4o")
|
||||
|
||||
agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Conduct thorough research and produce insightful reports",
|
||||
backstory="An experienced analyst skilled at gathering information and synthesizing findings into actionable insights.",
|
||||
llm=llm,
|
||||
tools=[web_search, read_website, generate_report],
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff(RESEARCH_TASK)
|
||||
|
||||
# Verify result exists
|
||||
assert result is not None
|
||||
assert result.raw is not None
|
||||
# The result should contain some report-like content
|
||||
assert len(str(result.raw)) > 50
|
||||
|
||||
|
||||
class TestAnthropicStructuredPlanning:
|
||||
"""Integration tests for Anthropic structured planning with research workflow."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_anthropic_api_key(self):
|
||||
"""Mock API key if not set."""
|
||||
if "ANTHROPIC_API_KEY" not in os.environ:
|
||||
with patch.dict(os.environ, {"ANTHROPIC_API_KEY": "test-key"}):
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_anthropic_research_workflow_generates_steps(self):
|
||||
"""Test that Anthropic generates structured plan steps for a research task."""
|
||||
web_search, read_website, generate_report = create_research_tools()
|
||||
llm = LLM(model="anthropic/claude-sonnet-4-20250514")
|
||||
|
||||
agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Conduct thorough research and produce insightful reports",
|
||||
backstory="An experienced analyst skilled at gathering information and synthesizing findings into actionable insights.",
|
||||
llm=llm,
|
||||
tools=[web_search, read_website, generate_report],
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff(RESEARCH_TASK)
|
||||
|
||||
# Verify result exists
|
||||
assert result is not None
|
||||
assert result.raw is not None
|
||||
# The result should contain some report-like content
|
||||
assert len(str(result.raw)) > 50
|
||||
|
||||
|
||||
class TestGeminiStructuredPlanning:
|
||||
"""Integration tests for Google Gemini structured planning with research workflow."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_google_api_key(self):
|
||||
"""Mock API key if not set."""
|
||||
if "GOOGLE_API_KEY" not in os.environ and "GEMINI_API_KEY" not in os.environ:
|
||||
with patch.dict(os.environ, {"GOOGLE_API_KEY": "test-key"}):
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_gemini_research_workflow_generates_steps(self):
|
||||
"""Test that Gemini generates structured plan steps for a research task."""
|
||||
web_search, read_website, generate_report = create_research_tools()
|
||||
llm = LLM(model="gemini/gemini-2.5-flash")
|
||||
|
||||
agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Conduct thorough research and produce insightful reports",
|
||||
backstory="An experienced analyst skilled at gathering information and synthesizing findings into actionable insights.",
|
||||
llm=llm,
|
||||
tools=[web_search, read_website, generate_report],
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff(RESEARCH_TASK)
|
||||
|
||||
# Verify result exists
|
||||
assert result is not None
|
||||
assert result.raw is not None
|
||||
# The result should contain some report-like content
|
||||
assert len(str(result.raw)) > 50
|
||||
|
||||
|
||||
class TestAzureStructuredPlanning:
|
||||
"""Integration tests for Azure OpenAI structured planning with research workflow."""
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_azure_credentials(self):
|
||||
"""Mock Azure credentials for tests."""
|
||||
if "AZURE_API_KEY" not in os.environ:
|
||||
with patch.dict(os.environ, {
|
||||
"AZURE_API_KEY": "test-key",
|
||||
"AZURE_ENDPOINT": "https://test.openai.azure.com"
|
||||
}):
|
||||
yield
|
||||
else:
|
||||
yield
|
||||
|
||||
@pytest.mark.vcr()
|
||||
def test_azure_research_workflow_generates_steps(self):
|
||||
"""Test that Azure OpenAI generates structured plan steps for a research task."""
|
||||
web_search, read_website, generate_report = create_research_tools()
|
||||
llm = LLM(model="azure/gpt-4o")
|
||||
|
||||
agent = Agent(
|
||||
role="Research Analyst",
|
||||
goal="Conduct thorough research and produce insightful reports",
|
||||
backstory="An experienced analyst skilled at gathering information and synthesizing findings into actionable insights.",
|
||||
llm=llm,
|
||||
tools=[web_search, read_website, generate_report],
|
||||
planning_config=PlanningConfig(max_attempts=1),
|
||||
verbose=False,
|
||||
)
|
||||
|
||||
result = agent.kickoff(RESEARCH_TASK)
|
||||
|
||||
# Verify result exists
|
||||
assert result is not None
|
||||
assert result.raw is not None
|
||||
# The result should contain some report-like content
|
||||
assert len(str(result.raw)) > 50
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Unit Tests with Mocked LLM Providers
|
||||
# =============================================================================
|
||||
|
||||
|
||||
class TestStructuredPlanningWithMockedProviders:
|
||||
"""Unit tests with mocked LLM providers for faster execution."""
|
||||
|
||||
def _create_mock_plan_response(self, steps_data):
|
||||
"""Helper to create mock plan response."""
|
||||
return json.dumps({
|
||||
"plan": "Test plan",
|
||||
"steps": steps_data,
|
||||
"ready": True,
|
||||
})
|
||||
|
||||
def test_openai_mock_structured_response(self):
|
||||
"""Test parsing OpenAI structured response."""
|
||||
steps_data = [
|
||||
{"step_number": 1, "description": "Search", "tool_to_use": "search", "depends_on": []},
|
||||
{"step_number": 2, "description": "Analyze", "tool_to_use": None, "depends_on": [1]},
|
||||
]
|
||||
|
||||
response = self._create_mock_plan_response(steps_data)
|
||||
parsed = json.loads(response)
|
||||
|
||||
assert len(parsed["steps"]) == 2
|
||||
assert parsed["steps"][0]["tool_to_use"] == "search"
|
||||
assert parsed["steps"][1]["depends_on"] == [1]
|
||||
|
||||
def test_anthropic_mock_structured_response(self):
|
||||
"""Test parsing Anthropic structured response (same format)."""
|
||||
steps_data = [
|
||||
{"step_number": 1, "description": "Research", "tool_to_use": "web_search", "depends_on": []},
|
||||
{"step_number": 2, "description": "Summarize", "tool_to_use": None, "depends_on": [1]},
|
||||
{"step_number": 3, "description": "Report", "tool_to_use": "write_file", "depends_on": [1, 2]},
|
||||
]
|
||||
|
||||
response = self._create_mock_plan_response(steps_data)
|
||||
parsed = json.loads(response)
|
||||
|
||||
assert len(parsed["steps"]) == 3
|
||||
assert parsed["steps"][2]["depends_on"] == [1, 2]
|
||||
|
||||
def test_gemini_mock_structured_response(self):
|
||||
"""Test parsing Gemini structured response (same format)."""
|
||||
steps_data = [
|
||||
{"step_number": 1, "description": "Gather data", "tool_to_use": "data_tool", "depends_on": []},
|
||||
{"step_number": 2, "description": "Process", "tool_to_use": None, "depends_on": [1]},
|
||||
]
|
||||
|
||||
response = self._create_mock_plan_response(steps_data)
|
||||
parsed = json.loads(response)
|
||||
|
||||
assert len(parsed["steps"]) == 2
|
||||
assert parsed["ready"] is True
|
||||
|
||||
def test_azure_mock_structured_response(self):
|
||||
"""Test parsing Azure OpenAI structured response (same format as OpenAI)."""
|
||||
steps_data = [
|
||||
{"step_number": 1, "description": "Initialize", "tool_to_use": None, "depends_on": []},
|
||||
{"step_number": 2, "description": "Execute", "tool_to_use": "executor", "depends_on": [1]},
|
||||
{"step_number": 3, "description": "Finalize", "tool_to_use": None, "depends_on": [1, 2]},
|
||||
]
|
||||
|
||||
response = self._create_mock_plan_response(steps_data)
|
||||
parsed = json.loads(response)
|
||||
|
||||
assert len(parsed["steps"]) == 3
|
||||
assert parsed["steps"][0]["tool_to_use"] is None
|
||||
|
||||
|
||||
class TestTodoListIntegration:
|
||||
"""Integration tests for TodoList with plan execution simulation."""
|
||||
|
||||
def test_full_plan_execution_workflow(self):
|
||||
"""Test complete workflow from plan to todos to execution."""
|
||||
# Simulate plan steps from LLM
|
||||
plan_steps = [
|
||||
PlanStep(
|
||||
step_number=1,
|
||||
description="Research the topic",
|
||||
tool_to_use="search_tool",
|
||||
depends_on=[],
|
||||
),
|
||||
PlanStep(
|
||||
step_number=2,
|
||||
description="Compile findings",
|
||||
tool_to_use=None,
|
||||
depends_on=[1],
|
||||
),
|
||||
PlanStep(
|
||||
step_number=3,
|
||||
description="Generate summary",
|
||||
tool_to_use="summarize_tool",
|
||||
depends_on=[1, 2],
|
||||
),
|
||||
]
|
||||
|
||||
# Convert to todos (like agent_executor._create_todos_from_plan)
|
||||
todos = [
|
||||
TodoItem(
|
||||
step_number=step.step_number,
|
||||
description=step.description,
|
||||
tool_to_use=step.tool_to_use,
|
||||
depends_on=step.depends_on,
|
||||
status="pending",
|
||||
)
|
||||
for step in plan_steps
|
||||
]
|
||||
todo_list = TodoList(items=todos)
|
||||
|
||||
# Verify initial state
|
||||
assert todo_list.pending_count == 3
|
||||
assert todo_list.is_complete is False
|
||||
|
||||
# Simulate execution
|
||||
for i in range(1, 4):
|
||||
todo_list.mark_running(i)
|
||||
assert todo_list.current_todo.step_number == i
|
||||
todo_list.mark_completed(i, result=f"Step {i} completed")
|
||||
|
||||
# Verify final state
|
||||
assert todo_list.is_complete is True
|
||||
assert todo_list.completed_count == 3
|
||||
assert all(item.result is not None for item in todo_list.items)
|
||||
|
||||
def test_dependency_aware_execution(self):
|
||||
"""Test that dependencies are respected in execution order."""
|
||||
steps = [
|
||||
PlanStep(step_number=1, description="Base step", depends_on=[]),
|
||||
PlanStep(step_number=2, description="Depends on 1", depends_on=[1]),
|
||||
PlanStep(step_number=3, description="Depends on 1", depends_on=[1]),
|
||||
PlanStep(step_number=4, description="Depends on 2 and 3", depends_on=[2, 3]),
|
||||
]
|
||||
|
||||
todos = [
|
||||
TodoItem(
|
||||
step_number=s.step_number,
|
||||
description=s.description,
|
||||
depends_on=s.depends_on,
|
||||
)
|
||||
for s in steps
|
||||
]
|
||||
todo_list = TodoList(items=todos)
|
||||
|
||||
# Helper to check if dependencies are satisfied
|
||||
def can_execute(todo: TodoItem) -> bool:
|
||||
for dep in todo.depends_on:
|
||||
dep_todo = todo_list.get_by_step_number(dep)
|
||||
if dep_todo and dep_todo.status != "completed":
|
||||
return False
|
||||
return True
|
||||
|
||||
# Step 1 has no dependencies
|
||||
assert can_execute(todo_list.items[0]) is True
|
||||
|
||||
# Steps 2 and 3 depend on 1 (not yet done)
|
||||
assert can_execute(todo_list.items[1]) is False
|
||||
assert can_execute(todo_list.items[2]) is False
|
||||
|
||||
# Complete step 1
|
||||
todo_list.mark_completed(1)
|
||||
|
||||
# Now steps 2 and 3 can execute
|
||||
assert can_execute(todo_list.items[1]) is True
|
||||
assert can_execute(todo_list.items[2]) is True
|
||||
|
||||
# Step 4 still can't (depends on 2 and 3)
|
||||
assert can_execute(todo_list.items[3]) is False
|
||||
|
||||
# Complete steps 2 and 3
|
||||
todo_list.mark_completed(2)
|
||||
todo_list.mark_completed(3)
|
||||
|
||||
# Now step 4 can execute
|
||||
assert can_execute(todo_list.items[3]) is True
|
||||
@@ -14,7 +14,7 @@ from rich.markdown import Markdown
|
||||
from rich.panel import Panel
|
||||
from rich.prompt import Confirm
|
||||
|
||||
from crewai_devtools.prompts import RELEASE_NOTES_PROMPT
|
||||
from crewai_devtools.prompts import RELEASE_NOTES_PROMPT, TRANSLATE_RELEASE_NOTES_PROMPT
|
||||
|
||||
|
||||
load_dotenv()
|
||||
@@ -191,6 +191,248 @@ def update_pyproject_dependencies(file_path: Path, new_version: str) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def add_docs_version(docs_json_path: Path, version: str) -> bool:
|
||||
"""Add a new version to the Mintlify docs.json versioning config.
|
||||
|
||||
Copies the current default version's tabs into a new version entry,
|
||||
sets the new version as default, and marks the previous default as
|
||||
non-default. Operates on all languages.
|
||||
|
||||
Args:
|
||||
docs_json_path: Path to docs/docs.json.
|
||||
version: Version string (e.g., "1.10.0").
|
||||
|
||||
Returns:
|
||||
True if docs.json was updated, False otherwise.
|
||||
"""
|
||||
import json
|
||||
|
||||
if not docs_json_path.exists():
|
||||
return False
|
||||
|
||||
data = json.loads(docs_json_path.read_text())
|
||||
version_label = f"v{version}"
|
||||
updated = False
|
||||
|
||||
for lang in data.get("navigation", {}).get("languages", []):
|
||||
versions = lang.get("versions", [])
|
||||
if not versions:
|
||||
continue
|
||||
|
||||
# Skip if this version already exists for this language
|
||||
if any(v.get("version") == version_label for v in versions):
|
||||
continue
|
||||
|
||||
# Find the current default and copy its tabs
|
||||
default_version = next(
|
||||
(v for v in versions if v.get("default")),
|
||||
versions[0],
|
||||
)
|
||||
|
||||
new_version = {
|
||||
"version": version_label,
|
||||
"default": True,
|
||||
"tabs": default_version.get("tabs", []),
|
||||
}
|
||||
|
||||
# Remove default flag from old default
|
||||
default_version.pop("default", None)
|
||||
|
||||
# Insert new version at the beginning
|
||||
versions.insert(0, new_version)
|
||||
updated = True
|
||||
|
||||
if not updated:
|
||||
return False
|
||||
|
||||
docs_json_path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n")
|
||||
return True
|
||||
|
||||
|
||||
_PT_BR_MONTHS = {
|
||||
1: "jan",
|
||||
2: "fev",
|
||||
3: "mar",
|
||||
4: "abr",
|
||||
5: "mai",
|
||||
6: "jun",
|
||||
7: "jul",
|
||||
8: "ago",
|
||||
9: "set",
|
||||
10: "out",
|
||||
11: "nov",
|
||||
12: "dez",
|
||||
}
|
||||
|
||||
_CHANGELOG_LOCALES: dict[str, dict[str, str]] = {
|
||||
"en": {
|
||||
"link_text": "View release on GitHub",
|
||||
"language_name": "English",
|
||||
},
|
||||
"pt-BR": {
|
||||
"link_text": "Ver release no GitHub",
|
||||
"language_name": "Brazilian Portuguese",
|
||||
},
|
||||
"ko": {
|
||||
"link_text": "GitHub 릴리스 보기",
|
||||
"language_name": "Korean",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def translate_release_notes(
|
||||
release_notes: str,
|
||||
lang: str,
|
||||
client: OpenAI,
|
||||
) -> str:
|
||||
"""Translate release notes into the target language using OpenAI.
|
||||
|
||||
Args:
|
||||
release_notes: English release notes markdown.
|
||||
lang: Language code (e.g., "pt-BR", "ko").
|
||||
client: OpenAI client instance.
|
||||
|
||||
Returns:
|
||||
Translated release notes, or original on failure.
|
||||
"""
|
||||
locale_cfg = _CHANGELOG_LOCALES.get(lang)
|
||||
if not locale_cfg:
|
||||
return release_notes
|
||||
|
||||
language_name = locale_cfg["language_name"]
|
||||
prompt = TRANSLATE_RELEASE_NOTES_PROMPT.substitute(
|
||||
language=language_name,
|
||||
release_notes=release_notes,
|
||||
)
|
||||
|
||||
try:
|
||||
response = client.chat.completions.create(
|
||||
model="gpt-4o-mini",
|
||||
messages=[
|
||||
{
|
||||
"role": "system",
|
||||
"content": f"You are a professional translator. Translate technical documentation into {language_name}.",
|
||||
},
|
||||
{"role": "user", "content": prompt},
|
||||
],
|
||||
temperature=0.3,
|
||||
)
|
||||
return response.choices[0].message.content or release_notes
|
||||
except Exception as e:
|
||||
console.print(
|
||||
f"[yellow]Warning:[/yellow] Could not translate to {language_name}: {e}"
|
||||
)
|
||||
return release_notes
|
||||
|
||||
|
||||
def _format_changelog_date(lang: str) -> str:
|
||||
"""Format today's date for a changelog entry in the given language."""
|
||||
from datetime import datetime
|
||||
|
||||
now = datetime.now()
|
||||
if lang == "ko":
|
||||
return f"{now.year}년 {now.month}월 {now.day}일"
|
||||
if lang == "pt-BR":
|
||||
return f"{now.day:02d} {_PT_BR_MONTHS[now.month]} {now.year}"
|
||||
return now.strftime("%b %d, %Y")
|
||||
|
||||
|
||||
def update_changelog(
|
||||
changelog_path: Path,
|
||||
version: str,
|
||||
release_notes: str,
|
||||
lang: str = "en",
|
||||
) -> bool:
|
||||
"""Prepend a new release entry to a docs changelog file.
|
||||
|
||||
Args:
|
||||
changelog_path: Path to the changelog.mdx file.
|
||||
version: Version string (e.g., "1.9.3").
|
||||
release_notes: Markdown release notes content.
|
||||
lang: Language code for localized date/link text.
|
||||
|
||||
Returns:
|
||||
True if changelog was updated, False otherwise.
|
||||
"""
|
||||
if not changelog_path.exists():
|
||||
return False
|
||||
|
||||
locale_cfg = _CHANGELOG_LOCALES.get(lang, _CHANGELOG_LOCALES["en"])
|
||||
date_label = _format_changelog_date(lang)
|
||||
link_text = locale_cfg["link_text"]
|
||||
|
||||
# Indent each non-empty line with 2 spaces to match <Update> block format
|
||||
indented_lines = []
|
||||
for line in release_notes.splitlines():
|
||||
if line.strip():
|
||||
indented_lines.append(f" {line}")
|
||||
else:
|
||||
indented_lines.append("")
|
||||
indented_notes = "\n".join(indented_lines)
|
||||
|
||||
entry = (
|
||||
f'<Update label="{date_label}">\n'
|
||||
f" ## v{version}\n"
|
||||
f"\n"
|
||||
f" [{link_text}]"
|
||||
f"(https://github.com/crewAIInc/crewAI/releases/tag/{version})\n"
|
||||
f"\n"
|
||||
f"{indented_notes}\n"
|
||||
f"\n"
|
||||
f"</Update>"
|
||||
)
|
||||
|
||||
content = changelog_path.read_text()
|
||||
|
||||
# Insert after the frontmatter closing ---
|
||||
parts = content.split("---", 2)
|
||||
if len(parts) >= 3:
|
||||
new_content = (
|
||||
parts[0]
|
||||
+ "---"
|
||||
+ parts[1]
|
||||
+ "---\n"
|
||||
+ entry
|
||||
+ "\n\n"
|
||||
+ parts[2].lstrip("\n")
|
||||
)
|
||||
else:
|
||||
new_content = entry + "\n\n" + content
|
||||
|
||||
changelog_path.write_text(new_content)
|
||||
return True
|
||||
|
||||
|
||||
def update_template_dependencies(templates_dir: Path, new_version: str) -> list[Path]:
|
||||
"""Update crewai dependency versions in CLI template pyproject.toml files.
|
||||
|
||||
Handles both pinned (==) and minimum (>=) version specifiers,
|
||||
as well as extras like [tools].
|
||||
|
||||
Args:
|
||||
templates_dir: Path to the CLI templates directory.
|
||||
new_version: New version string.
|
||||
|
||||
Returns:
|
||||
List of paths that were updated.
|
||||
"""
|
||||
import re
|
||||
|
||||
updated = []
|
||||
for pyproject in templates_dir.rglob("pyproject.toml"):
|
||||
content = pyproject.read_text()
|
||||
new_content = re.sub(
|
||||
r'"crewai(\[tools\])?(==|>=)[^"]*"',
|
||||
lambda m: f'"crewai{(m.group(1) or "")!s}=={new_version}"',
|
||||
content,
|
||||
)
|
||||
if new_content != content:
|
||||
pyproject.write_text(new_content)
|
||||
updated.append(pyproject)
|
||||
|
||||
return updated
|
||||
|
||||
|
||||
def find_version_files(base_path: Path) -> list[Path]:
|
||||
"""Find all __init__.py files that contain __version__.
|
||||
|
||||
@@ -394,6 +636,22 @@ def bump(version: str, dry_run: bool, no_push: bool, no_commit: bool) -> None:
|
||||
"[yellow]Warning:[/yellow] No __version__ attributes found to update"
|
||||
)
|
||||
|
||||
# Update CLI template pyproject.toml files
|
||||
templates_dir = lib_dir / "crewai" / "src" / "crewai" / "cli" / "templates"
|
||||
if templates_dir.exists():
|
||||
if dry_run:
|
||||
for tpl in templates_dir.rglob("pyproject.toml"):
|
||||
console.print(
|
||||
f"[dim][DRY RUN][/dim] Would update template: {tpl.relative_to(cwd)}"
|
||||
)
|
||||
else:
|
||||
tpl_updated = update_template_dependencies(templates_dir, version)
|
||||
for tpl in tpl_updated:
|
||||
console.print(
|
||||
f"[green]✓[/green] Updated template: {tpl.relative_to(cwd)}"
|
||||
)
|
||||
updated_files.append(tpl)
|
||||
|
||||
if not dry_run:
|
||||
console.print("\nSyncing workspace...")
|
||||
run_command(["uv", "sync"])
|
||||
@@ -575,9 +833,9 @@ def tag(dry_run: bool, no_edit: bool) -> None:
|
||||
|
||||
github_contributors = get_github_contributors(commit_range)
|
||||
|
||||
if commits.strip():
|
||||
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
||||
openai_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
||||
|
||||
if commits.strip():
|
||||
contributors_section = ""
|
||||
if github_contributors:
|
||||
contributors_section = f"\n\n## Contributors\n\n{', '.join([f'@{u}' for u in github_contributors])}"
|
||||
@@ -588,7 +846,7 @@ def tag(dry_run: bool, no_edit: bool) -> None:
|
||||
contributors_section=contributors_section,
|
||||
)
|
||||
|
||||
response = client.chat.completions.create(
|
||||
response = openai_client.chat.completions.create(
|
||||
model="gpt-4o-mini",
|
||||
messages=[
|
||||
{
|
||||
@@ -643,6 +901,77 @@ def tag(dry_run: bool, no_edit: bool) -> None:
|
||||
"\n[green]✓[/green] Using generated release notes without editing"
|
||||
)
|
||||
|
||||
is_prerelease = any(
|
||||
indicator in version.lower()
|
||||
for indicator in ["a", "b", "rc", "alpha", "beta", "dev"]
|
||||
)
|
||||
|
||||
# Update docs: changelogs + version switcher
|
||||
docs_json_path = cwd / "docs" / "docs.json"
|
||||
changelog_langs = ["en", "pt-BR", "ko"]
|
||||
if not dry_run:
|
||||
docs_files_staged = []
|
||||
|
||||
for lang in changelog_langs:
|
||||
cl_path = cwd / "docs" / lang / "changelog.mdx"
|
||||
if lang == "en":
|
||||
notes_for_lang = release_notes
|
||||
else:
|
||||
console.print(f"[dim]Translating release notes to {lang}...[/dim]")
|
||||
notes_for_lang = translate_release_notes(
|
||||
release_notes, lang, openai_client
|
||||
)
|
||||
if update_changelog(cl_path, version, notes_for_lang, lang=lang):
|
||||
console.print(
|
||||
f"[green]✓[/green] Updated {cl_path.relative_to(cwd)}"
|
||||
)
|
||||
docs_files_staged.append(str(cl_path))
|
||||
else:
|
||||
console.print(
|
||||
f"[yellow]Warning:[/yellow] Changelog not found at {cl_path.relative_to(cwd)}"
|
||||
)
|
||||
|
||||
if not is_prerelease:
|
||||
if add_docs_version(docs_json_path, version):
|
||||
console.print(
|
||||
f"[green]✓[/green] Added v{version} to docs version switcher"
|
||||
)
|
||||
docs_files_staged.append(str(docs_json_path))
|
||||
else:
|
||||
console.print(
|
||||
f"[yellow]Warning:[/yellow] docs.json not found at {docs_json_path.relative_to(cwd)}"
|
||||
)
|
||||
|
||||
if docs_files_staged:
|
||||
for f in docs_files_staged:
|
||||
run_command(["git", "add", f])
|
||||
run_command(
|
||||
[
|
||||
"git",
|
||||
"commit",
|
||||
"-m",
|
||||
f"docs: update changelog and version for v{version}",
|
||||
]
|
||||
)
|
||||
console.print("[green]✓[/green] Committed docs updates")
|
||||
run_command(["git", "push"])
|
||||
console.print("[green]✓[/green] Pushed docs updates")
|
||||
else:
|
||||
for lang in changelog_langs:
|
||||
cl_path = cwd / "docs" / lang / "changelog.mdx"
|
||||
translated = " (translated)" if lang != "en" else ""
|
||||
console.print(
|
||||
f"[dim][DRY RUN][/dim] Would update {cl_path.relative_to(cwd)}{translated}"
|
||||
)
|
||||
if not is_prerelease:
|
||||
console.print(
|
||||
f"[dim][DRY RUN][/dim] Would add v{version} to docs version switcher"
|
||||
)
|
||||
else:
|
||||
console.print(
|
||||
"[dim][DRY RUN][/dim] Skipping docs version (pre-release)"
|
||||
)
|
||||
|
||||
if not dry_run:
|
||||
with console.status(f"[cyan]Creating tag {tag_name}..."):
|
||||
try:
|
||||
@@ -660,11 +989,6 @@ def tag(dry_run: bool, no_edit: bool) -> None:
|
||||
sys.exit(1)
|
||||
console.print(f"[green]✓[/green] Pushed tag {tag_name}")
|
||||
|
||||
is_prerelease = any(
|
||||
indicator in version.lower()
|
||||
for indicator in ["a", "b", "rc", "alpha", "beta", "dev"]
|
||||
)
|
||||
|
||||
with console.status("[cyan]Creating GitHub Release..."):
|
||||
try:
|
||||
gh_cmd = [
|
||||
|
||||
@@ -43,3 +43,18 @@ Instructions:
|
||||
|
||||
Keep it professional and clear."""
|
||||
)
|
||||
|
||||
|
||||
TRANSLATE_RELEASE_NOTES_PROMPT = Template(
|
||||
"""Translate the following release notes into $language.
|
||||
|
||||
$release_notes
|
||||
|
||||
Instructions:
|
||||
- Translate all section headers and descriptions naturally
|
||||
- Keep markdown formatting (##, ###, -, etc.) exactly as-is
|
||||
- Keep all proper nouns, code identifiers, class names, and technical terms unchanged
|
||||
(e.g. "CrewAI", "LiteAgent", "ChromaDB", "MCP", "@username")
|
||||
- Keep the ## Contributors section and GitHub usernames unchanged
|
||||
- Do not add or remove any content, only translate"""
|
||||
)
|
||||
|
||||
78
uv.lock
generated
78
uv.lock
generated
@@ -1471,48 +1471,48 @@ provides-extras = ["apify", "beautifulsoup4", "bedrock", "browserbase", "composi
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
version = "46.0.4"
|
||||
version = "46.0.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cffi", marker = "platform_python_implementation != 'PyPy'" },
|
||||
{ name = "typing-extensions", marker = "python_full_version < '3.11'" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/78/19/f748958276519adf6a0c1e79e7b8860b4830dda55ccdf29f2719b5fc499c/cryptography-46.0.4.tar.gz", hash = "sha256:bfd019f60f8abc2ed1b9be4ddc21cfef059c841d86d710bb69909a688cbb8f59", size = 749301, upload-time = "2026-01-28T00:24:37.379Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/60/04/ee2a9e8542e4fa2773b81771ff8349ff19cdd56b7258a0cc442639052edb/cryptography-46.0.5.tar.gz", hash = "sha256:abace499247268e3757271b2f1e244b36b06f8515cf27c4d49468fc9eb16e93d", size = 750064, upload-time = "2026-02-10T19:18:38.255Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/8d/99/157aae7949a5f30d51fcb1a9851e8ebd5c74bf99b5285d8bb4b8b9ee641e/cryptography-46.0.4-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:281526e865ed4166009e235afadf3a4c4cba6056f99336a99efba65336fd5485", size = 7173686, upload-time = "2026-01-28T00:23:07.515Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/87/91/874b8910903159043b5c6a123b7e79c4559ddd1896e38967567942635778/cryptography-46.0.4-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5f14fba5bf6f4390d7ff8f086c566454bff0411f6d8aa7af79c88b6f9267aecc", size = 4275871, upload-time = "2026-01-28T00:23:09.439Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/35/690e809be77896111f5b195ede56e4b4ed0435b428c2f2b6d35046fbb5e8/cryptography-46.0.4-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:47bcd19517e6389132f76e2d5303ded6cf3f78903da2158a671be8de024f4cd0", size = 4423124, upload-time = "2026-01-28T00:23:11.529Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/5b/a26407d4f79d61ca4bebaa9213feafdd8806dc69d3d290ce24996d3cfe43/cryptography-46.0.4-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:01df4f50f314fbe7009f54046e908d1754f19d0c6d3070df1e6268c5a4af09fa", size = 4277090, upload-time = "2026-01-28T00:23:13.123Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0c/d8/4bb7aec442a9049827aa34cee1aa83803e528fa55da9a9d45d01d1bb933e/cryptography-46.0.4-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5aa3e463596b0087b3da0dbe2b2487e9fc261d25da85754e30e3b40637d61f81", size = 4947652, upload-time = "2026-01-28T00:23:14.554Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/08/f83e2e0814248b844265802d081f2fac2f1cbe6cd258e72ba14ff006823a/cryptography-46.0.4-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:0a9ad24359fee86f131836a9ac3bffc9329e956624a2d379b613f8f8abaf5255", size = 4455157, upload-time = "2026-01-28T00:23:16.443Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/05/19d849cf4096448779d2dcc9bb27d097457dac36f7273ffa875a93b5884c/cryptography-46.0.4-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:dc1272e25ef673efe72f2096e92ae39dea1a1a450dd44918b15351f72c5a168e", size = 3981078, upload-time = "2026-01-28T00:23:17.838Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/89/f7bac81d66ba7cde867a743ea5b37537b32b5c633c473002b26a226f703f/cryptography-46.0.4-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:de0f5f4ec8711ebc555f54735d4c673fc34b65c44283895f1a08c2b49d2fd99c", size = 4276213, upload-time = "2026-01-28T00:23:19.257Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/9f/7133e41f24edd827020ad21b068736e792bc68eecf66d93c924ad4719fb3/cryptography-46.0.4-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:eeeb2e33d8dbcccc34d64651f00a98cb41b2dc69cef866771a5717e6734dfa32", size = 4912190, upload-time = "2026-01-28T00:23:21.244Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a6/f7/6d43cbaddf6f65b24816e4af187d211f0bc536a29961f69faedc48501d8e/cryptography-46.0.4-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:3d425eacbc9aceafd2cb429e42f4e5d5633c6f873f5e567077043ef1b9bbf616", size = 4454641, upload-time = "2026-01-28T00:23:22.866Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/4f/ebd0473ad656a0ac912a16bd07db0f5d85184924e14fc88feecae2492834/cryptography-46.0.4-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:91627ebf691d1ea3976a031b61fb7bac1ccd745afa03602275dda443e11c8de0", size = 4405159, upload-time = "2026-01-28T00:23:25.278Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/f7/7923886f32dc47e27adeff8246e976d77258fd2aa3efdd1754e4e323bf49/cryptography-46.0.4-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2d08bc22efd73e8854b0b7caff402d735b354862f1145d7be3b9c0f740fef6a0", size = 4666059, upload-time = "2026-01-28T00:23:26.766Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/eb/a7/0fca0fd3591dffc297278a61813d7f661a14243dd60f499a7a5b48acb52a/cryptography-46.0.4-cp311-abi3-win32.whl", hash = "sha256:82a62483daf20b8134f6e92898da70d04d0ef9a75829d732ea1018678185f4f5", size = 3026378, upload-time = "2026-01-28T00:23:28.317Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/12/652c84b6f9873f0909374864a57b003686c642ea48c84d6c7e2c515e6da5/cryptography-46.0.4-cp311-abi3-win_amd64.whl", hash = "sha256:6225d3ebe26a55dbc8ead5ad1265c0403552a63336499564675b29eb3184c09b", size = 3478614, upload-time = "2026-01-28T00:23:30.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/56/f7/f648fdbb61d0d45902d3f374217451385edc7e7768d1b03ff1d0e5ffc17b/cryptography-46.0.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:a9556ba711f7c23f77b151d5798f3ac44a13455cc68db7697a1096e6d0563cab", size = 7169583, upload-time = "2026-01-28T00:23:56.558Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/cc/8f3224cbb2a928de7298d6ed4790f5ebc48114e02bdc9559196bfb12435d/cryptography-46.0.4-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:8bf75b0259e87fa70bddc0b8b4078b76e7fd512fd9afae6c1193bcf440a4dbef", size = 4275419, upload-time = "2026-01-28T00:23:58.364Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/17/43/4a18faa7a872d00e4264855134ba82d23546c850a70ff209e04ee200e76f/cryptography-46.0.4-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3c268a3490df22270955966ba236d6bc4a8f9b6e4ffddb78aac535f1a5ea471d", size = 4419058, upload-time = "2026-01-28T00:23:59.867Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/64/6651969409821d791ba12346a124f55e1b76f66a819254ae840a965d4b9c/cryptography-46.0.4-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:812815182f6a0c1d49a37893a303b44eaac827d7f0d582cecfc81b6427f22973", size = 4278151, upload-time = "2026-01-28T00:24:01.731Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/20/0b/a7fce65ee08c3c02f7a8310cc090a732344066b990ac63a9dfd0a655d321/cryptography-46.0.4-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:a90e43e3ef65e6dcf969dfe3bb40cbf5aef0d523dff95bfa24256be172a845f4", size = 4939441, upload-time = "2026-01-28T00:24:03.175Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/a7/20c5701e2cd3e1dfd7a19d2290c522a5f435dd30957d431dcb531d0f1413/cryptography-46.0.4-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a05177ff6296644ef2876fce50518dffb5bcdf903c85250974fc8bc85d54c0af", size = 4451617, upload-time = "2026-01-28T00:24:05.403Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/00/dc/3e16030ea9aa47b63af6524c354933b4fb0e352257c792c4deeb0edae367/cryptography-46.0.4-cp38-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:daa392191f626d50f1b136c9b4cf08af69ca8279d110ea24f5c2700054d2e263", size = 3977774, upload-time = "2026-01-28T00:24:06.851Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/c8/ad93f14118252717b465880368721c963975ac4b941b7ef88f3c56bf2897/cryptography-46.0.4-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:e07ea39c5b048e085f15923511d8121e4a9dc45cee4e3b970ca4f0d338f23095", size = 4277008, upload-time = "2026-01-28T00:24:08.926Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/00/cf/89c99698151c00a4631fbfcfcf459d308213ac29e321b0ff44ceeeac82f1/cryptography-46.0.4-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:d5a45ddc256f492ce42a4e35879c5e5528c09cd9ad12420828c972951d8e016b", size = 4903339, upload-time = "2026-01-28T00:24:12.009Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/c3/c90a2cb358de4ac9309b26acf49b2a100957e1ff5cc1e98e6c4996576710/cryptography-46.0.4-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:6bb5157bf6a350e5b28aee23beb2d84ae6f5be390b2f8ee7ea179cda077e1019", size = 4451216, upload-time = "2026-01-28T00:24:13.975Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/2c/8d7f4171388a10208671e181ca43cdc0e596d8259ebacbbcfbd16de593da/cryptography-46.0.4-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:dd5aba870a2c40f87a3af043e0dee7d9eb02d4aff88a797b48f2b43eff8c3ab4", size = 4404299, upload-time = "2026-01-28T00:24:16.169Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/23/cbb2036e450980f65c6e0a173b73a56ff3bccd8998965dea5cc9ddd424a5/cryptography-46.0.4-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:93d8291da8d71024379ab2cb0b5c57915300155ad42e07f76bea6ad838d7e59b", size = 4664837, upload-time = "2026-01-28T00:24:17.629Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/21/f7433d18fe6d5845329cbdc597e30caf983229c7a245bcf54afecc555938/cryptography-46.0.4-cp38-abi3-win32.whl", hash = "sha256:0563655cb3c6d05fb2afe693340bc050c30f9f34e15763361cf08e94749401fc", size = 3009779, upload-time = "2026-01-28T00:24:20.198Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3a/6a/bd2e7caa2facffedf172a45c1a02e551e6d7d4828658c9a245516a598d94/cryptography-46.0.4-cp38-abi3-win_amd64.whl", hash = "sha256:fa0900b9ef9c49728887d1576fd8d9e7e3ea872fa9b25ef9b64888adc434e976", size = 3466633, upload-time = "2026-01-28T00:24:21.851Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/e0/f9c6c53e1f2a1c2507f00f2faba00f01d2f334b35b0fbfe5286715da2184/cryptography-46.0.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:766330cce7416c92b5e90c3bb71b1b79521760cdcfc3a6a1a182d4c9fab23d2b", size = 3476316, upload-time = "2026-01-28T00:24:24.144Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/27/7a/f8d2d13227a9a1a9fe9c7442b057efecffa41f1e3c51d8622f26b9edbe8f/cryptography-46.0.4-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c236a44acfb610e70f6b3e1c3ca20ff24459659231ef2f8c48e879e2d32b73da", size = 4216693, upload-time = "2026-01-28T00:24:25.758Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c5/de/3787054e8f7972658370198753835d9d680f6cd4a39df9f877b57f0dd69c/cryptography-46.0.4-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:8a15fb869670efa8f83cbffbc8753c1abf236883225aed74cd179b720ac9ec80", size = 4382765, upload-time = "2026-01-28T00:24:27.577Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8a/5f/60e0afb019973ba6a0b322e86b3d61edf487a4f5597618a430a2a15f2d22/cryptography-46.0.4-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:fdc3daab53b212472f1524d070735b2f0c214239df131903bae1d598016fa822", size = 4216066, upload-time = "2026-01-28T00:24:29.056Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/81/8e/bf4a0de294f147fee66f879d9bae6f8e8d61515558e3d12785dd90eca0be/cryptography-46.0.4-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:44cc0675b27cadb71bdbb96099cca1fa051cd11d2ade09e5cd3a2edb929ed947", size = 4382025, upload-time = "2026-01-28T00:24:30.681Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/79/f4/9ceb90cfd6a3847069b0b0b353fd3075dc69b49defc70182d8af0c4ca390/cryptography-46.0.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:be8c01a7d5a55f9a47d1888162b76c8f49d62b234d88f0ff91a9fbebe32ffbc3", size = 3406043, upload-time = "2026-01-28T00:24:32.236Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f7/81/b0bb27f2ba931a65409c6b8a8b358a7f03c0e46eceacddff55f7c84b1f3b/cryptography-46.0.5-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:351695ada9ea9618b3500b490ad54c739860883df6c1f555e088eaf25b1bbaad", size = 7176289, upload-time = "2026-02-10T19:17:08.274Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/9e/6b4397a3e3d15123de3b1806ef342522393d50736c13b20ec4c9ea6693a6/cryptography-46.0.5-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c18ff11e86df2e28854939acde2d003f7984f721eba450b56a200ad90eeb0e6b", size = 4275637, upload-time = "2026-02-10T19:17:10.53Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/63/e7/471ab61099a3920b0c77852ea3f0ea611c9702f651600397ac567848b897/cryptography-46.0.5-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4d7e3d356b8cd4ea5aff04f129d5f66ebdc7b6f8eae802b93739ed520c47c79b", size = 4424742, upload-time = "2026-02-10T19:17:12.388Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/53/a18500f270342d66bf7e4d9f091114e31e5ee9e7375a5aba2e85a91e0044/cryptography-46.0.5-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:50bfb6925eff619c9c023b967d5b77a54e04256c4281b0e21336a130cd7fc263", size = 4277528, upload-time = "2026-02-10T19:17:13.853Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/22/29/c2e812ebc38c57b40e7c583895e73c8c5adb4d1e4a0cc4c5a4fdab2b1acc/cryptography-46.0.5-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:803812e111e75d1aa73690d2facc295eaefd4439be1023fefc4995eaea2af90d", size = 4947993, upload-time = "2026-02-10T19:17:15.618Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6b/e7/237155ae19a9023de7e30ec64e5d99a9431a567407ac21170a046d22a5a3/cryptography-46.0.5-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3ee190460e2fbe447175cda91b88b84ae8322a104fc27766ad09428754a618ed", size = 4456855, upload-time = "2026-02-10T19:17:17.221Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2d/87/fc628a7ad85b81206738abbd213b07702bcbdada1dd43f72236ef3cffbb5/cryptography-46.0.5-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:f145bba11b878005c496e93e257c1e88f154d278d2638e6450d17e0f31e558d2", size = 3984635, upload-time = "2026-02-10T19:17:18.792Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/29/65b55622bde135aedf4565dc509d99b560ee4095e56989e815f8fd2aa910/cryptography-46.0.5-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:e9251e3be159d1020c4030bd2e5f84d6a43fe54b6c19c12f51cde9542a2817b2", size = 4277038, upload-time = "2026-02-10T19:17:20.256Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/36/45e76c68d7311432741faf1fbf7fac8a196a0a735ca21f504c75d37e2558/cryptography-46.0.5-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:47fb8a66058b80e509c47118ef8a75d14c455e81ac369050f20ba0d23e77fee0", size = 4912181, upload-time = "2026-02-10T19:17:21.825Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/1a/c1ba8fead184d6e3d5afcf03d569acac5ad063f3ac9fb7258af158f7e378/cryptography-46.0.5-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:4c3341037c136030cb46e4b1e17b7418ea4cbd9dd207e4a6f3b2b24e0d4ac731", size = 4456482, upload-time = "2026-02-10T19:17:25.133Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f9/e5/3fb22e37f66827ced3b902cf895e6a6bc1d095b5b26be26bd13c441fdf19/cryptography-46.0.5-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:890bcb4abd5a2d3f852196437129eb3667d62630333aacc13dfd470fad3aaa82", size = 4405497, upload-time = "2026-02-10T19:17:26.66Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/df/9d58bb32b1121a8a2f27383fabae4d63080c7ca60b9b5c88be742be04ee7/cryptography-46.0.5-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:80a8d7bfdf38f87ca30a5391c0c9ce4ed2926918e017c29ddf643d0ed2778ea1", size = 4667819, upload-time = "2026-02-10T19:17:28.569Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ea/ed/325d2a490c5e94038cdb0117da9397ece1f11201f425c4e9c57fe5b9f08b/cryptography-46.0.5-cp311-abi3-win32.whl", hash = "sha256:60ee7e19e95104d4c03871d7d7dfb3d22ef8a9b9c6778c94e1c8fcc8365afd48", size = 3028230, upload-time = "2026-02-10T19:17:30.518Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/5a/ac0f49e48063ab4255d9e3b79f5def51697fce1a95ea1370f03dc9db76f6/cryptography-46.0.5-cp311-abi3-win_amd64.whl", hash = "sha256:38946c54b16c885c72c4f59846be9743d699eee2b69b6988e0a00a01f46a61a4", size = 3480909, upload-time = "2026-02-10T19:17:32.083Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e2/fa/a66aa722105ad6a458bebd64086ca2b72cdd361fed31763d20390f6f1389/cryptography-46.0.5-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:4108d4c09fbbf2789d0c926eb4152ae1760d5a2d97612b92d508d96c861e4d31", size = 7170514, upload-time = "2026-02-10T19:17:56.267Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0f/04/c85bdeab78c8bc77b701bf0d9bdcf514c044e18a46dcff330df5448631b0/cryptography-46.0.5-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:7d1f30a86d2757199cb2d56e48cce14deddf1f9c95f1ef1b64ee91ea43fe2e18", size = 4275349, upload-time = "2026-02-10T19:17:58.419Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5c/32/9b87132a2f91ee7f5223b091dc963055503e9b442c98fc0b8a5ca765fab0/cryptography-46.0.5-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:039917b0dc418bb9f6edce8a906572d69e74bd330b0b3fea4f79dab7f8ddd235", size = 4420667, upload-time = "2026-02-10T19:18:00.619Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a1/a6/a7cb7010bec4b7c5692ca6f024150371b295ee1c108bdc1c400e4c44562b/cryptography-46.0.5-cp38-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ba2a27ff02f48193fc4daeadf8ad2590516fa3d0adeeb34336b96f7fa64c1e3a", size = 4276980, upload-time = "2026-02-10T19:18:02.379Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8e/7c/c4f45e0eeff9b91e3f12dbd0e165fcf2a38847288fcfd889deea99fb7b6d/cryptography-46.0.5-cp38-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:61aa400dce22cb001a98014f647dc21cda08f7915ceb95df0c9eaf84b4b6af76", size = 4939143, upload-time = "2026-02-10T19:18:03.964Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/37/19/e1b8f964a834eddb44fa1b9a9976f4e414cbb7aa62809b6760c8803d22d1/cryptography-46.0.5-cp38-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3ce58ba46e1bc2aac4f7d9290223cead56743fa6ab94a5d53292ffaac6a91614", size = 4453674, upload-time = "2026-02-10T19:18:05.588Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/ed/db15d3956f65264ca204625597c410d420e26530c4e2943e05a0d2f24d51/cryptography-46.0.5-cp38-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:420d0e909050490d04359e7fdb5ed7e667ca5c3c402b809ae2563d7e66a92229", size = 3978801, upload-time = "2026-02-10T19:18:07.167Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/41/e2/df40a31d82df0a70a0daf69791f91dbb70e47644c58581d654879b382d11/cryptography-46.0.5-cp38-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:582f5fcd2afa31622f317f80426a027f30dc792e9c80ffee87b993200ea115f1", size = 4276755, upload-time = "2026-02-10T19:18:09.813Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/33/45/726809d1176959f4a896b86907b98ff4391a8aa29c0aaaf9450a8a10630e/cryptography-46.0.5-cp38-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:bfd56bb4b37ed4f330b82402f6f435845a5f5648edf1ad497da51a8452d5d62d", size = 4901539, upload-time = "2026-02-10T19:18:11.263Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/99/0f/a3076874e9c88ecb2ecc31382f6e7c21b428ede6f55aafa1aa272613e3cd/cryptography-46.0.5-cp38-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:a3d507bb6a513ca96ba84443226af944b0f7f47dcc9a399d110cd6146481d24c", size = 4452794, upload-time = "2026-02-10T19:18:12.914Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/ef/ffeb542d3683d24194a38f66ca17c0a4b8bf10631feef44a7ef64e631b1a/cryptography-46.0.5-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:9f16fbdf4da055efb21c22d81b89f155f02ba420558db21288b3d0035bafd5f4", size = 4404160, upload-time = "2026-02-10T19:18:14.375Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/96/93/682d2b43c1d5f1406ed048f377c0fc9fc8f7b0447a478d5c65ab3d3a66eb/cryptography-46.0.5-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ced80795227d70549a411a4ab66e8ce307899fad2220ce5ab2f296e687eacde9", size = 4667123, upload-time = "2026-02-10T19:18:15.886Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/45/2d/9c5f2926cb5300a8eefc3f4f0b3f3df39db7f7ce40c8365444c49363cbda/cryptography-46.0.5-cp38-abi3-win32.whl", hash = "sha256:02f547fce831f5096c9a567fd41bc12ca8f11df260959ecc7c3202555cc47a72", size = 3010220, upload-time = "2026-02-10T19:18:17.361Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/ef/0c2f4a8e31018a986949d34a01115dd057bf536905dca38897bacd21fac3/cryptography-46.0.5-cp38-abi3-win_amd64.whl", hash = "sha256:556e106ee01aa13484ce9b0239bca667be5004efb0aabbed28d353df86445595", size = 3467050, upload-time = "2026-02-10T19:18:18.899Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/eb/dd/2d9fdb07cebdf3d51179730afb7d5e576153c6744c3ff8fded23030c204e/cryptography-46.0.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:3b4995dc971c9fb83c25aa44cf45f02ba86f71ee600d81091c2f0cbae116b06c", size = 3476964, upload-time = "2026-02-10T19:18:20.687Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/6f/6cc6cc9955caa6eaf83660b0da2b077c7fe8ff9950a3c5e45d605038d439/cryptography-46.0.5-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:bc84e875994c3b445871ea7181d424588171efec3e185dced958dad9e001950a", size = 4218321, upload-time = "2026-02-10T19:18:22.349Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/5d/c4da701939eeee699566a6c1367427ab91a8b7088cc2328c09dbee940415/cryptography-46.0.5-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:2ae6971afd6246710480e3f15824ed3029a60fc16991db250034efd0b9fb4356", size = 4381786, upload-time = "2026-02-10T19:18:24.529Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ac/97/a538654732974a94ff96c1db621fa464f455c02d4bb7d2652f4edc21d600/cryptography-46.0.5-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d861ee9e76ace6cf36a6a89b959ec08e7bc2493ee39d07ffe5acb23ef46d27da", size = 4217990, upload-time = "2026-02-10T19:18:25.957Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ae/11/7e500d2dd3ba891197b9efd2da5454b74336d64a7cc419aa7327ab74e5f6/cryptography-46.0.5-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:2b7a67c9cd56372f3249b39699f2ad479f6991e62ea15800973b956f4b73e257", size = 4381252, upload-time = "2026-02-10T19:18:27.496Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bc/58/6b3d24e6b9bc474a2dcdee65dfd1f008867015408a271562e4b690561a4d/cryptography-46.0.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:8456928655f856c6e1533ff59d5be76578a7157224dbd9ce6872f25055ab9ab7", size = 3407605, upload-time = "2026-02-10T19:18:29.233Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4195,7 +4195,7 @@ wheels = [
|
||||
|
||||
[[package]]
|
||||
name = "nltk"
|
||||
version = "3.9.2"
|
||||
version = "3.9.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "click" },
|
||||
@@ -4203,9 +4203,9 @@ dependencies = [
|
||||
{ name = "regex" },
|
||||
{ name = "tqdm" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f9/76/3a5e4312c19a028770f86fd7c058cf9f4ec4321c6cf7526bab998a5b683c/nltk-3.9.2.tar.gz", hash = "sha256:0f409e9b069ca4177c1903c3e843eef90c7e92992fa4931ae607da6de49e1419", size = 2887629, upload-time = "2025-10-01T07:19:23.764Z" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e1/8f/915e1c12df07c70ed779d18ab83d065718a926e70d3ea33eb0cd66ffb7c0/nltk-3.9.3.tar.gz", hash = "sha256:cb5945d6424a98d694c2b9a0264519fab4363711065a46aa0ae7a2195b92e71f", size = 2923673, upload-time = "2026-02-24T12:05:53.833Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/60/90/81ac364ef94209c100e12579629dc92bf7a709a84af32f8c551b02c07e94/nltk-3.9.2-py3-none-any.whl", hash = "sha256:1e209d2b3009110635ed9709a67a1a3e33a10f799490fa71cf4bec218c11c88a", size = 1513404, upload-time = "2025-10-01T07:19:21.648Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/7e/9af5a710a1236e4772de8dfcc6af942a561327bb9f42b5b4a24d0cf100fd/nltk-3.9.3-py3-none-any.whl", hash = "sha256:60b3db6e9995b3dd976b1f0fa7dec22069b2677e759c28eb69b62ddd44870522", size = 1525385, upload-time = "2026-02-24T12:05:46.54Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
Reference in New Issue
Block a user