Compare commits

..

4 Commits

Author SHA1 Message Date
Alex Bäuerle 240db83901 Deploy website - based on cd58194d2a 2024-04-29 10:04:03 -07:00
Alex Bäuerle 1896aa92b3 Deploy website - based on 9fbfdb7724 2024-04-26 14:41:47 -07:00
Alex Bäuerle 4b82b71d44 Deploy website - based on 9fbfdb7724 2024-04-26 14:29:58 -07:00
Alex Bäuerle ce2677d794 Deploy website - based on 055f2dda4a 2024-04-26 14:19:50 -07:00
1161 changed files with 2412 additions and 154804 deletions
-1
View File
@@ -1 +0,0 @@
The files in this directory configure a development container for GitHub Codespaces.
-15
View File
@@ -1,15 +0,0 @@
{
"name": "OpenHands Codespaces",
"image": "mcr.microsoft.com/devcontainers/universal",
"customizations":{
"vscode":{
"extensions": [
"ms-python.python"
]
}
},
"onCreateCommand": "sh ./.devcontainer/on_create.sh",
"postCreateCommand": "make build",
"postStartCommand": "USE_HOST_NETWORK=True nohup bash -c 'make run &'"
}
-6
View File
@@ -1,6 +0,0 @@
#!/usr/bin/env bash
sudo apt update
sudo apt install -y netcat
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt install -y python3.12
curl -sSL https://install.python-poetry.org | python3.12 -
-5
View File
@@ -1,5 +0,0 @@
frontend/node_modules
config.toml
.envrc
.env
.git
-1
View File
@@ -1 +0,0 @@
*.ipynb linguist-vendored
-19
View File
@@ -1,19 +0,0 @@
codecov:
notify:
wait_for_ci: true
# our project is large, so 6 builds are typically uploaded. this waits till 5/6
# See https://docs.codecov.com/docs/notifications#section-preventing-notifications-until-after-n-builds
after_n_builds: 5
coverage:
status:
patch:
default:
threshold: 100% # allow patch coverage to be lower than project coverage by any amount
project:
default:
threshold: 5% # allow project coverage to drop at most 5%
comment: false
github_checks:
annotations: false
-61
View File
@@ -1,61 +0,0 @@
name: Bug
description: Report a problem with OpenHands
title: '[Bug]: '
labels: ['bug']
body:
- type: markdown
attributes:
value: Thank you for taking the time to fill out this bug report. Please provide as much information as possible to help us understand and address the issue effectively.
- type: checkboxes
attributes:
label: Is there an existing issue for the same bug?
description: Please check if an issue already exists for the bug you encountered.
options:
- label: I have checked the existing issues.
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug and reproduction steps
description: Provide a description of the issue along with any reproduction steps.
validations:
required: true
- type: dropdown
id: installation
attributes:
label: OpenHands Installation
description: How are you running OpenHands?
options:
- Docker command in README
- Development workflow
- app.all-hands.dev
- Other
default: 0
- type: input
id: openhands-version
attributes:
label: OpenHands Version
description: What version of OpenHands are you using?
placeholder: ex. 0.9.8, main, etc.
- type: dropdown
id: os
attributes:
label: Operating System
options:
- MacOS
- Linux
- WSL on Windows
- type: textarea
id: additional-context
attributes:
label: Logs, Errors, Screenshots, and Additional Context
description: Please provide any additional information you think might help. If you want to share the chat history
you can click the thumbs-down (👎) button above the input field and you will get a shareable link
(you can also click thumbs up when things are going well of course!). LLM logs will be stored in the
`logs/llm/default` folder. Please add any additional context about the problem here.
-18
View File
@@ -1,18 +0,0 @@
---
name: Feature Request
about: Suggest an idea for OpenHands features
title: ''
labels: 'enhancement'
assignees: ''
---
**What problem or use case are you trying to solve?**
**Describe the UX of the solution you'd like**
**Do you have thoughts on the technical implementation?**
**Describe alternatives you've considered**
**Additional context**
@@ -1,18 +0,0 @@
---
name: Technical Proposal
about: Propose a new architecture or technology
title: ''
labels: 'proposal'
assignees: ''
---
**Summary**
**Motivation**
**Technical Design**
**Alternatives to Consider**
**Additional context**
-69
View File
@@ -1,69 +0,0 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 1
groups:
# put packages in their own group if they have a history of breaking the build or needing to be reverted
pre-commit:
patterns:
- "pre-commit"
llama:
patterns:
- "llama*"
chromadb:
patterns:
- "chromadb"
security-all:
applies-to: "security-updates"
patterns:
- "*"
version-all:
applies-to: "version-updates"
patterns:
- "*"
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "daily"
open-pull-requests-limit: 1
groups:
docusaurus:
patterns:
- "*docusaurus*"
eslint:
patterns:
- "*eslint*"
security-all:
applies-to: "security-updates"
patterns:
- "*"
version-all:
applies-to: "version-updates"
patterns:
- "*"
- package-ecosystem: "npm"
directory: "/docs"
schedule:
interval: "weekly"
day: "wednesday"
open-pull-requests-limit: 1
groups:
docusaurus:
patterns:
- "*docusaurus*"
eslint:
patterns:
- "*eslint*"
security-all:
applies-to: "security-updates"
patterns:
- "*"
version-all:
applies-to: "version-updates"
patterns:
- "*"
-11
View File
@@ -1,11 +0,0 @@
**End-user friendly description of the problem this fixes or functionality that this introduces**
- [ ] Include this change in the Release Notes. If checked, you must provide an **end-user friendly** description for your change below
---
**Give a summary of what the PR does, explaining any non-trivial design decisions**
---
**Link of any specific issues this addresses**
-69
View File
@@ -1,69 +0,0 @@
# Workflow that cleans up outdated and old workflows to prevent out of disk issues
name: Delete old workflow runs
# This workflow is currently only triggered manually
on:
workflow_dispatch:
inputs:
days:
description: 'Days-worth of runs to keep for each workflow'
required: true
default: '30'
minimum_runs:
description: 'Minimum runs to keep for each workflow'
required: true
default: '10'
delete_workflow_pattern:
description: 'Name or filename of the workflow (if not set, all workflows are targeted)'
required: false
delete_workflow_by_state_pattern:
description: 'Filter workflows by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually'
required: true
default: "ALL"
type: choice
options:
- "ALL"
- active
- deleted
- disabled_inactivity
- disabled_manually
delete_run_by_conclusion_pattern:
description: 'Remove runs based on conclusion: action_required, cancelled, failure, skipped, success'
required: true
default: 'ALL'
type: choice
options:
- 'ALL'
- 'Unsuccessful: action_required,cancelled,failure,skipped'
- action_required
- cancelled
- failure
- skipped
- success
dry_run:
description: 'Logs simulated changes, no deletions are performed'
required: false
jobs:
del_runs:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
steps:
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: ${{ github.event.inputs.minimum_runs }}
delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }}
delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }}
delete_run_by_conclusion_pattern: >-
${{
startsWith(github.event.inputs.delete_run_by_conclusion_pattern, 'Unsuccessful:')
&& 'action_required,cancelled,failure,skipped'
|| github.event.inputs.delete_run_by_conclusion_pattern
}}
dry_run: ${{ github.event.inputs.dry_run }}
-74
View File
@@ -1,74 +0,0 @@
# Workflow that builds and deploys the documentation website
name: Deploy Docs to GitHub Pages
# * Always run on "main"
# * Run on PRs that target the "main" branch and have changes in the "docs" folder or this workflow
on:
push:
branches:
- main
pull_request:
paths:
- 'docs/**'
- '.github/workflows/deploy-docs.yml'
branches:
- main
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
# Build the documentation website
build:
if: github.repository == 'All-Hands-AI/OpenHands'
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: docs/package-lock.json
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Generate Python Docs
run: rm -rf docs/modules/python && pip install pydoc-markdown && pydoc-markdown
- name: Install dependencies
run: cd docs && npm ci
- name: Build website
run: cd docs && npm run build
- name: Upload Build Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
# Deploy the documentation website
deploy:
if: github.ref == 'refs/heads/main' && github.repository == 'All-Hands-AI/OpenHands'
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
# This job only runs on "main" so only run one of these jobs at a time
# otherwise it will fail if one is already running
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
-61
View File
@@ -1,61 +0,0 @@
# Workflow that uses the DummyAgent to run a simple task
name: Run E2E test with dummy agent
# Always run on "main"
# Always run on PRs
on:
push:
branches:
- main
pull_request:
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'poetry'
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
- name: Build Environment
run: make build
- name: Run tests
run: |
set -e
SANDBOX_FORCE_REBUILD_RUNTIME=True poetry run python3 openhands/core/main.py -t "do a flip" -d ./workspace/ -c DummyAgent
- name: Check exit code
run: |
if [ $? -ne 0 ]; then
echo "Test failed"
exit 1
else
echo "Test passed"
fi
-160
View File
@@ -1,160 +0,0 @@
name: Run Evaluation
on:
pull_request:
types: [labeled]
schedule:
- cron: "0 1 * * *" # Run daily at 1 AM UTC
workflow_dispatch:
inputs:
reason:
description: "Reason for manual trigger"
required: true
default: ""
env:
N_PROCESSES: 32 # Global configuration for number of parallel processes for evaluation
jobs:
run-evaluation:
if: github.event.label.name == 'eval-this' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
pull-requests: "write"
issues: "write"
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Comment on PR if 'eval-this' label is present
if: github.event_name == 'pull_request' && github.event.label.name == 'eval-this'
uses: KeisukeYamashita/create-comment@v1
with:
unique: false
comment: |
Hi! I started running the evaluation on your PR. You will receive a comment with the results shortly.
- name: Install Python dependencies using Poetry
run: poetry install
- name: Configure config.toml for evaluation
env:
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_LLM_API_KEY }}
run: |
echo "[llm.eval]" > config.toml
echo "model = \"deepseek/deepseek-chat\"" >> config.toml
echo "api_key = \"$DEEPSEEK_API_KEY\"" >> config.toml
echo "temperature = 0.0" >> config.toml
- name: Run integration test evaluation
env:
ALLHANDS_API_KEY: ${{ secrets.ALLHANDS_EVAL_RUNTIME_API_KEY }}
RUNTIME: remote
SANDBOX_REMOTE_RUNTIME_API_URL: https://runtime.eval.all-hands.dev
EVAL_DOCKER_IMAGE_PREFIX: us-central1-docker.pkg.dev/evaluation-092424/swe-bench-images
run: |
poetry run ./evaluation/integration_tests/scripts/run_infer.sh llm.eval HEAD CodeActAgent '' $N_PROCESSES
# get evaluation report
REPORT_FILE=$(find evaluation/evaluation_outputs/outputs/integration_tests/CodeActAgent/deepseek-chat_maxiter_10_N* -name "report.md" -type f | head -n 1)
echo "REPORT_FILE: $REPORT_FILE"
echo "INTEGRATION_TEST_REPORT<<EOF" >> $GITHUB_ENV
cat $REPORT_FILE >> $GITHUB_ENV
echo >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Run SWE-Bench evaluation
env:
ALLHANDS_API_KEY: ${{ secrets.ALLHANDS_EVAL_RUNTIME_API_KEY }}
RUNTIME: remote
SANDBOX_REMOTE_RUNTIME_API_URL: https://runtime.eval.all-hands.dev
EVAL_DOCKER_IMAGE_PREFIX: us-central1-docker.pkg.dev/evaluation-092424/swe-bench-images
run: |
poetry run ./evaluation/swe_bench/scripts/run_infer.sh llm.eval HEAD CodeActAgent 300 30 $N_PROCESSES "princeton-nlp/SWE-bench_Lite" test
OUTPUT_FOLDER=$(find evaluation/evaluation_outputs/outputs/princeton-nlp__SWE-bench_Lite-test/CodeActAgent -name "deepseek-chat_maxiter_50_N_*-no-hint-run_1" -type d | head -n 1)
echo "OUTPUT_FOLDER for SWE-bench evaluation: $OUTPUT_FOLDER"
poetry run ./evaluation/swe_bench/scripts/eval_infer_remote.sh $OUTPUT_FOLDER/output.jsonl $N_PROCESSES "princeton-nlp/SWE-bench_Lite" test
poetry run ./evaluation/swe_bench/scripts/eval/summarize_outputs.py $OUTPUT_FOLDER/output.jsonl > summarize_outputs.log 2>&1
echo "SWEBENCH_REPORT<<EOF" >> $GITHUB_ENV
cat summarize_outputs.log >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create tar.gz of evaluation outputs
run: |
TIMESTAMP=$(date +'%y-%m-%d-%H-%M')
tar -czvf evaluation_outputs_${TIMESTAMP}.tar.gz evaluation/evaluation_outputs/outputs
- name: Upload evaluation results as artifact
uses: actions/upload-artifact@v4
id: upload_results_artifact
with:
name: evaluation-outputs
path: evaluation_outputs_*.tar.gz
- name: Get artifact URL
run: echo "ARTIFACT_URL=${{ steps.upload_results_artifact.outputs.artifact-url }}" >> $GITHUB_ENV
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_RESEARCH_OBJECT_CREATOR_SA_KEY }}
- name: Set timestamp and trigger reason
run: |
echo "TIMESTAMP=$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "TRIGGER_REASON=pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "schedule" ]]; then
echo "TRIGGER_REASON=schedule" >> $GITHUB_ENV
else
echo "TRIGGER_REASON=manual-${{ github.event.inputs.reason }}" >> $GITHUB_ENV
fi
- name: Upload evaluation results to Google Cloud Storage
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'evaluation/evaluation_outputs/outputs'
destination: 'openhands-oss-eval-results/${{ env.TIMESTAMP }}-${{ env.TRIGGER_REASON }}'
- name: Comment with evaluation results and artifact link
id: create_comment
uses: KeisukeYamashita/create-comment@v1
with:
number: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 4504 }}
unique: false
comment: |
Trigger by: ${{ github.event_name == 'pull_request' && format('Pull Request (eval-this label on PR #{0})', github.event.pull_request.number) || github.event_name == 'schedule' && 'Daily Schedule' || format('Manual Trigger: {0}', github.event.inputs.reason) }}
Commit: ${{ github.sha }}
**SWE-Bench Evaluation Report**
${{ env.SWEBENCH_REPORT }}
---
**Integration Tests Evaluation Report**
${{ env.INTEGRATION_TEST_REPORT }}
---
You can download the full evaluation outputs [here](${{ env.ARTIFACT_URL }}).
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: 'C07SVQSCR6F'
slack-message: "*Evaluation Trigger:* ${{ github.event_name == 'pull_request' && format('Pull Request (eval-this label on PR #{0})', github.event.pull_request.number) || github.event_name == 'schedule' && 'Daily Schedule' || format('Manual Trigger: {0}', github.event.inputs.reason) }}\n\nLink to summary: [here](https://github.com/${{ github.repository }}/issues/${{ github.event_name == 'pull_request' && github.event.pull_request.number || 4504 }}#issuecomment-${{ steps.create_comment.outputs.comment-id }})"
env:
SLACK_BOT_TOKEN: ${{ secrets.EVAL_NOTIF_SLACK_BOT_TOKEN }}
-44
View File
@@ -1,44 +0,0 @@
# Workflow that runs frontend unit tests
name: Run Frontend Unit Tests
# * Always run on "main"
# * Run on PRs that have changes in the "frontend" folder or this workflow
on:
push:
branches:
- main
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/fe-unit-tests.yml'
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
# Run frontend unit tests
fe-test:
name: FE Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
working-directory: ./frontend
run: npm ci
- name: Run tests and collect coverage
working-directory: ./frontend
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
-445
View File
@@ -1,445 +0,0 @@
# Workflow that builds, tests and then pushes the OpenHands and runtime docker images to the ghcr.io repository
name: Docker
# Always run on "main"
# Always run on tags
# Always run on PRs
# Can also be triggered manually
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
inputs:
reason:
description: 'Reason for manual trigger'
required: true
default: ''
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
env:
BASE_IMAGE_FOR_HASH_EQUIVALENCE_TEST: nikolaik/python-nodejs:python3.12-nodejs22
RELEVANT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
# Builds the OpenHands Docker images
ghcr_build_app:
name: Build App Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
hash_from_app_image: ${{ steps.get_hash_in_app_image.outputs.hash_from_app_image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
with:
image: tonistiigi/binfmt:latest
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push app image
if: "!github.event.pull_request.head.repo.fork"
run: |
./containers/build.sh -i openhands -o ${{ github.repository_owner }} --push
- name: Build app image
if: "github.event.pull_request.head.repo.fork"
run: |
./containers/build.sh -i openhands -o ${{ github.repository_owner }} --load
- name: Get hash in App Image
id: get_hash_in_app_image
run: |
# Lowercase the repository owner
export REPO_OWNER=${{ github.repository_owner }}
REPO_OWNER=$(echo $REPO_OWNER | tr '[:upper:]' '[:lower:]')
# Run the build script in the app image
docker run -e SANDBOX_USER_ID=0 -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/${REPO_OWNER}/openhands:${{ env.RELEVANT_SHA }} /bin/bash -c "mkdir -p containers/runtime; python3 openhands/runtime/utils/runtime_build.py --base_image ${{ env.BASE_IMAGE_FOR_HASH_EQUIVALENCE_TEST }} --build_folder containers/runtime --force_rebuild" 2>&1 | tee docker-outputs.txt
# Get the hash from the build script
hash_from_app_image=$(cat docker-outputs.txt | grep "Hash for docker build directory" | awk -F "): " '{print $2}' | uniq | head -n1)
echo "hash_from_app_image=$hash_from_app_image" >> $GITHUB_OUTPUT
echo "Hash from app image: $hash_from_app_image"
# Builds the runtime Docker images
ghcr_build_runtime:
name: Build Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
base_image:
- image: 'nikolaik/python-nodejs:python3.12-nodejs22'
tag: nikolaik
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
with:
image: tonistiigi/binfmt:latest
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Create source distribution and Dockerfile
run: poetry run python3 openhands/runtime/utils/runtime_build.py --base_image ${{ matrix.base_image.image }} --build_folder containers/runtime --force_rebuild
- name: Build and push runtime image ${{ matrix.base_image.image }}
if: github.event.pull_request.head.repo.fork != true
run: |
./containers/build.sh -i runtime -o ${{ github.repository_owner }} --push -t ${{ matrix.base_image.tag }}
# Forked repos can't push to GHCR, so we need to upload the image as an artifact
- name: Build runtime image ${{ matrix.base_image.image }} for fork
if: github.event.pull_request.head.repo.fork
uses: docker/build-push-action@v6
with:
tags: ghcr.io/all-hands-ai/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image.tag }}
outputs: type=docker,dest=/tmp/runtime-${{ matrix.base_image.tag }}.tar
context: containers/runtime
- name: Upload runtime image for fork
if: github.event.pull_request.head.repo.fork
uses: actions/upload-artifact@v4
with:
name: runtime-${{ matrix.base_image.tag }}
path: /tmp/runtime-${{ matrix.base_image.tag }}.tar
verify_hash_equivalence_in_runtime_and_app:
name: Verify Hash Equivalence in Runtime and Docker images
runs-on: ubuntu-latest
needs: [ghcr_build_runtime, ghcr_build_app]
strategy:
fail-fast: false
matrix:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Get hash in App Image
run: |
echo "Hash from app image: ${{ needs.ghcr_build_app.outputs.hash_from_app_image }}"
echo "hash_from_app_image=${{ needs.ghcr_build_app.outputs.hash_from_app_image }}" >> $GITHUB_ENV
- name: Get hash using code (development mode)
run: |
mkdir -p containers/runtime
poetry run python3 openhands/runtime/utils/runtime_build.py --base_image ${{ env.BASE_IMAGE_FOR_HASH_EQUIVALENCE_TEST }} --build_folder containers/runtime --force_rebuild > output.txt 2>&1
hash_from_code=$(cat output.txt | grep "Hash for docker build directory" | awk -F "): " '{print $2}' | uniq | head -n1)
echo "hash_from_code=$hash_from_code" >> $GITHUB_ENV
- name: Compare hashes
run: |
echo "Hash from App Image: ${{ env.hash_from_app_image }}"
echo "Hash from Code: ${{ env.hash_from_code }}"
if [ "${{ env.hash_from_app_image }}" = "${{ env.hash_from_code }}" ]; then
echo "Hashes match!"
else
echo "Hashes do not match!"
exit 1
fi
# Run unit tests with the EventStream runtime Docker images as root
test_runtime_root:
name: RT Unit Tests (Root)
needs: [ghcr_build_runtime]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
# Forked repos can't push to GHCR, so we need to download the image as an artifact
- name: Download runtime image for fork
if: github.event.pull_request.head.repo.fork
uses: actions/download-artifact@v4
with:
name: runtime-${{ matrix.base_image }}
path: /tmp
- name: Load runtime image for fork
if: github.event.pull_request.head.repo.fork
run: |
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Run runtime tests
run: |
# We install pytest-xdist in order to run tests across CPUs
poetry run pip install pytest-xdist
# Install to be able to retry on failures for flaky tests
poetry run pip install pytest-rerunfailures
image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]')
TEST_RUNTIME=eventstream \
SANDBOX_USER_ID=$(id -u) \
SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \
TEST_IN_CI=true \
RUN_AS_OPENHANDS=false \
poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Run unit tests with the EventStream runtime Docker images as openhands user
test_runtime_oh:
name: RT Unit Tests (openhands)
runs-on: ubuntu-latest
needs: [ghcr_build_runtime]
strategy:
matrix:
base_image: ['nikolaik']
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
# Forked repos can't push to GHCR, so we need to download the image as an artifact
- name: Download runtime image for fork
if: github.event.pull_request.head.repo.fork
uses: actions/download-artifact@v4
with:
name: runtime-${{ matrix.base_image }}
path: /tmp
- name: Load runtime image for fork
if: github.event.pull_request.head.repo.fork
run: |
docker load --input /tmp/runtime-${{ matrix.base_image }}.tar
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: make install-python-dependencies
- name: Run runtime tests
run: |
# We install pytest-xdist in order to run tests across CPUs
poetry run pip install pytest-xdist
# Install to be able to retry on failures for flaky tests
poetry run pip install pytest-rerunfailures
image_name=ghcr.io/${{ github.repository_owner }}/runtime:${{ env.RELEVANT_SHA }}-${{ matrix.base_image }}
image_name=$(echo $image_name | tr '[:upper:]' '[:lower:]')
TEST_RUNTIME=eventstream \
SANDBOX_USER_ID=$(id -u) \
SANDBOX_RUNTIME_CONTAINER_IMAGE=$image_name \
TEST_IN_CI=true \
RUN_AS_OPENHANDS=true \
poetry run pytest -n 3 -raRs --reruns 2 --reruns-delay 5 --cov=openhands --cov-report=xml -s ./tests/runtime
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# The two following jobs (named identically) are to check whether all the runtime tests have passed as the
# "All Runtime Tests Passed" is a required job for PRs to merge
# Due to this bug: https://github.com/actions/runner/issues/2566, we want to create a job that runs when the
# prerequisites have been cancelled or failed so merging is disallowed, otherwise Github considers "skipped" as "success"
runtime_tests_check_success:
name: All Runtime Tests Passed
if: ${{ !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
needs: [test_runtime_root, test_runtime_oh, verify_hash_equivalence_in_runtime_and_app]
steps:
- name: All tests passed
run: echo "All runtime tests have passed successfully!"
runtime_tests_check_fail:
name: All Runtime Tests Passed
if: ${{ cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
needs: [test_runtime_root, test_runtime_oh, verify_hash_equivalence_in_runtime_and_app]
steps:
- name: Some tests failed
run: |
echo "Some runtime tests failed or were cancelled"
exit 1
update_pr_description:
name: Update PR Description
if: github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]'
needs: [ghcr_build_runtime]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get short SHA
id: short_sha
run: echo "SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
- name: Update PR Description
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
SHORT_SHA: ${{ steps.short_sha.outputs.SHORT_SHA }}
run: |
echo "updating PR description"
DOCKER_RUN_COMMAND="docker run -it --rm \
-p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
--add-host host.docker.internal:host-gateway \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:$SHORT_SHA-nikolaik \
--name openhands-app-$SHORT_SHA \
docker.all-hands.dev/all-hands-ai/openhands:$SHORT_SHA"
PR_BODY=$(gh pr view $PR_NUMBER --json body --jq .body)
if echo "$PR_BODY" | grep -q "To run this PR locally, use the following command:"; then
UPDATED_PR_BODY=$(echo "${PR_BODY}" | sed -E "s|docker run -it --rm.*|$DOCKER_RUN_COMMAND|")
else
UPDATED_PR_BODY="${PR_BODY}
---
To run this PR locally, use the following command:
\`\`\`
$DOCKER_RUN_COMMAND
\`\`\`"
fi
echo "updated body: $UPDATED_PR_BODY"
gh pr edit $PR_NUMBER --body "$UPDATED_PR_BODY"
-54
View File
@@ -1,54 +0,0 @@
# Workflow that runs lint on the frontend and python code
name: Lint
# The jobs in this workflow are required, so they must run at all times
# Always run on "main"
# Always run on PRs
on:
push:
branches:
- main
pull_request:
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
# Run lint on the frontend code
lint-frontend:
name: Lint frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd frontend
npm install --frozen-lockfile
- name: Lint
run: |
cd frontend
npm run lint
# Run lint on the python code
lint-python:
name: Lint python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: Install pre-commit
run: pip install pre-commit==3.7.0
- name: Run pre-commit hooks
run: pre-commit run --files openhands/**/* evaluation/**/* tests/**/* --show-diff-on-failure --config ./dev_config/python/.pre-commit-config.yaml
-267
View File
@@ -1,267 +0,0 @@
name: Auto-Fix Tagged Issue with OpenHands
on:
workflow_call:
inputs:
max_iterations:
required: false
type: number
default: 50
macro:
required: false
type: string
default: "@openhands-agent"
secrets:
LLM_MODEL:
required: true
LLM_API_KEY:
required: true
LLM_BASE_URL:
required: false
PAT_TOKEN:
required: true
PAT_USERNAME:
required: true
issues:
types: [labeled]
pull_request:
types: [labeled]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
auto-fix:
if: |
github.event_name == 'workflow_call' ||
github.event.label.name == 'fix-me' ||
github.event.label.name == 'fix-me-experimental' ||
(
((github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment') &&
startsWith(github.event.comment.body, inputs.macro || '@openhands-agent') &&
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER')
) ||
(github.event_name == 'pull_request_review' &&
startsWith(github.event.review.body, inputs.macro || '@openhands-agent') &&
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER')
)
)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Get latest versions and create requirements.txt
run: |
python -m pip index versions openhands-ai > openhands_versions.txt
OPENHANDS_VERSION=$(head -n 1 openhands_versions.txt | awk '{print $2}' | tr -d '()')
echo "openhands-ai==${OPENHANDS_VERSION}" >> requirements.txt
cat requirements.txt
- name: Cache pip dependencies
if: github.event.label.name != 'fix-me-experimental'
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}/lib/python3.12/site-packages/*
key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }}
- name: Check required environment variables
env:
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
PAT_USERNAME: ${{ secrets.PAT_USERNAME }}
run: |
required_vars=("LLM_MODEL" "LLM_API_KEY" "PAT_TOKEN" "PAT_USERNAME")
for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
echo "Error: Required environment variable $var is not set."
exit 1
fi
done
- name: Set environment variables
run: |
if [ -n "${{ github.event.review.body }}" ]; then
echo "ISSUE_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "ISSUE_TYPE=pr" >> $GITHUB_ENV
elif [ -n "${{ github.event.issue.pull_request }}" ]; then
echo "ISSUE_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV
echo "ISSUE_TYPE=pr" >> $GITHUB_ENV
elif [ -n "${{ github.event.pull_request.number }}" ]; then
echo "ISSUE_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "ISSUE_TYPE=pr" >> $GITHUB_ENV
else
echo "ISSUE_NUMBER=${{ github.event.issue.number }}" >> $GITHUB_ENV
echo "ISSUE_TYPE=issue" >> $GITHUB_ENV
fi
if [ -n "${{ github.event.review.body }}" ]; then
echo "COMMENT_ID=${{ github.event.review.id || 'None' }}" >> $GITHUB_ENV
else
echo "COMMENT_ID=${{ github.event.comment.id || 'None' }}" >> $GITHUB_ENV
fi
echo "MAX_ITERATIONS=${{ inputs.max_iterations || 50 }}" >> $GITHUB_ENV
echo "SANDBOX_ENV_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Comment on issue with start message
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueType = process.env.ISSUE_TYPE;
github.rest.issues.createComment({
issue_number: ${{ env.ISSUE_NUMBER }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `[OpenHands](https://github.com/All-Hands-AI/OpenHands) started fixing the ${issueType}! You can monitor the progress [here](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).`
});
- name: Install OpenHands
run: |
if [ "${{ github.event.label.name }}" == "fix-me-experimental" ]; then
python -m pip install --upgrade pip
pip install git+https://github.com/all-hands-ai/openhands.git
else
python -m pip install --upgrade -r requirements.txt
fi
- name: Attempt to resolve issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
PYTHONPATH: ""
run: |
cd /tmp && python -m openhands.resolver.resolve_issue \
--repo ${{ github.repository }} \
--issue-number ${{ env.ISSUE_NUMBER }} \
--issue-type ${{ env.ISSUE_TYPE }} \
--max-iterations ${{ env.MAX_ITERATIONS }} \
--comment-id ${{ env.COMMENT_ID }}
- name: Check resolution result
id: check_result
run: |
if cd /tmp && grep -q '"success":true' output/output.jsonl; then
echo "RESOLUTION_SUCCESS=true" >> $GITHUB_OUTPUT
else
echo "RESOLUTION_SUCCESS=false" >> $GITHUB_OUTPUT
fi
- name: Upload output.jsonl as artifact
uses: actions/upload-artifact@v4
if: always() # Upload even if the previous steps fail
with:
name: resolver-output
path: /tmp/output/output.jsonl
retention-days: 30 # Keep the artifact for 30 days
- name: Create draft PR or push branch
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
PYTHONPATH: ""
run: |
if [ "${{ steps.check_result.outputs.RESOLUTION_SUCCESS }}" == "true" ]; then
cd /tmp && python -m openhands.resolver.send_pull_request \
--issue-number ${{ env.ISSUE_NUMBER }} \
--pr-type draft | tee pr_result.txt && \
grep "draft created" pr_result.txt | sed 's/.*\///g' > pr_number.txt
else
cd /tmp && python -m openhands.resolver.send_pull_request \
--issue-number ${{ env.ISSUE_NUMBER }} \
--pr-type branch \
--send-on-failure | tee branch_result.txt && \
grep "branch created" branch_result.txt | sed 's/.*\///g; s/.expand=1//g' > branch_name.txt
fi
- name: Comment on issue
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs');
const issueNumber = ${{ env.ISSUE_NUMBER }};
const success = ${{ steps.check_result.outputs.RESOLUTION_SUCCESS }};
let prNumber = '';
let branchName = '';
let logContent = '';
const noChangesMessage = `No changes to commit for issue #${issueNumber}. Skipping commit.`;
try {
if (success){
logContent = fs.readFileSync('/tmp/pr_result.txt', 'utf8').trim();
} else {
logContent = fs.readFileSync('/tmp/branch_result.txt', 'utf8').trim();
}
} catch (error) {
console.error('Error reading results file:', error);
}
try {
if (success) {
prNumber = fs.readFileSync('/tmp/pr_number.txt', 'utf8').trim();
} else {
branchName = fs.readFileSync('/tmp/branch_name.txt', 'utf8').trim();
}
} catch (error) {
console.error('Error reading file:', error);
}
if (logContent.includes(noChangesMessage)) {
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The workflow to fix this issue encountered an error. Openhands failed to create any code changes.`
});
} else if (success && prNumber) {
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `A potential fix has been generated and a draft PR #${prNumber} has been created. Please review the changes.`
});
} else if (!success && branchName) {
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named '${branchName}' has been created with the attempted changes. You can view the branch [here](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${branchName}). Manual intervention may be required.`
});
} else {
github.rest.issues.createComment({
issue_number: issueNumber,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The workflow to fix this issue encountered an error. Please check the [workflow logs](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) for more information.`
});
}
-96
View File
@@ -1,96 +0,0 @@
# Workflow that runs python unit tests on mac
name: Run Python Unit Tests Mac
# This job is flaky so only run it nightly
on:
schedule:
- cron: '0 0 * * *'
jobs:
# Run python unit tests on macOS
test-on-macos:
name: Python Unit Tests on macOS
runs-on: macos-14
env:
INSTALL_DOCKER: '1' # Set to '0' to skip Docker installation
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry via pipx
run: pipx install poetry
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
- name: Install & Start Docker
if: env.INSTALL_DOCKER == '1'
run: |
INSTANCE_NAME="colima-${GITHUB_RUN_ID}"
# Uninstall colima to upgrade to the latest version
if brew list colima &>/dev/null; then
brew uninstall colima
# unlinking colima dependency: go
brew uninstall go@1.21
fi
rm -rf ~/.colima ~/.lima
brew install --HEAD colima
brew install docker
start_colima() {
# Find a free port in the range 10000-20000
RANDOM_PORT=$((RANDOM % 10001 + 10000))
# Original line:
if ! colima start --network-address --arch x86_64 --cpu=1 --memory=1 --verbose --ssh-port $RANDOM_PORT; then
echo "Failed to start Colima."
return 1
fi
return 0
}
# Attempt to start Colima for 5 total attempts:
ATTEMPT_LIMIT=5
for ((i=1; i<=ATTEMPT_LIMIT; i++)); do
if start_colima; then
echo "Colima started successfully."
break
else
colima stop -f
sleep 10
colima delete -f
if [ $i -eq $ATTEMPT_LIMIT ]; then
exit 1
fi
sleep 10
fi
done
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Build Environment
run: make build
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Run Tests
run: poetry run pytest --forked --cov=openhands --cov-report=xml ./tests/unit --ignore=tests/unit/test_memory.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
-49
View File
@@ -1,49 +0,0 @@
# Workflow that runs python unit tests
name: Run Python Unit Tests
# The jobs in this workflow are required, so they must run at all times
# * Always run on "main"
# * Always run on PRs
on:
push:
branches:
- main
pull_request:
# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group
concurrency:
group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }}
cancel-in-progress: true
jobs:
# Run python unit tests on Linux
test-on-linux:
name: Python Unit Tests on Linux
runs-on: ubuntu-latest
env:
INSTALL_DOCKER: '0' # Set to '0' to skip Docker installation
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Install poetry via pipx
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install Python dependencies using Poetry
run: poetry install --without evaluation,llama-index
- name: Build Environment
run: make build
- name: Run Tests
run: poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
-31
View File
@@ -1,31 +0,0 @@
# Publishes the OpenHands PyPi package
name: Publish PyPi Package
# Triggered manually
on:
workflow_dispatch:
inputs:
reason:
description: 'Reason for manual trigger'
required: true
default: ''
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Poetry
uses: snok/install-poetry@v1.4.1
with:
virtualenvs-in-project: true
virtualenvs-path: ~/.virtualenvs
- name: Install Poetry Dependencies
run: poetry install --no-interaction --no-root
- name: Build poetry project
run: ./build.sh
- name: publish
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
-81
View File
@@ -1,81 +0,0 @@
# Workflow that uses OpenHands to review a pull request. PR must be labeled 'review-this'
name: Use OpenHands to Review Pull Request
on:
pull_request:
types: [synchronize, labeled]
permissions:
contents: write
pull-requests: write
jobs:
dogfood:
if: contains(github.event.pull_request.labels.*.name, 'review-this')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install git, github cli
run: |
sudo apt-get install -y git gh
git config --global --add safe.directory $PWD
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }} # check out the target branch
- name: Download Diff
run: |
curl -O "${{ github.event.pull_request.diff_url }}" -L
- name: Write Task File
run: |
echo "Your coworker wants to apply a pull request to this project." > task.txt
echo "Read and review ${{ github.event.pull_request.number }}.diff file. Create a review-${{ github.event.pull_request.number }}.txt and write your concise comments and suggestions there." >> task.txt
echo "Do not ask me for confirmation at any point." >> task.txt
echo "" >> task.txt
echo "Title" >> task.txt
echo "${{ github.event.pull_request.title }}" >> task.txt
echo "" >> task.txt
echo "Description" >> task.txt
echo "${{ github.event.pull_request.body }}" >> task.txt
echo "" >> task.txt
echo "Diff file is: ${{ github.event.pull_request.number }}.diff" >> task.txt
- name: Set up environment
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="/github/home/.local/bin:$PATH"
poetry install --without evaluation,llama-index
poetry run playwright install --with-deps chromium
- name: Run OpenHands
env:
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_MODEL: ${{ vars.LLM_MODEL }}
run: |
# Append path to launch poetry
export PATH="/github/home/.local/bin:$PATH"
# Append path to correctly import package, note: must set pwd at first
export PYTHONPATH=$(pwd):$PYTHONPATH
export WORKSPACE_MOUNT_PATH=$GITHUB_WORKSPACE
export WORKSPACE_BASE=$GITHUB_WORKSPACE
echo -e "/exit\n" | poetry run python openhands/core/main.py -i 50 -f task.txt
rm task.txt
- name: Check if review file is non-empty
id: check_file
run: |
ls -la
if [[ -s review-${{ github.event.pull_request.number }}.txt ]]; then
echo "non_empty=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Create PR review if file is non-empty
env:
GH_TOKEN: ${{ github.token }}
if: steps.check_file.outputs.non_empty == 'true'
run: |
gh pr review ${{ github.event.pull_request.number }} --comment --body-file "review-${{ github.event.pull_request.number }}.txt"
-21
View File
@@ -1,21 +0,0 @@
# Workflow that marks issues and PRs with no activity for 30 days with "Stale" and closes them after 7 more days of no activity
name: 'Close stale issues'
# Runs every day at 01:30
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
days-before-stale: 30
exempt-issue-labels: 'tracked'
close-issue-message: 'This issue was closed because it has been stalled for over 30 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for over 30 days with no activity.'
days-before-close: 7
-234
View File
@@ -1,234 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
./lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
requirements.txt
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
# poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
frontend/.env
.venv
env/
venv/
ENV/
env.bak/
.env.bak
venv.bak/
*venv/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
.vscode/
.cursorignore
# evaluation
evaluation/evaluation_outputs
evaluation/outputs
evaluation/swe_bench/eval_workspace*
evaluation/SWE-bench/data
evaluation/webarena/scripts/webarena_env.sh
evaluation/bird/data
evaluation/gaia/data
evaluation/gorilla/data
evaluation/toolqa/data
evaluation/scienceagentbench/benchmark
# openhands resolver
output/
# frontend
# dependencies
frontend/.pnp
frontend/bun.lockb
frontend/yarn.lock
.pnp.js
# testing
frontend/coverage
test_results*
/_test_files_tmp/
# production
frontend/build
frontend/dist
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
logs
# agent
.envrc
/workspace
/_test_workspace
/debug
cache
# configuration
config.toml
config.toml_
config.toml.bak
# swe-bench-eval
image_build_logs
run_instance_logs
runtime_*.tar
# docker build
containers/runtime/Dockerfile
containers/runtime/project.tar.gz
containers/runtime/code
**/node_modules/
View File
-28
View File
@@ -1,28 +0,0 @@
OpenHands is an automated AI software engineer. It is a repo with a Python backend
(in the `openhands` directory) and TypeScript frontend (in the `frontend` directory).
General Setup:
- To set up the entire repo, including frontend and backend, run `make build`
- To run linting and type-checking before finishing the job, run `poetry run pre-commit run --all-files --config ./dev_config/python/.pre-commit-config.yaml`
Backend:
- Located in the `openhands` directory
- Testing:
- All tests are in `tests/unit/test_*.py`
- To test new code, run `poetry run pytest tests/unit/test_xxx.py` where `xxx` is the appropriate file for the current functionality
- Write all tests with pytest
Frontend:
- Located in the `frontend` directory
- Prerequisites: A recent version of NodeJS / NPM
- Setup: Run `npm install` in the frontend directory
- Testing:
- Run tests: `npm run test`
- To run specific tests: `npm run test -- -t "TestName"`
- Building:
- Build for production: `npm run build`
- Environment Variables:
- Set in `frontend/.env` or as environment variables
- Available variables: VITE_BACKEND_HOST, VITE_USE_TLS, VITE_INSECURE_SKIP_VERIFY, VITE_FRONTEND_PORT
- Internationalization:
- Generate i18n declaration file: `npm run make-i18n`
+13
View File
File diff suppressed because one or more lines are too long
-133
View File
@@ -1,133 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
contact@all-hands.dev
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
-94
View File
@@ -1,94 +0,0 @@
# Contributing
Thanks for your interest in contributing to OpenHands! We welcome and appreciate contributions.
## Understanding OpenHands's CodeBase
To understand the codebase, please refer to the README in each module:
- [frontend](./frontend/README.md)
- [evaluation](./evaluation/README.md)
- [openhands](./openhands/README.md)
- [agenthub](./openhands/agenthub/README.md)
- [server](./openhands/server/README.md)
## Setting up your development environment
We have a separate doc [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) that tells you how to set up a development workflow.
## How can I contribute?
There are many ways that you can contribute:
1. **Download and use** OpenHands, and send [issues](https://github.com/All-Hands-AI/OpenHands/issues) when you encounter something that isn't working or a feature that you'd like to see.
2. **Send feedback** after each session by [clicking the thumbs-up thumbs-down buttons](https://docs.all-hands.dev/modules/usage/feedback), so we can see where things are working and failing, and also build an open dataset for training code agents.
3. **Improve the Codebase** by sending PRs (see details below). In particular, we have some [good first issues](https://github.com/All-Hands-AI/OpenHands/labels/good%20first%20issue) that may be ones to start on.
## What can I build?
Here are a few ways you can help improve the codebase.
#### UI/UX
We're always looking to improve the look and feel of the application. If you've got a small fix
for something that's bugging you, feel free to open up a PR that changes the `./frontend` directory.
If you're looking to make a bigger change, add a new UI element, or significantly alter the style
of the application, please open an issue first, or better, join the #frontend channel in our Slack
to gather consensus from our design team first.
#### Improving the agent
Our main agent is the CodeAct agent. You can [see its prompts here](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/agenthub/codeact_agent)
Changes to these prompts, and to the underlying behavior in Python, can have a huge impact on user experience.
You can try modifying the prompts to see how they change the behavior of the agent as you use the app
locally, but we will need to do an end-to-end evaluation of any changes here to ensure that the agent
is getting better over time.
We use the [SWE-bench](https://www.swebench.com/) benchmark to test our agent. You can join the #evaluation
channel in Slack to learn more.
#### Adding a new agent
You may want to experiment with building new types of agents. You can add an agent to `openhands/agenthub`
to help expand the capabilities of OpenHands.
#### Adding a new runtime
The agent needs a place to run code and commands. When you run OpenHands on your laptop, it uses a Docker container
to do this by default. But there are other ways of creating a sandbox for the agent.
If you work for a company that provides a cloud-based runtime, you could help us add support for that runtime
by implementing the [interface specified here](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/runtime.py).
#### Testing
When you write code, it is also good to write tests. Please navigate to the `tests` folder to see existing test suites.
At the moment, we have two kinds of tests: `unit` and `integration`. Please refer to the README for each test suite. These tests also run on GitHub's continuous integration to ensure quality of the project.
## Sending Pull Requests to OpenHands
You'll need to fork our repository to send us a Pull Request. You can learn more
about how to fork a GitHub repo and open a PR with your changes in [this article](https://medium.com/swlh/forks-and-pull-requests-how-to-contribute-to-github-repos-8843fac34ce8)
### Pull Request title
As described [here](https://github.com/commitizen/conventional-commit-types/blob/master/index.json), a valid PR title should begin with one of the following prefixes:
- `feat`: A new feature
- `fix`: A bug fix
- `docs`: Documentation only changes
- `style`: Changes that do not affect the meaning of the code (white space, formatting, missing semicolons, etc.)
- `refactor`: A code change that neither fixes a bug nor adds a feature
- `perf`: A code change that improves performance
- `test`: Adding missing tests or correcting existing tests
- `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- `chore`: Other changes that don't modify src or test files
- `revert`: Reverts a previous commit
For example, a PR title could be:
- `refactor: modify package path`
- `feat(frontend): xxxx`, where `(frontend)` means that this PR mainly focuses on the frontend component.
You may also check out previous PRs in the [PR list](https://github.com/All-Hands-AI/OpenHands/pulls).
### Pull Request description
- If your PR is small (such as a typo fix), you can go brief.
- If it contains a lot of changes, it's better to write more details.
If your changes are user-facing (e.g. a new feature in the UI, a change in behavior, or a bugfix)
please include a short message that we can add to our changelog.
-312
View File
@@ -1,312 +0,0 @@
# Credits
## Contributors
We would like to thank all the [contributors](https://github.com/All-Hands-AI/OpenHands/graphs/contributors) who have helped make OpenHands possible. We greatly appreciate your dedication and hard work.
## Open Source Projects
OpenHands includes and adapts the following open source projects. We are grateful for their contributions to the open source community:
#### [SWE Agent](https://github.com/princeton-nlp/swe-agent)
- License: MIT License
- Description: Adapted for use in OpenHands's agent hub
#### [Aider](https://github.com/paul-gauthier/aider)
- License: Apache License 2.0
- Description: AI pair programming tool. OpenHands has adapted and integrated its linter module for code-related tasks in [`agentskills utilities`](https://github.com/All-Hands-AI/OpenHands/tree/main/openhands/runtime/plugins/agent_skills/utils/aider)
#### [BrowserGym](https://github.com/ServiceNow/BrowserGym)
- License: Apache License 2.0
- Description: Adapted in implementing the browsing agent
### Reference Implementations for Evaluation Benchmarks
OpenHands integrates code of the reference implementations for the following agent evaluation benchmarks:
#### [HumanEval](https://github.com/openai/human-eval)
- License: MIT License
#### [DSP](https://github.com/microsoft/DataScienceProblems)
- License: MIT License
#### [HumanEvalPack](https://github.com/bigcode-project/bigcode-evaluation-harness)
- License: Apache License 2.0
#### [AgentBench](https://github.com/THUDM/AgentBench)
- License: Apache License 2.0
#### [SWE-Bench](https://github.com/princeton-nlp/SWE-bench)
- License: MIT License
#### [BIRD](https://bird-bench.github.io/)
- License: MIT License
- Dataset: CC-BY-SA 4.0
#### [Gorilla APIBench](https://github.com/ShishirPatil/gorilla)
- License: Apache License 2.0
#### [GPQA](https://github.com/idavidrein/gpqa)
- License: MIT License
#### [ProntoQA](https://github.com/asaparov/prontoqa)
- License: Apache License 2.0
## Open Source licenses
### MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### BSD 3-Clause License
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
### Apache License 2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
### Non-Open Source Reference Implementations:
#### [MultiPL-E](https://github.com/nuprl/MultiPL-E)
- License: BSD 3-Clause License with Machine Learning Restriction
BSD 3-Clause License with Machine Learning Restriction
Copyright (c) 2022, Northeastern University, Oberlin College, Roblox Inc,
Stevens Institute of Technology, University of Massachusetts Amherst, and
Wellesley College.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
4. The contents of this repository may not be used as training data for any
machine learning model, including but not limited to neural networks.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-128
View File
@@ -1,128 +0,0 @@
# Development Guide
This guide is for people working on OpenHands and editing the source code.
If you wish to contribute your changes, check out the [CONTRIBUTING.md](https://github.com/All-Hands-AI/OpenHands/blob/main/CONTRIBUTING.md) on how to clone and setup the project initially before moving on.
Otherwise, you can clone the OpenHands project directly.
## Start the server for development
### 1. Requirements
* Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu <= 22.04]
* [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!)
* [Python](https://www.python.org/downloads/) = 3.12
* [NodeJS](https://nodejs.org/en/download/package-manager) >= 18.17.1
* [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8
* OS-specific dependencies:
- Ubuntu: build-essential => `sudo apt-get install build-essential`
- WSL: netcat => `sudo apt-get install netcat`
Make sure you have all these dependencies installed before moving on to `make build`.
#### Develop without sudo access
If you want to develop without system admin/sudo access to upgrade/install `Python` and/or `NodeJs`, you can use `conda` or `mamba` to manage the packages for you:
```bash
# Download and install Mamba (a faster version of conda)
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
# Install Python 3.12, nodejs, and poetry
mamba install python=3.12
mamba install conda-forge::nodejs
mamba install conda-forge::poetry
```
### 2. Build and Setup The Environment
Begin by building the project which includes setting up the environment and installing dependencies. This step ensures that OpenHands is ready to run on your system:
```bash
make build
```
### 3. Configuring the Language Model
OpenHands supports a diverse array of Language Models (LMs) through the powerful [litellm](https://docs.litellm.ai) library. By default, we've chosen the mighty GPT-4 from OpenAI as our go-to model, but the world is your oyster! You can unleash the potential of Anthropic's suave Claude, the enigmatic Llama, or any other LM that piques your interest.
To configure the LM of your choice, run:
```bash
make setup-config
```
This command will prompt you to enter the LLM API key, model name, and other variables ensuring that OpenHands is tailored to your specific needs. Note that the model name will apply only when you run headless. If you use the UI, please set the model in the UI.
Note: If you have previously run OpenHands using the docker command, you may have already set some environmental variables in your terminal. The final configurations are set from highest to lowest priority:
Environment variables > config.toml variables > default variables
**Note on Alternative Models:**
Some alternative models may prove more challenging to tame than others. Fear not, brave adventurer! We shall soon unveil LLM-specific documentation to guide you on your quest.
And if you've already mastered the art of wielding a model other than OpenAI's GPT, we encourage you to share your setup instructions with us by creating instructions and adding it [to our documentation](https://github.com/All-Hands-AI/OpenHands/tree/main/docs/modules/usage/llms).
For a full list of the LM providers and models available, please consult the [litellm documentation](https://docs.litellm.ai/docs/providers).
### 4. Running the application
#### Option A: Run the Full Application
Once the setup is complete, launching OpenHands is as simple as running a single command. This command starts both the backend and frontend servers seamlessly, allowing you to interact with OpenHands:
```bash
make run
```
#### Option B: Individual Server Startup
- **Start the Backend Server:** If you prefer, you can start the backend server independently to focus on backend-related tasks or configurations.
```bash
make start-backend
```
- **Start the Frontend Server:** Similarly, you can start the frontend server on its own to work on frontend-related components or interface enhancements.
```bash
make start-frontend
```
### 6. LLM Debugging
If you encounter any issues with the Language Model (LM) or you're simply curious, you can inspect the actual LLM prompts and responses. To do so, export DEBUG=1 in the environment and restart the backend.
OpenHands will then log the prompts and responses in the logs/llm/CURRENT_DATE directory, allowing you to identify the causes.
### 7. Help
Need assistance or information on available targets and commands? The help command provides all the necessary guidance to ensure a smooth experience with OpenHands.
```bash
make help
```
### 8. Testing
To run tests, refer to the following:
#### Unit tests
```bash
poetry run pytest ./tests/unit/test_*.py
```
### 9. Add or update dependency
1. Add your dependency in `pyproject.toml` or use `poetry add xxx`
2. Update the poetry.lock file via `poetry lock --no-update`
### 9. Use existing Docker image
To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker container image. Follow these steps:
1. Set the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image.
2. Example: export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.14-nikolaik
## Develop inside Docker container
TL;DR
```bash
make docker-dev
```
See more details [here](./containers/dev/README.md)
If you are just interested in running `OpenHands` without installing all the required tools on your host.
```bash
make docker-run
```
If you do not have `make` on your host, run:
```bash
cd ./containers/dev
./dev.sh
```
You do need [Docker](https://docs.docker.com/engine/install/) installed on your host though.
-25
View File
@@ -1,25 +0,0 @@
# Issue Triage
These are the procedures and guidelines on how issues are triaged in this repo by the maintainers.
## General
* Most issues must be tagged with **enhancement** or **bug**
* Issues may be tagged with what it relates to (**backend**, **frontend**, **agent quality**, etc.)
## Severity
* **Low**: Minor issues, single user report
* **Medium**: Affecting multiple users
* **Critical**: Affecting all users or potential security issues
## Effort
* Issues may be estimated with effort required (**small effort**, **medium effort**, **large effort**)
## Difficulty
* Issues with low implementation difficulty may be tagged with **good first issue**
## Not Enough Information
* User is asked to provide more information (logs, how to reproduce, etc.) when the issue is not clear
* If an issue is unclear and the author does not provide more information or respond to a request, the issue may be closed as **not planned** (Usually after a week)
## Multiple Requests/Fixes in One Issue
* These issues will be narrowed down to one request/fix so the issue is more easily tracked and fixed
* Issues may be broken down into multiple issues if required
-25
View File
@@ -1,25 +0,0 @@
The MIT License (MIT)
=====================
Copyright © 2023
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-5
View File
@@ -1,5 +0,0 @@
# Exclude all Python bytecode files
global-exclude *.pyc
# Exclude Python cache directories
global-exclude __pycache__
-332
View File
@@ -1,332 +0,0 @@
SHELL=/bin/bash
# Makefile for OpenHands project
# Variables
BACKEND_HOST ?= "127.0.0.1"
BACKEND_PORT = 3000
BACKEND_HOST_PORT = "$(BACKEND_HOST):$(BACKEND_PORT)"
FRONTEND_PORT = 3001
DEFAULT_WORKSPACE_DIR = "./workspace"
DEFAULT_MODEL = "gpt-4o"
CONFIG_FILE = config.toml
PRE_COMMIT_CONFIG_PATH = "./dev_config/python/.pre-commit-config.yaml"
PYTHON_VERSION = 3.12
# ANSI color codes
GREEN=$(shell tput -Txterm setaf 2)
YELLOW=$(shell tput -Txterm setaf 3)
RED=$(shell tput -Txterm setaf 1)
BLUE=$(shell tput -Txterm setaf 6)
RESET=$(shell tput -Txterm sgr0)
# Build
build:
@echo "$(GREEN)Building project...$(RESET)"
@$(MAKE) -s check-dependencies
@$(MAKE) -s install-python-dependencies
@$(MAKE) -s install-frontend-dependencies
@$(MAKE) -s install-pre-commit-hooks
@$(MAKE) -s build-frontend
@echo "$(GREEN)Build completed successfully.$(RESET)"
check-dependencies:
@echo "$(YELLOW)Checking dependencies...$(RESET)"
@$(MAKE) -s check-system
@$(MAKE) -s check-python
@$(MAKE) -s check-npm
@$(MAKE) -s check-nodejs
ifeq ($(INSTALL_DOCKER),)
@$(MAKE) -s check-docker
endif
@$(MAKE) -s check-poetry
@echo "$(GREEN)Dependencies checked successfully.$(RESET)"
check-system:
@echo "$(YELLOW)Checking system...$(RESET)"
@if [ "$(shell uname)" = "Darwin" ]; then \
echo "$(BLUE)macOS detected.$(RESET)"; \
elif [ "$(shell uname)" = "Linux" ]; then \
if [ -f "/etc/manjaro-release" ]; then \
echo "$(BLUE)Manjaro Linux detected.$(RESET)"; \
else \
echo "$(BLUE)Linux detected.$(RESET)"; \
fi; \
elif [ "$$(uname -r | grep -i microsoft)" ]; then \
echo "$(BLUE)Windows Subsystem for Linux detected.$(RESET)"; \
else \
echo "$(RED)Unsupported system detected. Please use macOS, Linux, or Windows Subsystem for Linux (WSL).$(RESET)"; \
exit 1; \
fi
check-python:
@echo "$(YELLOW)Checking Python installation...$(RESET)"
@if command -v python$(PYTHON_VERSION) > /dev/null; then \
echo "$(BLUE)$(shell python$(PYTHON_VERSION) --version) is already installed.$(RESET)"; \
else \
echo "$(RED)Python $(PYTHON_VERSION) is not installed. Please install Python $(PYTHON_VERSION) to continue.$(RESET)"; \
exit 1; \
fi
check-npm:
@echo "$(YELLOW)Checking npm installation...$(RESET)"
@if command -v npm > /dev/null; then \
echo "$(BLUE)npm $(shell npm --version) is already installed.$(RESET)"; \
else \
echo "$(RED)npm is not installed. Please install Node.js to continue.$(RESET)"; \
exit 1; \
fi
check-nodejs:
@echo "$(YELLOW)Checking Node.js installation...$(RESET)"
@if command -v node > /dev/null; then \
NODE_VERSION=$(shell node --version | sed -E 's/v//g'); \
IFS='.' read -r -a NODE_VERSION_ARRAY <<< "$$NODE_VERSION"; \
if [ "$${NODE_VERSION_ARRAY[0]}" -gt 18 ] || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -gt 17 ]) || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -eq 17 ] && [ "$${NODE_VERSION_ARRAY[2]}" -ge 1 ]); then \
echo "$(BLUE)Node.js $$NODE_VERSION is already installed.$(RESET)"; \
else \
echo "$(RED)Node.js 18.17.1 or later is required. Please install Node.js 18.17.1 or later to continue.$(RESET)"; \
exit 1; \
fi; \
else \
echo "$(RED)Node.js is not installed. Please install Node.js to continue.$(RESET)"; \
exit 1; \
fi
check-docker:
@echo "$(YELLOW)Checking Docker installation...$(RESET)"
@if command -v docker > /dev/null; then \
echo "$(BLUE)$(shell docker --version) is already installed.$(RESET)"; \
else \
echo "$(RED)Docker is not installed. Please install Docker to continue.$(RESET)"; \
exit 1; \
fi
check-poetry:
@echo "$(YELLOW)Checking Poetry installation...$(RESET)"
@if command -v poetry > /dev/null; then \
POETRY_VERSION=$(shell poetry --version 2>&1 | sed -E 's/Poetry \(version ([0-9]+\.[0-9]+\.[0-9]+)\)/\1/'); \
IFS='.' read -r -a POETRY_VERSION_ARRAY <<< "$$POETRY_VERSION"; \
if [ $${POETRY_VERSION_ARRAY[0]} -ge 1 ] && [ $${POETRY_VERSION_ARRAY[1]} -ge 8 ]; then \
echo "$(BLUE)$(shell poetry --version) is already installed.$(RESET)"; \
else \
echo "$(RED)Poetry 1.8 or later is required. You can install poetry by running the following command, then adding Poetry to your PATH:"; \
echo "$(RED) curl -sSL https://install.python-poetry.org | python$(PYTHON_VERSION) -$(RESET)"; \
echo "$(RED)More detail here: https://python-poetry.org/docs/#installing-with-the-official-installer$(RESET)"; \
exit 1; \
fi; \
else \
echo "$(RED)Poetry is not installed. You can install poetry by running the following command, then adding Poetry to your PATH:"; \
echo "$(RED) curl -sSL https://install.python-poetry.org | python$(PYTHON_VERSION) -$(RESET)"; \
echo "$(RED)More detail here: https://python-poetry.org/docs/#installing-with-the-official-installer$(RESET)"; \
exit 1; \
fi
install-python-dependencies:
@echo "$(GREEN)Installing Python dependencies...$(RESET)"
@if [ -z "${TZ}" ]; then \
echo "Defaulting TZ (timezone) to UTC"; \
export TZ="UTC"; \
fi
poetry env use python$(PYTHON_VERSION)
@if [ "$(shell uname)" = "Darwin" ]; then \
echo "$(BLUE)Installing chroma-hnswlib...$(RESET)"; \
export HNSWLIB_NO_NATIVE=1; \
poetry run pip install chroma-hnswlib; \
fi
@poetry install --without llama-index
@if [ -f "/etc/manjaro-release" ]; then \
echo "$(BLUE)Detected Manjaro Linux. Installing Playwright dependencies...$(RESET)"; \
poetry run pip install playwright; \
poetry run playwright install chromium; \
else \
if [ ! -f cache/playwright_chromium_is_installed.txt ]; then \
echo "Running playwright install --with-deps chromium..."; \
poetry run playwright install --with-deps chromium; \
mkdir -p cache; \
touch cache/playwright_chromium_is_installed.txt; \
else \
echo "Setup already done. Skipping playwright installation."; \
fi \
fi
@echo "$(GREEN)Python dependencies installed successfully.$(RESET)"
install-frontend-dependencies:
@echo "$(YELLOW)Setting up frontend environment...$(RESET)"
@echo "$(YELLOW)Detect Node.js version...$(RESET)"
@cd frontend && node ./scripts/detect-node-version.js
echo "$(BLUE)Installing frontend dependencies with npm...$(RESET)"
@cd frontend && npm install
@echo "$(GREEN)Frontend dependencies installed successfully.$(RESET)"
install-pre-commit-hooks:
@echo "$(YELLOW)Installing pre-commit hooks...$(RESET)"
@git config --unset-all core.hooksPath || true
@poetry run pre-commit install --config $(PRE_COMMIT_CONFIG_PATH)
@echo "$(GREEN)Pre-commit hooks installed successfully.$(RESET)"
lint-backend:
@echo "$(YELLOW)Running linters...$(RESET)"
@poetry run pre-commit run --files openhands/**/* agenthub/**/* evaluation/**/* --show-diff-on-failure --config $(PRE_COMMIT_CONFIG_PATH)
lint-frontend:
@echo "$(YELLOW)Running linters for frontend...$(RESET)"
@cd frontend && npm run lint
lint:
@$(MAKE) -s lint-frontend
@$(MAKE) -s lint-backend
test-frontend:
@echo "$(YELLOW)Running tests for frontend...$(RESET)"
@cd frontend && npm run test
test:
@$(MAKE) -s test-frontend
build-frontend:
@echo "$(YELLOW)Building frontend...$(RESET)"
@cd frontend && npm run build
# Start backend
start-backend:
@echo "$(YELLOW)Starting backend...$(RESET)"
@poetry run uvicorn openhands.server.listen:app --host $(BACKEND_HOST) --port $(BACKEND_PORT) --reload --reload-exclude "$(shell pwd)/workspace"
# Start frontend
start-frontend:
@echo "$(YELLOW)Starting frontend...$(RESET)"
@cd frontend && VITE_BACKEND_HOST=$(BACKEND_HOST_PORT) VITE_FRONTEND_PORT=$(FRONTEND_PORT) npm run dev -- --port $(FRONTEND_PORT) --host $(BACKEND_HOST)
# Common setup for running the app (non-callable)
_run_setup:
@if [ "$(OS)" = "Windows_NT" ]; then \
echo "$(RED) Windows is not supported, use WSL instead!$(RESET)"; \
exit 1; \
fi
@mkdir -p logs
@echo "$(YELLOW)Starting backend server...$(RESET)"
@poetry run uvicorn openhands.server.listen:app --host $(BACKEND_HOST) --port $(BACKEND_PORT) &
@echo "$(YELLOW)Waiting for the backend to start...$(RESET)"
@until nc -z localhost $(BACKEND_PORT); do sleep 0.1; done
@echo "$(GREEN)Backend started successfully.$(RESET)"
# Run the app (standard mode)
run:
@echo "$(YELLOW)Running the app...$(RESET)"
@$(MAKE) -s _run_setup
@$(MAKE) -s start-frontend
@echo "$(GREEN)Application started successfully.$(RESET)"
# Run the app (in docker)
docker-run: WORKSPACE_BASE ?= $(PWD)/workspace
docker-run:
@if [ -f /.dockerenv ]; then \
echo "Running inside a Docker container. Exiting..."; \
exit 0; \
else \
echo "$(YELLOW)Running the app in Docker $(OPTIONS)...$(RESET)"; \
export WORKSPACE_BASE=${WORKSPACE_BASE}; \
export SANDBOX_USER_ID=$(shell id -u); \
export DATE=$(shell date +%Y%m%d%H%M%S); \
docker compose up $(OPTIONS); \
fi
# Run the app (WSL mode)
run-wsl:
@echo "$(YELLOW)Running the app in WSL mode...$(RESET)"
@$(MAKE) -s _run_setup
@cd frontend && echo "$(BLUE)Starting frontend with npm (WSL mode)...$(RESET)" && npm run dev_wsl -- --port $(FRONTEND_PORT)
@echo "$(GREEN)Application started successfully in WSL mode.$(RESET)"
# Setup config.toml
setup-config:
@echo "$(YELLOW)Setting up config.toml...$(RESET)"
@$(MAKE) setup-config-prompts
@mv $(CONFIG_FILE).tmp $(CONFIG_FILE)
@echo "$(GREEN)Config.toml setup completed.$(RESET)"
setup-config-prompts:
@echo "[core]" > $(CONFIG_FILE).tmp
@read -p "Enter your workspace directory (as absolute path) [default: $(DEFAULT_WORKSPACE_DIR)]: " workspace_dir; \
workspace_dir=$${workspace_dir:-$(DEFAULT_WORKSPACE_DIR)}; \
echo "workspace_base=\"$$workspace_dir\"" >> $(CONFIG_FILE).tmp
@echo "" >> $(CONFIG_FILE).tmp
@echo "[llm]" >> $(CONFIG_FILE).tmp
@read -p "Enter your LLM model name, used for running without UI. Set the model in the UI after you start the app. (see https://docs.litellm.ai/docs/providers for full list) [default: $(DEFAULT_MODEL)]: " llm_model; \
llm_model=$${llm_model:-$(DEFAULT_MODEL)}; \
echo "model=\"$$llm_model\"" >> $(CONFIG_FILE).tmp
@read -p "Enter your LLM api key: " llm_api_key; \
echo "api_key=\"$$llm_api_key\"" >> $(CONFIG_FILE).tmp
@read -p "Enter your LLM base URL [mostly used for local LLMs, leave blank if not needed - example: http://localhost:5001/v1/]: " llm_base_url; \
if [[ ! -z "$$llm_base_url" ]]; then echo "base_url=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; fi
@echo "Enter your LLM Embedding Model"; \
echo "Choices are:"; \
echo " - openai"; \
echo " - azureopenai"; \
echo " - Embeddings available only with OllamaEmbedding:"; \
echo " - llama2"; \
echo " - mxbai-embed-large"; \
echo " - nomic-embed-text"; \
echo " - all-minilm"; \
echo " - stable-code"; \
echo " - bge-m3"; \
echo " - bge-large"; \
echo " - paraphrase-multilingual"; \
echo " - snowflake-arctic-embed"; \
echo " - Leave blank to default to 'BAAI/bge-small-en-v1.5' via huggingface"; \
read -p "> " llm_embedding_model; \
echo "embedding_model=\"$$llm_embedding_model\"" >> $(CONFIG_FILE).tmp; \
if [ "$$llm_embedding_model" = "llama2" ] || [ "$$llm_embedding_model" = "mxbai-embed-large" ] || [ "$$llm_embedding_model" = "nomic-embed-text" ] || [ "$$llm_embedding_model" = "all-minilm" ] || [ "$$llm_embedding_model" = "stable-code" ]; then \
read -p "Enter the local model URL for the embedding model (will set llm.embedding_base_url): " llm_embedding_base_url; \
echo "embedding_base_url=\"$$llm_embedding_base_url\"" >> $(CONFIG_FILE).tmp; \
elif [ "$$llm_embedding_model" = "azureopenai" ]; then \
read -p "Enter the Azure endpoint URL (will overwrite llm.base_url): " llm_base_url; \
echo "base_url=\"$$llm_base_url\"" >> $(CONFIG_FILE).tmp; \
read -p "Enter the Azure LLM Embedding Deployment Name: " llm_embedding_deployment_name; \
echo "embedding_deployment_name=\"$$llm_embedding_deployment_name\"" >> $(CONFIG_FILE).tmp; \
read -p "Enter the Azure API Version: " llm_api_version; \
echo "api_version=\"$$llm_api_version\"" >> $(CONFIG_FILE).tmp; \
fi
# Develop in container
docker-dev:
@if [ -f /.dockerenv ]; then \
echo "Running inside a Docker container. Exiting..."; \
exit 0; \
else \
echo "$(YELLOW)Build and run in Docker $(OPTIONS)...$(RESET)"; \
./containers/dev/dev.sh $(OPTIONS); \
fi
# Clean up all caches
clean:
@echo "$(YELLOW)Cleaning up caches...$(RESET)"
@rm -rf openhands/.cache
@echo "$(GREEN)Caches cleaned up successfully.$(RESET)"
# Help
help:
@echo "$(BLUE)Usage: make [target]$(RESET)"
@echo "Targets:"
@echo " $(GREEN)build$(RESET) - Build project, including environment setup and dependencies."
@echo " $(GREEN)lint$(RESET) - Run linters on the project."
@echo " $(GREEN)setup-config$(RESET) - Setup the configuration for OpenHands by providing LLM API key,"
@echo " LLM Model name, and workspace directory."
@echo " $(GREEN)start-backend$(RESET) - Start the backend server for the OpenHands project."
@echo " $(GREEN)start-frontend$(RESET) - Start the frontend server for the OpenHands project."
@echo " $(GREEN)run$(RESET) - Run the OpenHands application, starting both backend and frontend servers."
@echo " Backend Log file will be stored in the 'logs' directory."
@echo " $(GREEN)docker-dev$(RESET) - Build and run the OpenHands application in Docker."
@echo " $(GREEN)docker-run$(RESET) - Run the OpenHands application, starting both backend and frontend servers in Docker."
@echo " $(GREEN)help$(RESET) - Display this help message, providing information on available targets."
# Phony targets
.PHONY: build check-dependencies check-python check-npm check-docker check-poetry install-python-dependencies install-frontend-dependencies install-pre-commit-hooks lint start-backend start-frontend run run-wsl setup-config setup-config-prompts help
.PHONY: docker-dev docker-run
-130
View File
@@ -1,130 +0,0 @@
<a name="readme-top"></a>
<div align="center">
<img src="./docs/static/img/logo.png" alt="Logo" width="200">
<h1 align="center">OpenHands: Code Less, Make More</h1>
</div>
<div align="center">
<a href="https://github.com/All-Hands-AI/OpenHands/graphs/contributors"><img src="https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="Contributors"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/stargazers"><img src="https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="Stargazers"></a>
<a href="https://codecov.io/github/All-Hands-AI/OpenHands?branch=main"><img alt="CodeCov" src="https://img.shields.io/codecov/c/github/All-Hands-AI/OpenHands?style=for-the-badge&color=blue"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE"><img src="https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge&color=blue" alt="MIT License"></a>
<br/>
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2tom0er4l-JeNUGHt_AxpEfIBstbLPiw"><img src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge" alt="Join our Slack community"></a>
<a href="https://discord.gg/ESHStjSjD4"><img src="https://img.shields.io/badge/Discord-Join%20Us-purple?logo=discord&logoColor=white&style=for-the-badge" alt="Join our Discord community"></a>
<a href="https://github.com/All-Hands-AI/OpenHands/blob/main/CREDITS.md"><img src="https://img.shields.io/badge/Project-Credits-blue?style=for-the-badge&color=FFE165&logo=github&logoColor=white" alt="Credits"></a>
<br/>
<a href="https://docs.all-hands.dev/modules/usage/getting-started"><img src="https://img.shields.io/badge/Documentation-000?logo=googledocs&logoColor=FFE165&style=for-the-badge" alt="Check out the documentation"></a>
<a href="https://arxiv.org/abs/2407.16741"><img src="https://img.shields.io/badge/Paper%20on%20Arxiv-000?logoColor=FFE165&logo=arxiv&style=for-the-badge" alt="Paper on Arxiv"></a>
<a href="https://huggingface.co/spaces/OpenHands/evaluation"><img src="https://img.shields.io/badge/Benchmark%20score-000?logoColor=FFE165&logo=huggingface&style=for-the-badge" alt="Evaluation Benchmark Score"></a>
<hr>
</div>
Welcome to OpenHands (formerly OpenDevin), a platform for software development agents powered by AI.
OpenHands agents can do anything a human developer can: modify code, run commands, browse the web,
call APIs, and yes—even copy code snippets from StackOverflow.
Learn more at [docs.all-hands.dev](https://docs.all-hands.dev), or jump to the [Quick Start](#-quick-start).
![App screenshot](./docs/static/img/screenshot.png)
## ⚡ Quick Start
The easiest way to run OpenHands is in Docker.
See the [Installation](https://docs.all-hands.dev/modules/usage/installation) guide for
system requirements and more information.
```bash
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.14-nikolaik
docker run -it --pull=always \
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.14-nikolaik \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 3000:3000 \
-e LOG_ALL_EVENTS=true \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.all-hands.dev/all-hands-ai/openhands:0.14
```
You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)!
Finally, you'll need a model provider and API key.
[Anthropic's Claude 3.5 Sonnet](https://www.anthropic.com/api) (`anthropic/claude-3-5-sonnet-20241022`)
works best, but you have [many options](https://docs.all-hands.dev/modules/usage/llms).
---
You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes),
run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode),
interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode),
or run it on tagged issues with [a github action](https://github.com/All-Hands-AI/OpenHands-resolver).
Visit [Installation](https://docs.all-hands.dev/modules/usage/installation) for more information and setup instructions.
If you want to modify the OpenHands source code, check out [Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
Having issues? The [Troubleshooting Guide](https://docs.all-hands.dev/modules/usage/troubleshooting) can help.
## 📖 Documentation
To learn more about the project, and for tips on using OpenHands,
**check out our [documentation](https://docs.all-hands.dev/modules/usage/getting-started)**.
There you'll find resources on how to use different LLM providers,
troubleshooting resources, and advanced configuration options.
## 🤝 How to Contribute
OpenHands is a community-driven project, and we welcome contributions from everyone.
Whether you're a developer, a researcher, or simply enthusiastic about advancing the field of
software engineering with AI, there are many ways to get involved:
- **Code Contributions:** Help us develop new agents, core functionality, the frontend and other interfaces, or sandboxing solutions.
- **Research and Evaluation:** Contribute to our understanding of LLMs in software engineering, participate in evaluating the models, or suggest improvements.
- **Feedback and Testing:** Use the OpenHands toolset, report bugs, suggest features, or provide feedback on usability.
For details, please check [CONTRIBUTING.md](./CONTRIBUTING.md).
## 🤖 Join Our Community
Whether you're a developer, a researcher, or simply enthusiastic about OpenHands, we'd love to have you in our community.
Let's make software engineering better together!
- [Slack workspace](https://join.slack.com/t/openhands-ai/shared_invite/zt-2tom0er4l-JeNUGHt_AxpEfIBstbLPiw) - Here we talk about research, architecture, and future development.
- [Discord server](https://discord.gg/ESHStjSjD4) - This is a community-run server for general discussion, questions, and feedback.
## 📈 Progress
<p align="center">
<a href="https://star-history.com/#All-Hands-AI/OpenHands&Date">
<img src="https://api.star-history.com/svg?repos=All-Hands-AI/OpenHands&type=Date" width="500" alt="Star History Chart">
</a>
</p>
## 📜 License
Distributed under the MIT License. See [`LICENSE`](./LICENSE) for more information.
## 🙏 Acknowledgements
OpenHands is built by a large number of contributors, and every contribution is greatly appreciated! We also build upon other open source projects, and we are deeply thankful for their work.
For a list of open source projects and licenses used in OpenHands, please see our [CREDITS.md](./CREDITS.md) file.
## 📚 Cite
```
@misc{openhands,
title={{OpenHands: An Open Platform for AI Software Developers as Generalist Agents}},
author={Xingyao Wang and Boxuan Li and Yufan Song and Frank F. Xu and Xiangru Tang and Mingchen Zhuge and Jiayi Pan and Yueqi Song and Bowen Li and Jaskirat Singh and Hoang H. Tran and Fuqiang Li and Ren Ma and Mingzhang Zheng and Bill Qian and Yanjun Shao and Niklas Muennighoff and Yizhe Zhang and Binyuan Hui and Junyang Lin and Robert Brennan and Hao Peng and Heng Ji and Graham Neubig},
year={2024},
eprint={2407.16741},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2407.16741},
}
```
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 113 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3396],{7729:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var o=t(4848),r=t(8453);const s={sidebar_label:"memory",title:"agenthub.monologue_agent.utils.memory"},i=void 0,l={id:"python/agenthub/monologue_agent/utils/memory",title:"agenthub.monologue_agent.utils.memory",description:"LongTermMemory Objects",source:"@site/modules/python/agenthub/monologue_agent/utils/memory.md",sourceDirName:"python/agenthub/monologue_agent/utils",slug:"/python/agenthub/monologue_agent/utils/memory",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/memory",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"memory",title:"agenthub.monologue_agent.utils.memory"},sidebar:"apiSidebar",previous:{title:"json",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/json"},next:{title:"monologue",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/monologue"}},a={},c=[{value:"LongTermMemory Objects",id:"longtermmemory-objects",level:2},{value:"__init__",id:"__init__",level:4},{value:"add_event",id:"add_event",level:4},{value:"search",id:"search",level:4}];function d(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"longtermmemory-objects",children:"LongTermMemory Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"class LongTermMemory()\n"})}),"\n",(0,o.jsx)(n.p,{children:"Responsible for storing information that the agent can call on later for better insights and context.\nUses chromadb to store and search through memories."}),"\n",(0,o.jsx)(n.h4,{id:"__init__",children:"__init__"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def __init__()\n"})}),"\n",(0,o.jsx)(n.p,{children:"Initialize the chromadb and set up ChromaVectorStore for later use."}),"\n",(0,o.jsx)(n.h4,{id:"add_event",children:"add_event"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def add_event(event: dict)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Adds a new event to the long term memory with a unique id."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"event (dict): The new event to be added to memory"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"search",children:"search"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def search(query: str, k: int = 10)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Searches through the current memory using VectorIndexRetriever"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"query (str): A query to match search results to"}),"\n",(0,o.jsx)(n.li,{children:"k (int): Number of top results to return"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"List[str]: List of top k results found in current memory"}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>l});var o=t(6540);const r={},s=o.createContext(r);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4302],{1106:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>l});var o=t(4848),s=t(8453);const a={sidebar_label:"observation",title:"opendevin.schema.observation"},i=void 0,r={id:"python/opendevin/schema/observation",title:"opendevin.schema.observation",description:"ObservationTypeSchema Objects",source:"@site/modules/python/opendevin/schema/observation.md",sourceDirName:"python/opendevin/schema",slug:"/python/opendevin/schema/observation",permalink:"/OpenDevin/modules/python/opendevin/schema/observation",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"observation",title:"opendevin.schema.observation"},sidebar:"apiSidebar",previous:{title:"action",permalink:"/OpenDevin/modules/python/opendevin/schema/action"},next:{title:"task",permalink:"/OpenDevin/modules/python/opendevin/schema/task"}},c={},l=[{value:"ObservationTypeSchema Objects",id:"observationtypeschema-objects",level:2},{value:"READ",id:"read",level:4},{value:"BROWSE",id:"browse",level:4},{value:"RUN",id:"run",level:4},{value:"RECALL",id:"recall",level:4},{value:"CHAT",id:"chat",level:4},{value:"DELEGATE",id:"delegate",level:4}];function d(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"observationtypeschema-objects",children:"ObservationTypeSchema Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"class ObservationTypeSchema(BaseModel)\n"})}),"\n",(0,o.jsx)(n.h4,{id:"read",children:"READ"}),"\n",(0,o.jsx)(n.p,{children:"The content of a file"}),"\n",(0,o.jsx)(n.h4,{id:"browse",children:"BROWSE"}),"\n",(0,o.jsx)(n.p,{children:"The HTML content of a URL"}),"\n",(0,o.jsx)(n.h4,{id:"run",children:"RUN"}),"\n",(0,o.jsx)(n.p,{children:"The output of a command"}),"\n",(0,o.jsx)(n.h4,{id:"recall",children:"RECALL"}),"\n",(0,o.jsx)(n.p,{children:"The result of a search"}),"\n",(0,o.jsx)(n.h4,{id:"chat",children:"CHAT"}),"\n",(0,o.jsx)(n.p,{children:"A message from the user"}),"\n",(0,o.jsx)(n.h4,{id:"delegate",children:"DELEGATE"}),"\n",(0,o.jsx)(n.p,{children:"The result of a task delegated to another agent"})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},a=o.createContext(s);function i(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4435],{3596:(n,e,i)=>{i.r(e),i.d(e,{assets:()=>r,contentTitle:()=>l,default:()=>a,frontMatter:()=>o,metadata:()=>p,toc:()=>d});var t=i(4848),s=i(8453);const o={sidebar_label:"mixin",title:"opendevin.sandbox.plugins.mixin"},l=void 0,p={id:"python/opendevin/sandbox/plugins/mixin",title:"opendevin.sandbox.plugins.mixin",description:"PluginMixin Objects",source:"@site/modules/python/opendevin/sandbox/plugins/mixin.md",sourceDirName:"python/opendevin/sandbox/plugins",slug:"/python/opendevin/sandbox/plugins/mixin",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/mixin",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"mixin",title:"opendevin.sandbox.plugins.mixin"},sidebar:"apiSidebar",previous:{title:"jupyter",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/jupyter/__init__"},next:{title:"requirement",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/requirement"}},r={},d=[{value:"PluginMixin Objects",id:"pluginmixin-objects",level:2},{value:"init_plugins",id:"init_plugins",level:4}];function u(n){const e={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...n.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e.h2,{id:"pluginmixin-objects",children:"PluginMixin Objects"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-python",children:"class PluginMixin()\n"})}),"\n",(0,t.jsx)(e.p,{children:"Mixin for Sandbox to support plugins."}),"\n",(0,t.jsx)(e.h4,{id:"init_plugins",children:"init_plugins"}),"\n",(0,t.jsx)(e.pre,{children:(0,t.jsx)(e.code,{className:"language-python",children:"def init_plugins(requirements: List[PluginRequirement])\n"})}),"\n",(0,t.jsx)(e.p,{children:"Load a plugin into the sandbox."})]})}function a(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,t.jsx)(e,{...n,children:(0,t.jsx)(u,{...n})}):u(n)}},8453:(n,e,i)=>{i.d(e,{R:()=>l,x:()=>p});var t=i(6540);const s={},o=t.createContext(s);function l(n){const e=t.useContext(o);return t.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:l(n.components),t.createElement(o.Provider,{value:e},n.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2237],{3363:(e,t,n)=>{n.d(t,{A:()=>a});n(6540);var i=n(4164),o=n(1312),s=n(1107),r=n(4848);function a(e){let{className:t}=e;return(0,r.jsx)("main",{className:(0,i.A)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(s.A,{as:"h1",className:"hero__title",children:(0,r.jsx)(o.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(o.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2237:(e,t,n)=>{n.r(t),n.d(t,{default:()=>d});n(6540);var i=n(1312),o=n(1003),s=n(781),r=n(3363),a=n(4848);function d(){const e=(0,i.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.be,{title:e}),(0,a.jsx)(s.A,{children:(0,a.jsx)(r.A,{})})]})}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1250],{7101:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>u,frontMatter:()=>r,metadata:()=>a,toc:()=>c});var o=t(4848),s=t(8453);const r={sidebar_label:"browse",title:"opendevin.observation.browse"},i=void 0,a={id:"python/opendevin/observation/browse",title:"opendevin.observation.browse",description:"BrowserOutputObservation Objects",source:"@site/modules/python/opendevin/observation/browse.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/browse",permalink:"/OpenDevin/modules/python/opendevin/observation/browse",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"browse",title:"opendevin.observation.browse"},sidebar:"apiSidebar",previous:{title:"base",permalink:"/OpenDevin/modules/python/opendevin/observation/base"},next:{title:"delegate",permalink:"/OpenDevin/modules/python/opendevin/observation/delegate"}},p={},c=[{value:"BrowserOutputObservation Objects",id:"browseroutputobservation-objects",level:2}];function d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"browseroutputobservation-objects",children:"BrowserOutputObservation Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass BrowserOutputObservation(Observation)\n"})}),"\n",(0,o.jsx)(n.p,{children:"This data class represents the output of a browser."})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>a});var o=t(6540);const s={},r=o.createContext(s);function i(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8878],{2207:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=t(4848),s=t(8453);const r={sidebar_label:"agent",title:"agenthub.monologue_agent.agent"},l=void 0,i={id:"python/agenthub/monologue_agent/agent",title:"agenthub.monologue_agent.agent",description:"MonologueAgent Objects",source:"@site/modules/python/agenthub/monologue_agent/agent.md",sourceDirName:"python/agenthub/monologue_agent",slug:"/python/agenthub/monologue_agent/agent",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/agent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"agent",title:"agenthub.monologue_agent.agent"},sidebar:"apiSidebar",previous:{title:"prompts",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/prompts"},next:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/agent"}},a={},c=[{value:"MonologueAgent Objects",id:"monologueagent-objects",level:2},{value:"__init__",id:"__init__",level:4},{value:"step",id:"step",level:4},{value:"search_memory",id:"search_memory",level:4}];function d(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"monologueagent-objects",children:"MonologueAgent Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"class MonologueAgent(Agent)\n"})}),"\n",(0,o.jsx)(n.p,{children:"The Monologue Agent utilizes long and short term memory to complete tasks.\nLong term memory is stored as a LongTermMemory object and the model uses it to search for examples from the past.\nShort term memory is stored as a Monologue object and the model can condense it as necessary."}),"\n",(0,o.jsx)(n.h4,{id:"__init__",children:"__init__"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def __init__(llm: LLM)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Initializes the Monologue Agent with an llm, monologue, and memory."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"llm (LLM): The llm to be used by this agent"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"step",children:"step"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def step(state: State) -> Action\n"})}),"\n",(0,o.jsx)(n.p,{children:"Modifies the current state by adding the most recent actions and observations, then prompts the model to think about it's next action to take using monologue, memory, and hint."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"state (State): The current state based on previous steps taken"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Action: The next action to take based on LLM response"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"search_memory",children:"search_memory"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def search_memory(query: str) -> List[str]\n"})}),"\n",(0,o.jsx)(n.p,{children:"Uses VectorIndexRetriever to find related memories within the long term memory.\nUses search to produce top 10 results."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"query (str): The query that we want to find related memories for"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"List[str]: A list of top 10 text results that matched the query"}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>i});var o=t(6540);const s={},r=o.createContext(s);function l(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8659],{759:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>r,default:()=>l,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var o=t(4848),i=t(8453);const a={sidebar_label:"action",title:"opendevin.action"},r=void 0,s={id:"python/opendevin/action/__init__",title:"opendevin.action",description:"ACTION\\TYPE\\TO\\_CLASS",source:"@site/modules/python/opendevin/action/__init__.md",sourceDirName:"python/opendevin/action",slug:"/python/opendevin/action/__init__",permalink:"/OpenDevin/modules/python/opendevin/action/__init__",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"action",title:"opendevin.action"},sidebar:"apiSidebar",previous:{title:"prompt",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/prompt"},next:{title:"base",permalink:"/OpenDevin/modules/python/opendevin/action/base"}},c={},p=[{value:"ACTION_TYPE_TO_CLASS",id:"action_type_to_class",level:4}];function d(n){const e={h4:"h4",p:"p",...(0,i.R)(),...n.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e.h4,{id:"action_type_to_class",children:"ACTION_TYPE_TO_CLASS"}),"\n",(0,o.jsx)(e.p,{children:"type: ignore[attr-defined]"})]})}function l(n={}){const{wrapper:e}={...(0,i.R)(),...n.components};return e?(0,o.jsx)(e,{...n,children:(0,o.jsx)(d,{...n})}):d(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>r,x:()=>s});var o=t(6540);const i={},a=o.createContext(i);function r(n){const e=o.useContext(a);return o.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function s(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(i):n.components||i:r(n.components),o.createElement(a.Provider,{value:e},n.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1865],{1790:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>s,default:()=>i,frontMatter:()=>u,metadata:()=>r,toc:()=>d});var a=n(4848),o=n(8453);const u={sidebar_label:"agent",title:"agenthub.dummy_agent.agent"},s=void 0,r={id:"python/agenthub/dummy_agent/agent",title:"agenthub.dummy_agent.agent",description:"Module for a Dummy agent.",source:"@site/modules/python/agenthub/dummy_agent/agent.md",sourceDirName:"python/agenthub/dummy_agent",slug:"/python/agenthub/dummy_agent/agent",permalink:"/OpenDevin/modules/python/agenthub/dummy_agent/agent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"agent",title:"agenthub.dummy_agent.agent"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/delegator_agent/agent"},next:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/micro/agent"}},m={},d=[{value:"DummyAgent Objects",id:"dummyagent-objects",level:2}];function c(e){const t={code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.p,{children:"Module for a Dummy agent."}),"\n",(0,a.jsx)(t.h2,{id:"dummyagent-objects",children:"DummyAgent Objects"}),"\n",(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-python",children:"class DummyAgent(Agent)\n"})}),"\n",(0,a.jsx)(t.p,{children:"A dummy agent that does nothing but can be used in testing."})]})}function i(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(c,{...e})}):c(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>r});var a=n(6540);const o={},u=a.createContext(o);function s(e){const t=a.useContext(u);return a.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),a.createElement(u.Provider,{value:t},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9903],{9619:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>t,default:()=>u,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var i=s(4848),r=s(8453);const o={sidebar_position:2},t="\ud83e\udd16 LLM Backends",l={id:"usage/llms/llms",title:"\ud83e\udd16 LLM Backends",description:"OpenDevin can work with any LLM backend.",source:"@site/modules/usage/llms/llms.md",sourceDirName:"usage/llms",slug:"/usage/llms/",permalink:"/OpenDevin/modules/usage/llms/",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"docsSidebar",previous:{title:"\ud83d\udcbb OpenDevin",permalink:"/OpenDevin/modules/usage/intro"},next:{title:"Azure OpenAI LLM",permalink:"/OpenDevin/modules/usage/llms/azureLLMs"}},a={},d=[{value:"Note on Alternative Models",id:"note-on-alternative-models",level:2},{value:"API retries and rate limits",id:"api-retries-and-rate-limits",level:2}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"-llm-backends",children:"\ud83e\udd16 LLM Backends"}),"\n",(0,i.jsxs)(n.p,{children:["OpenDevin can work with any LLM backend.\nFor a full list of the LM providers and models available, please consult the\n",(0,i.jsx)(n.a,{href:"https://docs.litellm.ai/docs/providers",children:"litellm documentation"}),"."]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"OpenDevin will issue many prompts to the LLM you configure. Most of these LLMs cost money--be sure to set spending limits and monitor usage."})}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"LLM_MODEL"})," environment variable controls which model is used in programmatic interactions.\nBut when using the OpenDevin UI, you'll need to choose your model in the settings window (the gear\nwheel on the bottom left)."]}),"\n",(0,i.jsx)(n.p,{children:"The following environment variables might be necessary for some LLMs:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"LLM_API_KEY"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"LLM_BASE_URL"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"LLM_EMBEDDING_MODEL"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"LLM_EMBEDDING_DEPLOYMENT_NAME"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.code,{children:"LLM_API_VERSION"})}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"We have a few guides for running OpenDevin with specific model providers:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"llms/localLLMs",children:"ollama"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"llms/azureLLMs",children:"Azure"})}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"If you're using another provider, we encourage you to open a PR to share your setup!"}),"\n",(0,i.jsx)(n.h2,{id:"note-on-alternative-models",children:"Note on Alternative Models"}),"\n",(0,i.jsx)(n.p,{children:"The best models are GPT-4 and Claude 3. Current local and open source models are\nnot nearly as powerful. When using an alternative model,\nyou may see long wait times between messages,\npoor responses, or errors about malformed JSON. OpenDevin\ncan only be as powerful as the models driving it--fortunately folks on our team\nare actively working on building better open source models!"}),"\n",(0,i.jsx)(n.h2,{id:"api-retries-and-rate-limits",children:"API retries and rate limits"}),"\n",(0,i.jsxs)(n.p,{children:["Some LLMs have rate limits and may require retries. OpenDevin will automatically retry requests if it receives a 429 error or API connection error.\nYou can set ",(0,i.jsx)(n.code,{children:"LLM_NUM_RETRIES"}),", ",(0,i.jsx)(n.code,{children:"LLM_RETRY_MIN_WAIT"}),", ",(0,i.jsx)(n.code,{children:"LLM_RETRY_MAX_WAIT"})," environment variables to control the number of retries and the time between retries.\nBy default, ",(0,i.jsx)(n.code,{children:"LLM_NUM_RETRIES"})," is 5 and ",(0,i.jsx)(n.code,{children:"LLM_RETRY_MIN_WAIT"}),", ",(0,i.jsx)(n.code,{children:"LLM_RETRY_MAX_WAIT"})," are 3 seconds and respectively 60 seconds."]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>l});var i=s(6540);const r={},o=i.createContext(r);function t(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:t(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8396],{6713:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>r,default:()=>c,frontMatter:()=>o,metadata:()=>p,toc:()=>d});var s=t(4848),i=t(8453);const o={sidebar_label:"jupyter",title:"opendevin.sandbox.plugins.jupyter"},r=void 0,p={id:"python/opendevin/sandbox/plugins/jupyter/__init__",title:"opendevin.sandbox.plugins.jupyter",description:"JupyterRequirement Objects",source:"@site/modules/python/opendevin/sandbox/plugins/jupyter/__init__.md",sourceDirName:"python/opendevin/sandbox/plugins/jupyter",slug:"/python/opendevin/sandbox/plugins/jupyter/__init__",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/jupyter/__init__",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"jupyter",title:"opendevin.sandbox.plugins.jupyter"},sidebar:"apiSidebar",previous:{title:"sandbox",permalink:"/OpenDevin/modules/python/opendevin/sandbox/e2b/sandbox"},next:{title:"mixin",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/mixin"}},u={},d=[{value:"JupyterRequirement Objects",id:"jupyterrequirement-objects",level:2},{value:"host_src",id:"host_src",level:4}];function l(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"jupyterrequirement-objects",children:"JupyterRequirement Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass JupyterRequirement(PluginRequirement)\n"})}),"\n",(0,s.jsx)(n.h4,{id:"host_src",children:"host_src"}),"\n",(0,s.jsx)(n.p,{children:"The directory of this file (sandbox/plugins/jupyter)"})]})}function c(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>p});var s=t(6540);const i={},o=s.createContext(i);function r(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function p(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9086],{5184:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var t=n(4848),o=n(8453);const a={sidebar_label:"message",title:"opendevin.observation.message"},r=void 0,i={id:"python/opendevin/observation/message",title:"opendevin.observation.message",description:"UserMessageObservation Objects",source:"@site/modules/python/opendevin/observation/message.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/message",permalink:"/OpenDevin/modules/python/opendevin/observation/message",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"message",title:"opendevin.observation.message"},sidebar:"apiSidebar",previous:{title:"files",permalink:"/OpenDevin/modules/python/opendevin/observation/files"},next:{title:"recall",permalink:"/OpenDevin/modules/python/opendevin/observation/recall"}},c={},l=[{value:"UserMessageObservation Objects",id:"usermessageobservation-objects",level:2},{value:"AgentMessageObservation Objects",id:"agentmessageobservation-objects",level:2}];function d(e){const s={code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h2,{id:"usermessageobservation-objects",children:"UserMessageObservation Objects"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-python",children:"@dataclass\nclass UserMessageObservation(Observation)\n"})}),"\n",(0,t.jsx)(s.p,{children:"This data class represents a message sent by the user."}),"\n",(0,t.jsx)(s.h2,{id:"agentmessageobservation-objects",children:"AgentMessageObservation Objects"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-python",children:"@dataclass\nclass AgentMessageObservation(Observation)\n"})}),"\n",(0,t.jsx)(s.p,{children:"This data class represents a message sent by the agent."})]})}function p(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>r,x:()=>i});var t=n(6540);const o={},a=t.createContext(o);function r(e){const s=t.useContext(a);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),t.createElement(a.Provider,{value:s},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9270],{9230:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>a,frontMatter:()=>s,metadata:()=>r,toc:()=>l});var i=t(4848),o=t(8453);const s={sidebar_label:"github",title:"opendevin.action.github"},c=void 0,r={id:"python/opendevin/action/github",title:"opendevin.action.github",description:"GitHubPushAction Objects",source:"@site/modules/python/opendevin/action/github.md",sourceDirName:"python/opendevin/action",slug:"/python/opendevin/action/github",permalink:"/OpenDevin/modules/python/opendevin/action/github",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"github",title:"opendevin.action.github"},sidebar:"apiSidebar",previous:{title:"fileop",permalink:"/OpenDevin/modules/python/opendevin/action/fileop"},next:{title:"tasks",permalink:"/OpenDevin/modules/python/opendevin/action/tasks"}},h={},l=[{value:"GitHubPushAction Objects",id:"githubpushaction-objects",level:2},{value:"GitHubSendPRAction Objects",id:"githubsendpraction-objects",level:2}];function d(e){const n={code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"githubpushaction-objects",children:"GitHubPushAction Objects"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass GitHubPushAction(ExecutableAction)\n"})}),"\n",(0,i.jsx)(n.p,{children:"This pushes the current branch to github."}),"\n",(0,i.jsx)(n.p,{children:"To use this, you need to set the GITHUB_TOKEN environment variable.\nThe agent will return a message with a URL that you can click to make a pull\nrequest."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Attributes"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"owner"})," - The owner of the source repo"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"repo"})," - The name of the source repo"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"branch"})," - The branch to push"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"action"})," - The action identifier"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"githubsendpraction-objects",children:"GitHubSendPRAction Objects"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass GitHubSendPRAction(ExecutableAction)\n"})}),"\n",(0,i.jsx)(n.p,{children:"An action to send a github PR."}),"\n",(0,i.jsx)(n.p,{children:"To use this, you need to set the GITHUB_TOKEN environment variable."}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Attributes"}),":"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"owner"})," - The owner of the source repo"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"repo"})," - The name of the source repo"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"title"})," - The title of the PR"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"head"})," - The branch to send the PR from"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"head_repo"})," - The repo to send the PR from"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"base"})," - The branch to send the PR to"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"body"})," - The body of the PR"]}),"\n"]})]})}function a(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>r});var i=t(6540);const o={},s=i.createContext(o);function c(e){const n=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),i.createElement(s.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6528],{8305:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>g,frontMatter:()=>a,metadata:()=>o,toc:()=>d});var r=t(4848),s=t(8453);const a={sidebar_label:"manager",title:"opendevin.server.agent.manager"},i=void 0,o={id:"python/opendevin/server/agent/manager",title:"opendevin.server.agent.manager",description:"AgentManager Objects",source:"@site/modules/python/opendevin/server/agent/manager.md",sourceDirName:"python/opendevin/server/agent",slug:"/python/opendevin/server/agent/manager",permalink:"/OpenDevin/modules/python/opendevin/server/agent/manager",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"manager",title:"opendevin.server.agent.manager"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/opendevin/server/agent/"},next:{title:"auth",permalink:"/OpenDevin/modules/python/opendevin/server/auth/"}},c={},d=[{value:"AgentManager Objects",id:"agentmanager-objects",level:2},{value:"register_agent",id:"register_agent",level:4},{value:"dispatch",id:"dispatch",level:4}];function l(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"agentmanager-objects",children:"AgentManager Objects"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"class AgentManager()\n"})}),"\n",(0,r.jsx)(n.h4,{id:"register_agent",children:"register_agent"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"def register_agent(sid: str)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Registers a new agent."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"sid"})," - The session ID of the agent."]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"dispatch",children:"dispatch"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"async def dispatch(sid: str, action: str | None, data: dict)\n"})}),"\n",(0,r.jsx)(n.p,{children:"Dispatches actions to the agent from the client."})]})}function g(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>o});var r=t(6540);const s={},a=r.createContext(s);function i(e){const n=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(a.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2472],{4884:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>p,frontMatter:()=>o,metadata:()=>i,toc:()=>c});var r=s(4848),t=s(8453);const o={sidebar_label:"manager",title:"opendevin.server.session.manager"},a=void 0,i={id:"python/opendevin/server/session/manager",title:"opendevin.server.session.manager",description:"SessionManager Objects",source:"@site/modules/python/opendevin/server/session/manager.md",sourceDirName:"python/opendevin/server/session",slug:"/python/opendevin/server/session/manager",permalink:"/OpenDevin/modules/python/opendevin/server/session/manager",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"manager",title:"opendevin.server.session.manager"},sidebar:"apiSidebar",previous:{title:"auth",permalink:"/OpenDevin/modules/python/opendevin/server/auth/"},next:{title:"msg_stack",permalink:"/OpenDevin/modules/python/opendevin/server/session/msg_stack"}},d={},c=[{value:"SessionManager Objects",id:"sessionmanager-objects",level:2},{value:"send",id:"send",level:4},{value:"send_error",id:"send_error",level:4},{value:"send_message",id:"send_message",level:4}];function l(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"sessionmanager-objects",children:"SessionManager Objects"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"class SessionManager()\n"})}),"\n",(0,r.jsx)(n.h4,{id:"send",children:"send"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"async def send(sid: str, data: Dict[str, object]) -> bool\n"})}),"\n",(0,r.jsx)(n.p,{children:"Sends data to the client."}),"\n",(0,r.jsx)(n.h4,{id:"send_error",children:"send_error"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"async def send_error(sid: str, message: str) -> bool\n"})}),"\n",(0,r.jsx)(n.p,{children:"Sends an error message to the client."}),"\n",(0,r.jsx)(n.h4,{id:"send_message",children:"send_message"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"async def send_message(sid: str, message: str) -> bool\n"})}),"\n",(0,r.jsx)(n.p,{children:"Sends a message to the client."})]})}function p(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>i});var r=s(6540);const t={},o=r.createContext(t);function a(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7859],{1862:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var s=t(4848),a=t(8453);const r={sidebar_label:"agent",title:"agenthub.planner_agent.agent"},i=void 0,l={id:"python/agenthub/planner_agent/agent",title:"agenthub.planner_agent.agent",description:"PlannerAgent Objects",source:"@site/modules/python/agenthub/planner_agent/agent.md",sourceDirName:"python/agenthub/planner_agent",slug:"/python/agenthub/planner_agent/agent",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/agent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"agent",title:"agenthub.planner_agent.agent"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/agent"},next:{title:"prompt",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/prompt"}},o={},c=[{value:"PlannerAgent Objects",id:"planneragent-objects",level:2},{value:"__init__",id:"__init__",level:4},{value:"step",id:"step",level:4}];function p(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"planneragent-objects",children:"PlannerAgent Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"class PlannerAgent(Agent)\n"})}),"\n",(0,s.jsx)(n.p,{children:"The planner agent utilizes a special prompting strategy to create long term plans for solving problems.\nThe agent is given its previous action-observation pairs, current task, and hint based on last action taken at every step."}),"\n",(0,s.jsx)(n.h4,{id:"__init__",children:"__init__"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"def __init__(llm: LLM)\n"})}),"\n",(0,s.jsx)(n.p,{children:"Initialize the Planner Agent with an LLM"}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"llm (LLM): The llm to be used by this agent"}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"step",children:"step"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"def step(state: State) -> Action\n"})}),"\n",(0,s.jsx)(n.p,{children:"Checks to see if current step is completed, returns AgentFinishAction if True.\nOtherwise, creates a plan prompt and sends to model for inference, returning the result as the next action."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"state (State): The current state given the previous actions and observations"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"AgentFinishAction: If the last state was 'completed', 'verified', or 'abandoned'"}),"\n",(0,s.jsx)(n.li,{children:"Action: The next action to take based on llm response"}),"\n"]})]})}function d(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>l});var s=t(6540);const a={},r=s.createContext(a);function i(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3159],{9604:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>c,toc:()=>l});var o=t(4848),r=t(8453);const s={sidebar_label:"agent",title:"agenthub.micro.agent"},i=void 0,c={id:"python/agenthub/micro/agent",title:"agenthub.micro.agent",description:"my\\_encoder",source:"@site/modules/python/agenthub/micro/agent.md",sourceDirName:"python/agenthub/micro",slug:"/python/agenthub/micro/agent",permalink:"/OpenDevin/modules/python/agenthub/micro/agent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"agent",title:"agenthub.micro.agent"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/dummy_agent/agent"},next:{title:"json",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/json"}},a={},l=[{value:"my_encoder",id:"my_encoder",level:4},{value:"to_json",id:"to_json",level:4}];function d(e){const n={code:"code",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h4,{id:"my_encoder",children:"my_encoder"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def my_encoder(obj)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Encodes objects as dictionaries"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"obj (Object): An object that will be converted"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"dict: If the object can be converted it is returned in dict format"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"to_json",children:"to_json"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def to_json(obj, **kwargs)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Serialize an object to str format"})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>c});var o=t(6540);const r={},s=o.createContext(r);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2902],{3942:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>a,frontMatter:()=>r,metadata:()=>c,toc:()=>p});var o=t(4848),i=t(8453);const r={sidebar_label:"config",title:"opendevin.config"},s=void 0,c={id:"python/opendevin/config",title:"opendevin.config",description:"get",source:"@site/modules/python/opendevin/config.md",sourceDirName:"python/opendevin",slug:"/python/opendevin/config",permalink:"/OpenDevin/modules/python/opendevin/config",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"config",title:"opendevin.config"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/opendevin/agent"},next:{title:"files",permalink:"/OpenDevin/modules/python/opendevin/files"}},d={},p=[{value:"get",id:"get",level:4}];function l(e){const n={code:"code",h4:"h4",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h4,{id:"get",children:"get"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def get(key: ConfigType, required: bool = False)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Get a key from the environment variables or config.toml or default configs."})]})}function a(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>c});var o=t(6540);const i={},r=o.createContext(i);function s(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9647],{7121:(e,s,r)=>{r.r(s),r.d(s,{default:()=>l});r(6540);var c=r(4164),u=r(1003),a=r(7559),d=r(2831),n=r(781),t=r(4848);function l(e){return(0,t.jsx)(u.e3,{className:(0,c.A)(a.G.wrapper.docsPages),children:(0,t.jsx)(n.A,{children:(0,d.v)(e.route.routes)})})}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5360],{8613:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>r,default:()=>c,frontMatter:()=>s,metadata:()=>a,toc:()=>d});var o=t(4848),i=t(8453);const s={sidebar_label:"observation",title:"opendevin.observation"},r=void 0,a={id:"python/opendevin/observation/__init__",title:"opendevin.observation",description:"OBSERVATION\\TYPE\\TO\\_CLASS",source:"@site/modules/python/opendevin/observation/__init__.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/__init__",permalink:"/OpenDevin/modules/python/opendevin/observation/__init__",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"observation",title:"opendevin.observation"},sidebar:"apiSidebar",previous:{title:"llm",permalink:"/OpenDevin/modules/python/opendevin/llm/"},next:{title:"base",permalink:"/OpenDevin/modules/python/opendevin/observation/base"}},p={},d=[{value:"OBSERVATION_TYPE_TO_CLASS",id:"observation_type_to_class",level:4}];function l(e){const n={h4:"h4",p:"p",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h4,{id:"observation_type_to_class",children:"OBSERVATION_TYPE_TO_CLASS"}),"\n",(0,o.jsx)(n.p,{children:"type: ignore[attr-defined]"})]})}function c(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var o=t(6540);const i={},s=o.createContext(i);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8726],{8343:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>p,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var s=n(4848),a=n(8453);const r={sidebar_label:"agent",title:"agenthub.SWE_agent.agent"},o=void 0,c={id:"python/agenthub/SWE_agent/agent",title:"agenthub.SWE_agent.agent",description:"SWEAgent Objects",source:"@site/modules/python/agenthub/SWE_agent/agent.md",sourceDirName:"python/agenthub/SWE_agent",slug:"/python/agenthub/SWE_agent/agent",permalink:"/OpenDevin/modules/python/agenthub/SWE_agent/agent",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"agent",title:"agenthub.SWE_agent.agent"},sidebar:"apiSidebar",next:{title:"parser",permalink:"/OpenDevin/modules/python/agenthub/SWE_agent/parser"}},i={},l=[{value:"SWEAgent Objects",id:"sweagent-objects",level:2},{value:"step",id:"step",level:4},{value:"reset",id:"reset",level:4}];function d(e){const t={code:"code",h2:"h2",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"sweagent-objects",children:"SWEAgent Objects"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"class SWEAgent(Agent)\n"})}),"\n",(0,s.jsx)(t.p,{children:"An attempt to recreate swe_agent with output parsing, prompting style, and Application Computer Interface (ACI)."}),"\n",(0,s.jsx)(t.p,{children:"SWE-agent includes ACI functions like 'goto', 'search_for', 'edit', 'scroll', 'run'"}),"\n",(0,s.jsx)(t.h4,{id:"step",children:"step"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def step(state: State) -> Action\n"})}),"\n",(0,s.jsx)(t.p,{children:"SWE-Agent step:"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Get context - past actions, custom commands, current step"}),"\n",(0,s.jsx)(t.li,{children:"Perform think-act - prompt model for action and reasoning"}),"\n",(0,s.jsx)(t.li,{children:"Catch errors - ensure model takes action (5 attempts max)"}),"\n"]}),"\n",(0,s.jsx)(t.h4,{id:"reset",children:"reset"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-python",children:"def reset() -> None\n"})}),"\n",(0,s.jsx)(t.p,{children:"Used to reset the agent"})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>c});var s=n(6540);const a={},r=s.createContext(a);function o(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1309],{1409:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>s,toc:()=>l});var i=t(4848),r=t(8453);const a={sidebar_label:"main",title:"opendevin.main"},o=void 0,s={id:"python/opendevin/main",title:"opendevin.main",description:"read\\task\\from\\_file",source:"@site/modules/python/opendevin/main.md",sourceDirName:"python/opendevin",slug:"/python/opendevin/main",permalink:"/OpenDevin/modules/python/opendevin/main",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"main",title:"opendevin.main"},sidebar:"apiSidebar",previous:{title:"logger",permalink:"/OpenDevin/modules/python/opendevin/logger"},next:{title:"plan",permalink:"/OpenDevin/modules/python/opendevin/plan"}},d={},l=[{value:"read_task_from_file",id:"read_task_from_file",level:4},{value:"read_task_from_stdin",id:"read_task_from_stdin",level:4},{value:"main",id:"main",level:4}];function c(e){const n={code:"code",h4:"h4",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h4,{id:"read_task_from_file",children:"read_task_from_file"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"def read_task_from_file(file_path: str) -> str\n"})}),"\n",(0,i.jsx)(n.p,{children:"Read task from the specified file."}),"\n",(0,i.jsx)(n.h4,{id:"read_task_from_stdin",children:"read_task_from_stdin"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"def read_task_from_stdin() -> str\n"})}),"\n",(0,i.jsx)(n.p,{children:"Read task from stdin."}),"\n",(0,i.jsx)(n.h4,{id:"main",children:"main"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"async def main(task_str: str = '')\n"})}),"\n",(0,i.jsx)(n.p,{children:"Main coroutine to run the agent controller with task input flexibility."})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>s});var i=t(6540);const r={},a=i.createContext(r);function o(e){const n=i.useContext(a);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8078],{4061:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9200],{375:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>r,contentTitle:()=>i,default:()=>p,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var o=n(4848),a=n(8453);const s={sidebar_label:"tasks",title:"opendevin.action.tasks"},i=void 0,c={id:"python/opendevin/action/tasks",title:"opendevin.action.tasks",description:"TaskStateChangedAction Objects",source:"@site/modules/python/opendevin/action/tasks.md",sourceDirName:"python/opendevin/action",slug:"/python/opendevin/action/tasks",permalink:"/OpenDevin/modules/python/opendevin/action/tasks",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"tasks",title:"opendevin.action.tasks"},sidebar:"apiSidebar",previous:{title:"github",permalink:"/OpenDevin/modules/python/opendevin/action/github"},next:{title:"agent_controller",permalink:"/OpenDevin/modules/python/opendevin/controller/agent_controller"}},r={},d=[{value:"TaskStateChangedAction Objects",id:"taskstatechangedaction-objects",level:2}];function l(e){const t={code:"code",h2:"h2",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"taskstatechangedaction-objects",children:"TaskStateChangedAction Objects"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:"@dataclass\nclass TaskStateChangedAction(NotExecutableAction)\n"})}),"\n",(0,o.jsx)(t.p,{children:"Fake action, just to notify the client that a task state has changed."})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>c});var o=n(6540);const a={},s=o.createContext(a);function i(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5289],{6771:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>d});var r=t(4848),s=t(8453);const a={sidebar_label:"parser",title:"agenthub.SWE_agent.parser"},o=void 0,i={id:"python/agenthub/SWE_agent/parser",title:"agenthub.SWE_agent.parser",description:"get\\action\\from\\_string",source:"@site/modules/python/agenthub/SWE_agent/parser.md",sourceDirName:"python/agenthub/SWE_agent",slug:"/python/agenthub/SWE_agent/parser",permalink:"/OpenDevin/modules/python/agenthub/SWE_agent/parser",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"parser",title:"agenthub.SWE_agent.parser"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/SWE_agent/agent"},next:{title:"codeact_agent",permalink:"/OpenDevin/modules/python/agenthub/codeact_agent/"}},c={},d=[{value:"get_action_from_string",id:"get_action_from_string",level:4},{value:"parse_command",id:"parse_command",level:4}];function l(n){const e={code:"code",em:"em",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.h4,{id:"get_action_from_string",children:"get_action_from_string"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"def get_action_from_string(command_string: str,\n path: str,\n line: int,\n thoughts: str = '') -> Action | None\n"})}),"\n",(0,r.jsx)(e.p,{children:"Parses the command string to find which command the agent wants to run\nConverts the command into a proper Action and returns"}),"\n",(0,r.jsx)(e.h4,{id:"parse_command",children:"parse_command"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"def parse_command(input_str: str, path: str, line: int)\n"})}),"\n",(0,r.jsx)(e.p,{children:"Parses a given string and separates the command (enclosed in triple backticks) from any accompanying text."}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Arguments"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.code,{children:"input_str"})," ",(0,r.jsx)(e.em,{children:"str"})," - The input string to be parsed."]}),"\n"]}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Returns"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsxs)(e.li,{children:[(0,r.jsx)(e.code,{children:"tuple"})," - A tuple containing the command and the accompanying text (if any)."]}),"\n"]})]})}function p(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(l,{...n})}):l(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>o,x:()=>i});var r=t(6540);const s={},a=r.createContext(s);function o(n){const e=r.useContext(a);return r.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function i(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:o(n.components),r.createElement(a.Provider,{value:e},n.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5650],{3577:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>r,toc:()=>a});var o=t(4848),s=t(8453);const l={sidebar_label:"monologue",title:"agenthub.monologue_agent.utils.monologue"},i=void 0,r={id:"python/agenthub/monologue_agent/utils/monologue",title:"agenthub.monologue_agent.utils.monologue",description:"Monologue Objects",source:"@site/modules/python/agenthub/monologue_agent/utils/monologue.md",sourceDirName:"python/agenthub/monologue_agent/utils",slug:"/python/agenthub/monologue_agent/utils/monologue",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/monologue",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"monologue",title:"agenthub.monologue_agent.utils.monologue"},sidebar:"apiSidebar",previous:{title:"memory",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/memory"},next:{title:"prompts",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/prompts"}},h={},a=[{value:"Monologue Objects",id:"monologue-objects",level:2},{value:"__init__",id:"__init__",level:4},{value:"add_event",id:"add_event",level:4},{value:"get_thoughts",id:"get_thoughts",level:4},{value:"get_total_length",id:"get_total_length",level:4},{value:"condense",id:"condense",level:4}];function d(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"monologue-objects",children:"Monologue Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"class Monologue()\n"})}),"\n",(0,o.jsx)(n.p,{children:"The monologue is a representation for the agent's internal monologue where it can think.\nThe agent has the capability of using this monologue for whatever it wants."}),"\n",(0,o.jsx)(n.h4,{id:"__init__",children:"__init__"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def __init__()\n"})}),"\n",(0,o.jsx)(n.p,{children:"Initialize the empty list of thoughts"}),"\n",(0,o.jsx)(n.h4,{id:"add_event",children:"add_event"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def add_event(t: dict)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Adds an event to memory if it is a valid event."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"t (dict): The thought that we want to add to memory"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Raises"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"AgentEventTypeError: If t is not a dict"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"get_thoughts",children:"get_thoughts"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def get_thoughts()\n"})}),"\n",(0,o.jsx)(n.p,{children:"Get the current thoughts of the agent."}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"List: The list of thoughts that the agent has."}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"get_total_length",children:"get_total_length"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def get_total_length()\n"})}),"\n",(0,o.jsx)(n.p,{children:"Gives the total number of characters in all thoughts"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Int: Total number of chars in thoughts."}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"condense",children:"condense"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def condense(llm: LLM)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Attempts to condense the monologue by using the llm"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"llm (LLM): llm to be used for summarization"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Raises"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Exception: the same exception as it got from the llm or processing the response"}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>r});var o=t(6540);const s={},l=o.createContext(s);function i(e){const n=o.useContext(l);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(l.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7127],{1519:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>d,toc:()=>o});var s=t(4848),i=t(8453);const a={sidebar_label:"task",title:"opendevin.schema.task"},r=void 0,d={id:"python/opendevin/schema/task",title:"opendevin.schema.task",description:"TaskState Objects",source:"@site/modules/python/opendevin/schema/task.md",sourceDirName:"python/opendevin/schema",slug:"/python/opendevin/schema/task",permalink:"/OpenDevin/modules/python/opendevin/schema/task",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"task",title:"opendevin.schema.task"},sidebar:"apiSidebar",previous:{title:"observation",permalink:"/OpenDevin/modules/python/opendevin/schema/observation"},next:{title:"agent",permalink:"/OpenDevin/modules/python/opendevin/server/agent/"}},l={},o=[{value:"TaskState Objects",id:"taskstate-objects",level:2},{value:"INIT",id:"init",level:4},{value:"RUNNING",id:"running",level:4},{value:"PAUSED",id:"paused",level:4},{value:"STOPPED",id:"stopped",level:4},{value:"FINISHED",id:"finished",level:4},{value:"ERROR",id:"error",level:4},{value:"TaskStateAction Objects",id:"taskstateaction-objects",level:2},{value:"START",id:"start",level:4},{value:"PAUSE",id:"pause",level:4},{value:"RESUME",id:"resume",level:4},{value:"STOP",id:"stop",level:4}];function c(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"taskstate-objects",children:"TaskState Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"class TaskState(str, Enum)\n"})}),"\n",(0,s.jsx)(n.h4,{id:"init",children:"INIT"}),"\n",(0,s.jsx)(n.p,{children:"Initial state of the task."}),"\n",(0,s.jsx)(n.h4,{id:"running",children:"RUNNING"}),"\n",(0,s.jsx)(n.p,{children:"The task is running."}),"\n",(0,s.jsx)(n.h4,{id:"paused",children:"PAUSED"}),"\n",(0,s.jsx)(n.p,{children:"The task is paused."}),"\n",(0,s.jsx)(n.h4,{id:"stopped",children:"STOPPED"}),"\n",(0,s.jsx)(n.p,{children:"The task is stopped."}),"\n",(0,s.jsx)(n.h4,{id:"finished",children:"FINISHED"}),"\n",(0,s.jsx)(n.p,{children:"The task is finished."}),"\n",(0,s.jsx)(n.h4,{id:"error",children:"ERROR"}),"\n",(0,s.jsx)(n.p,{children:"An error occurred during the task."}),"\n",(0,s.jsx)(n.h2,{id:"taskstateaction-objects",children:"TaskStateAction Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"class TaskStateAction(str, Enum)\n"})}),"\n",(0,s.jsx)(n.h4,{id:"start",children:"START"}),"\n",(0,s.jsx)(n.p,{children:"Starts the task."}),"\n",(0,s.jsx)(n.h4,{id:"pause",children:"PAUSE"}),"\n",(0,s.jsx)(n.p,{children:"Pauses the task."}),"\n",(0,s.jsx)(n.h4,{id:"resume",children:"RESUME"}),"\n",(0,s.jsx)(n.p,{children:"Resumes the task."}),"\n",(0,s.jsx)(n.h4,{id:"stop",children:"STOP"}),"\n",(0,s.jsx)(n.p,{children:"Stops the task."})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>d});var s=t(6540);const i={},a=s.createContext(i);function r(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1487],{4308:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var o=t(4848),i=t(8453);const a={sidebar_label:"fileop",title:"opendevin.action.fileop"},c=void 0,s={id:"python/opendevin/action/fileop",title:"opendevin.action.fileop",description:"FileReadAction Objects",source:"@site/modules/python/opendevin/action/fileop.md",sourceDirName:"python/opendevin/action",slug:"/python/opendevin/action/fileop",permalink:"/OpenDevin/modules/python/opendevin/action/fileop",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"fileop",title:"opendevin.action.fileop"},sidebar:"apiSidebar",previous:{title:"base",permalink:"/OpenDevin/modules/python/opendevin/action/base"},next:{title:"github",permalink:"/OpenDevin/modules/python/opendevin/action/github"}},l={},p=[{value:"FileReadAction Objects",id:"filereadaction-objects",level:2}];function r(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"filereadaction-objects",children:"FileReadAction Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass FileReadAction(ExecutableAction)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Reads a file from a given path.\nCan be set to read specific lines using start and end\nDefault lines 0:-1 (whole file)"})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(r,{...e})}):r(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>s});var o=t(6540);const i={},a=o.createContext(i);function c(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function s(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3815],{2956:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>r,default:()=>p,frontMatter:()=>i,metadata:()=>a,toc:()=>c});var s=t(4848),o=t(8453);const i={sidebar_label:"files",title:"opendevin.observation.files"},r=void 0,a={id:"python/opendevin/observation/files",title:"opendevin.observation.files",description:"FileReadObservation Objects",source:"@site/modules/python/opendevin/observation/files.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/files",permalink:"/OpenDevin/modules/python/opendevin/observation/files",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"files",title:"opendevin.observation.files"},sidebar:"apiSidebar",previous:{title:"error",permalink:"/OpenDevin/modules/python/opendevin/observation/error"},next:{title:"message",permalink:"/OpenDevin/modules/python/opendevin/observation/message"}},l={},c=[{value:"FileReadObservation Objects",id:"filereadobservation-objects",level:2},{value:"FileWriteObservation Objects",id:"filewriteobservation-objects",level:2}];function d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"filereadobservation-objects",children:"FileReadObservation Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass FileReadObservation(Observation)\n"})}),"\n",(0,s.jsx)(n.p,{children:"This data class represents the content of a file."}),"\n",(0,s.jsx)(n.h2,{id:"filewriteobservation-objects",children:"FileWriteObservation Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass FileWriteObservation(Observation)\n"})}),"\n",(0,s.jsx)(n.p,{children:"This data class represents a file write operation"})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>a});var s=t(6540);const o={},i=s.createContext(o);function r(e){const n=s.useContext(i);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),s.createElement(i.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9818],{421:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>i,contentTitle:()=>r,default:()=>l,frontMatter:()=>d,metadata:()=>a,toc:()=>c});var t=o(4848),s=o(8453);const d={sidebar_label:"sandbox",title:"opendevin.sandbox.e2b.sandbox"},r=void 0,a={id:"python/opendevin/sandbox/e2b/sandbox",title:"opendevin.sandbox.e2b.sandbox",description:"E2BBox Objects",source:"@site/modules/python/opendevin/sandbox/e2b/sandbox.md",sourceDirName:"python/opendevin/sandbox/e2b",slug:"/python/opendevin/sandbox/e2b/sandbox",permalink:"/OpenDevin/modules/python/opendevin/sandbox/e2b/sandbox",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"sandbox",title:"opendevin.sandbox.e2b.sandbox"},sidebar:"apiSidebar",previous:{title:"process",permalink:"/OpenDevin/modules/python/opendevin/sandbox/docker/process"},next:{title:"jupyter",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/jupyter/__init__"}},i={},c=[{value:"E2BBox Objects",id:"e2bbox-objects",level:2},{value:"copy_to",id:"copy_to",level:4}];function p(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"e2bbox-objects",children:"E2BBox Objects"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"class E2BBox(Sandbox)\n"})}),"\n",(0,t.jsx)(n.h4,{id:"copy_to",children:"copy_to"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:"def copy_to(host_src: str, sandbox_dest: str, recursive: bool = False)\n"})}),"\n",(0,t.jsx)(n.p,{children:"Copies a local file or directory to the sandbox."})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}},8453:(e,n,o)=>{o.d(n,{R:()=>r,x:()=>a});var t=o(6540);const s={},d=t.createContext(s);function r(e){const n=t.useContext(d);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),t.createElement(d.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4534],{8368:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>c,frontMatter:()=>s,metadata:()=>a,toc:()=>l});var o=i(4848),t=i(8453);const s={},r="Azure OpenAI LLM",a={id:"usage/llms/azureLLMs",title:"Azure OpenAI LLM",description:"Completion",source:"@site/modules/usage/llms/azureLLMs.md",sourceDirName:"usage/llms",slug:"/usage/llms/azureLLMs",permalink:"/OpenDevin/modules/usage/llms/azureLLMs",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"docsSidebar",previous:{title:"\ud83e\udd16 LLM Backends",permalink:"/OpenDevin/modules/usage/llms/"},next:{title:"Google Gemini/Vertex LLM",permalink:"/OpenDevin/modules/usage/llms/googleLLMs"}},d={},l=[{value:"Completion",id:"completion",level:2},{value:"Azure openai configs",id:"azure-openai-configs",level:3},{value:"Embeddings",id:"embeddings",level:2},{value:"Azure openai configs",id:"azure-openai-configs-1",level:3}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"azure-openai-llm",children:"Azure OpenAI LLM"}),"\n",(0,o.jsx)(n.h2,{id:"completion",children:"Completion"}),"\n",(0,o.jsxs)(n.p,{children:["OpenDevin uses LiteLLM for completion calls. You can find their documentation on Azure ",(0,o.jsx)(n.a,{href:"https://docs.litellm.ai/docs/providers/azure",children:"here"})]}),"\n",(0,o.jsx)(n.h3,{id:"azure-openai-configs",children:"Azure openai configs"}),"\n",(0,o.jsxs)(n.p,{children:["When running the OpenDevin Docker image, you'll need to set the following environment variables using ",(0,o.jsx)(n.code,{children:"-e"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'LLM_BASE_URL="<azure-api-base-url>" # e.g. "https://openai-gpt-4-test-v-1.openai.azure.com/"\nLLM_API_KEY="<azure-api-key>"\nLLM_MODEL="azure/<your-gpt-deployment-name>"\nLLM_API_VERSION = "<api-version>" # e.g. "2024-02-15-preview"\n'})}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"You can find your ChatGPT deployment name on the deployments page in Azure. It could be the same with the chat model name (e.g. 'GPT4-1106-preview'), by default or initially set, but it doesn't have to be the same. Run opendevin, and when you load it in the browser, go to Settings and set model as above: \"azure/<your-actual-gpt-deployment-name>\". If it's not in the list, enter your own text and save it."})}),"\n",(0,o.jsx)(n.h2,{id:"embeddings",children:"Embeddings"}),"\n",(0,o.jsxs)(n.p,{children:["OpenDevin uses llama-index for embeddings. You can find their documentation on Azure ",(0,o.jsx)(n.a,{href:"https://docs.llamaindex.ai/en/stable/api_reference/embeddings/azure_openai/",children:"here"})]}),"\n",(0,o.jsx)(n.h3,{id:"azure-openai-configs-1",children:"Azure openai configs"}),"\n",(0,o.jsx)(n.p,{children:'The model used for Azure OpenAI embeddings is "text-embedding-ada-002".\nYou need the correct deployment name for this model in your Azure account.'}),"\n",(0,o.jsxs)(n.p,{children:["When running OpenDevin in Docker, set the following environment variables using ",(0,o.jsx)(n.code,{children:"-e"}),":"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:'LLM_EMBEDDING_MODEL="azureopenai"\nLLM_EMBEDDING_DEPLOYMENT_NAME = "<your-embedding-deployment-name>" # e.g. "TextEmbedding...<etc>"\nLLM_API_VERSION = "<api-version>" # e.g. "2024-02-15-preview"\n'})})]})}function c(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(u,{...e})}):u(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>r,x:()=>a});var o=i(6540);const t={},s=o.createContext(t);function r(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1976],{3202:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=t(4848),s=t(8453);const r={sidebar_label:"recall",title:"opendevin.observation.recall"},a=void 0,i={id:"python/opendevin/observation/recall",title:"opendevin.observation.recall",description:"AgentRecallObservation Objects",source:"@site/modules/python/opendevin/observation/recall.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/recall",permalink:"/OpenDevin/modules/python/opendevin/observation/recall",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"recall",title:"opendevin.observation.recall"},sidebar:"apiSidebar",previous:{title:"message",permalink:"/OpenDevin/modules/python/opendevin/observation/message"},next:{title:"run",permalink:"/OpenDevin/modules/python/opendevin/observation/run"}},l={},c=[{value:"AgentRecallObservation Objects",id:"agentrecallobservation-objects",level:2}];function d(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"agentrecallobservation-objects",children:"AgentRecallObservation Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass AgentRecallObservation(Observation)\n"})}),"\n",(0,o.jsx)(n.p,{children:"This data class represents a list of memories recalled by the agent."})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>i});var o=t(6540);const s={},r=o.createContext(s);function a(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7526],{9209:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>a,toc:()=>p});var r=t(4848),s=t(8453);const o={sidebar_label:"prompt",title:"agenthub.planner_agent.prompt"},i=void 0,a={id:"python/agenthub/planner_agent/prompt",title:"agenthub.planner_agent.prompt",description:"get\\_hint",source:"@site/modules/python/agenthub/planner_agent/prompt.md",sourceDirName:"python/agenthub/planner_agent",slug:"/python/agenthub/planner_agent/prompt",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/prompt",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"prompt",title:"agenthub.planner_agent.prompt"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/planner_agent/agent"},next:{title:"action",permalink:"/OpenDevin/modules/python/opendevin/action/__init__"}},l={},p=[{value:"get_hint",id:"get_hint",level:4},{value:"get_prompt",id:"get_prompt",level:4},{value:"parse_response",id:"parse_response",level:4}];function c(n){const e={code:"code",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...n.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.h4,{id:"get_hint",children:"get_hint"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"def get_hint(latest_action_id: str) -> str\n"})}),"\n",(0,r.jsx)(e.p,{children:"Returns action type hint based on given action_id"}),"\n",(0,r.jsx)(e.h4,{id:"get_prompt",children:"get_prompt"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"def get_prompt(plan: Plan, history: List[Tuple[Action, Observation]]) -> str\n"})}),"\n",(0,r.jsx)(e.p,{children:"Gets the prompt for the planner agent.\nFormatted with the most recent action-observation pairs, current task, and hint based on last action"}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Arguments"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"plan (Plan): The original plan outlined by the user with LLM defined tasks"}),"\n",(0,r.jsx)(e.li,{children:"history (List[Tuple[Action, Observation]]): List of corresponding action-observation pairs"}),"\n"]}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Returns"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"str: The formatted string prompt with historical values"}),"\n"]}),"\n",(0,r.jsx)(e.h4,{id:"parse_response",children:"parse_response"}),"\n",(0,r.jsx)(e.pre,{children:(0,r.jsx)(e.code,{className:"language-python",children:"def parse_response(response: str) -> Action\n"})}),"\n",(0,r.jsx)(e.p,{children:"Parses the model output to find a valid action to take"}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Arguments"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"response (str): A response from the model that potentially contains an Action."}),"\n"]}),"\n",(0,r.jsxs)(e.p,{children:[(0,r.jsx)(e.strong,{children:"Returns"}),":"]}),"\n",(0,r.jsxs)(e.ul,{children:["\n",(0,r.jsx)(e.li,{children:"Action: A valid next action to perform from model output"}),"\n"]})]})}function d(n={}){const{wrapper:e}={...(0,s.R)(),...n.components};return e?(0,r.jsx)(e,{...n,children:(0,r.jsx)(c,{...n})}):c(n)}},8453:(n,e,t)=>{t.d(e,{R:()=>i,x:()=>a});var r=t(6540);const s={},o=r.createContext(s);function i(n){const e=r.useContext(o);return r.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function a(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:i(n.components),r.createElement(o.Provider,{value:e},n.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8102],{1966:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6732],{8601:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>l,frontMatter:()=>s,metadata:()=>a,toc:()=>d});var o=r(4848),t=r(8453);const s={sidebar_label:"error",title:"opendevin.observation.error"},i=void 0,a={id:"python/opendevin/observation/error",title:"opendevin.observation.error",description:"AgentErrorObservation Objects",source:"@site/modules/python/opendevin/observation/error.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/error",permalink:"/OpenDevin/modules/python/opendevin/observation/error",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"error",title:"opendevin.observation.error"},sidebar:"apiSidebar",previous:{title:"delegate",permalink:"/OpenDevin/modules/python/opendevin/observation/delegate"},next:{title:"files",permalink:"/OpenDevin/modules/python/opendevin/observation/files"}},c={},d=[{value:"AgentErrorObservation Objects",id:"agenterrorobservation-objects",level:2}];function p(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"agenterrorobservation-objects",children:"AgentErrorObservation Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass AgentErrorObservation(Observation)\n"})}),"\n",(0,o.jsx)(n.p,{children:"This data class represents an error encountered by the agent."})]})}function l(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>i,x:()=>a});var o=r(6540);const t={},s=o.createContext(t);function i(e){const n=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[9294],{7810:(e,n,i)=>{i.r(n),i.d(n,{default:()=>o});var s=i(781),t=i(4848);function o(){return(0,t.jsx)(s.A,{title:"FAQ",description:"Frequently Asked Questions",children:(0,t.jsxs)("div",{id:"faq",style:{maxWidth:"900px",margin:"0px auto",padding:"40px",textAlign:"justify"},children:[(0,t.jsx)("h1",{style:{fontSize:"3rem"},children:"Frequently Asked Questions"}),(0,t.jsx)("h2",{style:{fontSize:"2rem"},children:"Support"}),(0,t.jsx)("h3",{children:"How can I report an issue with OpenDevin?"}),(0,t.jsxs)("p",{children:["Please send us a message on our"," ",(0,t.jsx)("a",{href:"https://discord.gg/mBuDGRzzES",children:"Discord channel"})," or file a bug on"," ",(0,t.jsx)("a",{href:"https://github.com/OpenDevin/OpenDevin/issues",children:"GitHub"})," if you run into any issues!"]}),(0,t.jsx)("h2",{style:{fontSize:"2rem"},children:"General"}),(0,t.jsx)("h3",{children:"What is Devin?"}),(0,t.jsxs)("p",{children:[(0,t.jsx)("span",{style:{fontWeight:"600",color:"var(--logo)"},children:"Devin"})," ","represents a cutting-edge autonomous agent designed to navigate the complexities of software engineering. It leverages a combination of tools such as a shell, code editor, and web browser, showcasing the untapped potential of LLMs in software development. Our goal is to explore and expand upon Devin's capabilities, identifying both its strengths and areas for improvement, to guide the progress of open code models."]}),(0,t.jsx)("h3",{children:"Why OpenDevin?"}),(0,t.jsxs)("p",{children:["The"," ",(0,t.jsx)("span",{style:{fontWeight:"600",color:"var(--logo)"},children:"OpenDevin"})," ","project is born out of a desire to replicate, enhance, and innovate beyond the original Devin model. By engaging the"," ",(0,t.jsx)("a",{href:"https://github.com/OpenDevin/OpenDevin",children:"open-source community"}),", we aim to tackle the challenges faced by Code LLMs in practical scenarios, producing works that significantly contribute to the community and pave the way for future advancements."]})]})})}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6872],{7791:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>l,default:()=>c,frontMatter:()=>o,metadata:()=>a,toc:()=>p});var i=t(4848),s=t(8453);const o={sidebar_label:"system",title:"opendevin.utils.system"},l=void 0,a={id:"python/opendevin/utils/system",title:"opendevin.utils.system",description:"find\\available\\tcp\\_port",source:"@site/modules/python/opendevin/utils/system.md",sourceDirName:"python/opendevin/utils",slug:"/python/opendevin/utils/system",permalink:"/OpenDevin/modules/python/opendevin/utils/system",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"system",title:"opendevin.utils.system"},sidebar:"apiSidebar",previous:{title:"listen",permalink:"/OpenDevin/modules/python/opendevin/server/listen"},next:{title:"agent",permalink:"/OpenDevin/modules/python/opendevin/agent"}},r={},p=[{value:"find_available_tcp_port",id:"find_available_tcp_port",level:4}];function d(e){const n={code:"code",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h4,{id:"find_available_tcp_port",children:"find_available_tcp_port"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"def find_available_tcp_port() -> int\n"})}),"\n",(0,i.jsx)(n.p,{children:"Find an available TCP port, return -1 if none available."})]})}function c(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>a});var i=t(6540);const s={},o=i.createContext(s);function l(e){const n=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[7098],{4532:(n,e,s)=>{s.r(e),s.d(e,{default:()=>d});s(6540);var r=s(1003),o=s(2967),t=s(2252),c=s(2831),i=s(1463),u=s(4848);function a(n){const{version:e}=n;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(i.A,{version:e.version,tag:(0,o.tU)(e.pluginId,e.version)}),(0,u.jsx)(r.be,{children:e.noIndex&&(0,u.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function l(n){const{version:e,route:s}=n;return(0,u.jsx)(r.e3,{className:e.className,children:(0,u.jsx)(t.n,{version:e,children:(0,c.v)(s.routes)})})}function d(n){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a,{...n}),(0,u.jsx)(l,{...n})]})}}}]);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4910],{9140:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>r,default:()=>p,frontMatter:()=>a,metadata:()=>i,toc:()=>l});var o=t(4848),s=t(8453);const a={sidebar_label:"delegate",title:"opendevin.observation.delegate"},r=void 0,i={id:"python/opendevin/observation/delegate",title:"opendevin.observation.delegate",description:"AgentDelegateObservation Objects",source:"@site/modules/python/opendevin/observation/delegate.md",sourceDirName:"python/opendevin/observation",slug:"/python/opendevin/observation/delegate",permalink:"/OpenDevin/modules/python/opendevin/observation/delegate",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"delegate",title:"opendevin.observation.delegate"},sidebar:"apiSidebar",previous:{title:"browse",permalink:"/OpenDevin/modules/python/opendevin/observation/browse"},next:{title:"error",permalink:"/OpenDevin/modules/python/opendevin/observation/error"}},d={},l=[{value:"AgentDelegateObservation Objects",id:"agentdelegateobservation-objects",level:2}];function c(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"agentdelegateobservation-objects",children:"AgentDelegateObservation Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass AgentDelegateObservation(Observation)\n"})}),"\n",(0,o.jsx)(n.p,{children:"This data class represents a delegate observation.\nThis is used when the produced action is NOT executable."})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>r,x:()=>i});var o=t(6540);const s={},a=o.createContext(s);function r(e){const n=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),o.createElement(a.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1730],{2060:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>c,contentTitle:()=>t,default:()=>g,frontMatter:()=>s,metadata:()=>r,toc:()=>d});var i=n(4848),l=n(8453);const s={},t="Google Gemini/Vertex LLM",r={id:"usage/llms/googleLLMs",title:"Google Gemini/Vertex LLM",description:"Completion",source:"@site/modules/usage/llms/googleLLMs.md",sourceDirName:"usage/llms",slug:"/usage/llms/googleLLMs",permalink:"/OpenDevin/modules/usage/llms/googleLLMs",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"docsSidebar",previous:{title:"Azure OpenAI LLM",permalink:"/OpenDevin/modules/usage/llms/azureLLMs"},next:{title:"Local LLM with Ollama",permalink:"/OpenDevin/modules/usage/llms/localLLMs"}},c={},d=[{value:"Completion",id:"completion",level:2},{value:"Gemini - Google AI Studio Configs",id:"gemini---google-ai-studio-configs",level:3},{value:"Vertex AI - Google Cloud Platform Configs",id:"vertex-ai---google-cloud-platform-configs",level:3}];function u(e){const o={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.h1,{id:"google-geminivertex-llm",children:"Google Gemini/Vertex LLM"}),"\n",(0,i.jsx)(o.h2,{id:"completion",children:"Completion"}),"\n",(0,i.jsx)(o.p,{children:"OpenDevin uses LiteLLM for completion calls. The following resources are relevant for using OpenDevin with Google's LLMs"}),"\n",(0,i.jsxs)(o.ul,{children:["\n",(0,i.jsx)(o.li,{children:(0,i.jsx)(o.a,{href:"https://docs.litellm.ai/docs/providers/gemini",children:"Gemini - Google AI Studio"})}),"\n",(0,i.jsx)(o.li,{children:(0,i.jsx)(o.a,{href:"https://docs.litellm.ai/docs/providers/vertex",children:"VertexAI - Google Cloud Platform"})}),"\n"]}),"\n",(0,i.jsx)(o.h3,{id:"gemini---google-ai-studio-configs",children:"Gemini - Google AI Studio Configs"}),"\n",(0,i.jsxs)(o.p,{children:["To use Gemini through Google AI Studio when running the OpenDevin Docker image, you'll need to set the following environment variables using ",(0,i.jsx)(o.code,{children:"-e"}),":"]}),"\n",(0,i.jsx)(o.pre,{children:(0,i.jsx)(o.code,{children:'GEMINI_API_KEY="<your-google-api-key>"\nLLM_MODEL="gemini/gemini-1.5-pro"\n'})}),"\n",(0,i.jsx)(o.h3,{id:"vertex-ai---google-cloud-platform-configs",children:"Vertex AI - Google Cloud Platform Configs"}),"\n",(0,i.jsxs)(o.p,{children:["To use Vertex AI through Google Cloud Platform when running the OpenDevin Docker image, you'll need to set the following environment variables using ",(0,i.jsx)(o.code,{children:"-e"}),":"]}),"\n",(0,i.jsx)(o.pre,{children:(0,i.jsx)(o.code,{children:'GOOGLE_APPLICATION_CREDENTIALS="<json-dump-of-gcp-service-account-json>"\nVERTEXAI_PROJECT="<your-gcp-project-id>"\nVERTEXAI_LOCATION="<your-gcp-location>"\nLLM_MODEL="vertex_ai/<desired-llm-model>"\n'})})]})}function g(e={}){const{wrapper:o}={...(0,l.R)(),...e.components};return o?(0,i.jsx)(o,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},8453:(e,o,n)=>{n.d(o,{R:()=>t,x:()=>r});var i=n(6540);const l={},s=i.createContext(l);function t(e){const o=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(o):{...o,...e}}),[o,e])}function r(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),i.createElement(s.Provider,{value:o},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1707],{1788:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>h,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=t(4848),s=t(8453);const l={sidebar_label:"action",title:"opendevin.schema.action"},a=void 0,o={id:"python/opendevin/schema/action",title:"opendevin.schema.action",description:"ActionTypeSchema Objects",source:"@site/modules/python/opendevin/schema/action.md",sourceDirName:"python/opendevin/schema",slug:"/python/opendevin/schema/action",permalink:"/OpenDevin/modules/python/opendevin/schema/action",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"action",title:"opendevin.schema.action"},sidebar:"apiSidebar",previous:{title:"requirement",permalink:"/OpenDevin/modules/python/opendevin/sandbox/plugins/requirement"},next:{title:"observation",permalink:"/OpenDevin/modules/python/opendevin/schema/observation"}},d={},c=[{value:"ActionTypeSchema Objects",id:"actiontypeschema-objects",level:2},{value:"INIT",id:"init",level:4},{value:"START",id:"start",level:4},{value:"READ",id:"read",level:4},{value:"WRITE",id:"write",level:4},{value:"RUN",id:"run",level:4},{value:"KILL",id:"kill",level:4},{value:"BROWSE",id:"browse",level:4},{value:"RECALL",id:"recall",level:4},{value:"THINK",id:"think",level:4},{value:"DELEGATE",id:"delegate",level:4},{value:"FINISH",id:"finish",level:4},{value:"PAUSE",id:"pause",level:4},{value:"RESUME",id:"resume",level:4},{value:"STOP",id:"stop",level:4},{value:"PUSH",id:"push",level:4},{value:"SEND_PR",id:"send_pr",level:4}];function r(e){const n={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"actiontypeschema-objects",children:"ActionTypeSchema Objects"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:"class ActionTypeSchema(BaseModel)\n"})}),"\n",(0,i.jsx)(n.h4,{id:"init",children:"INIT"}),"\n",(0,i.jsx)(n.p,{children:"Initializes the agent. Only sent by client."}),"\n",(0,i.jsx)(n.h4,{id:"start",children:"START"}),"\n",(0,i.jsx)(n.p,{children:"Starts a new development task. Only sent by the client."}),"\n",(0,i.jsx)(n.h4,{id:"read",children:"READ"}),"\n",(0,i.jsx)(n.p,{children:"Reads the content of a file."}),"\n",(0,i.jsx)(n.h4,{id:"write",children:"WRITE"}),"\n",(0,i.jsx)(n.p,{children:"Writes the content to a file."}),"\n",(0,i.jsx)(n.h4,{id:"run",children:"RUN"}),"\n",(0,i.jsx)(n.p,{children:"Runs a command."}),"\n",(0,i.jsx)(n.h4,{id:"kill",children:"KILL"}),"\n",(0,i.jsx)(n.p,{children:"Kills a background command."}),"\n",(0,i.jsx)(n.h4,{id:"browse",children:"BROWSE"}),"\n",(0,i.jsx)(n.p,{children:"Opens a web page."}),"\n",(0,i.jsx)(n.h4,{id:"recall",children:"RECALL"}),"\n",(0,i.jsx)(n.p,{children:"Searches long-term memory"}),"\n",(0,i.jsx)(n.h4,{id:"think",children:"THINK"}),"\n",(0,i.jsx)(n.p,{children:"Allows the agent to make a plan, set a goal, or record thoughts"}),"\n",(0,i.jsx)(n.h4,{id:"delegate",children:"DELEGATE"}),"\n",(0,i.jsx)(n.p,{children:"Delegates a task to another agent."}),"\n",(0,i.jsx)(n.h4,{id:"finish",children:"FINISH"}),"\n",(0,i.jsx)(n.p,{children:"If you're absolutely certain that you've completed your task and have tested your work,\nuse the finish action to stop working."}),"\n",(0,i.jsx)(n.h4,{id:"pause",children:"PAUSE"}),"\n",(0,i.jsx)(n.p,{children:"Pauses the task."}),"\n",(0,i.jsx)(n.h4,{id:"resume",children:"RESUME"}),"\n",(0,i.jsx)(n.p,{children:"Resumes the task."}),"\n",(0,i.jsx)(n.h4,{id:"stop",children:"STOP"}),"\n",(0,i.jsx)(n.p,{children:"Stops the task. Must send a start action to restart a new task."}),"\n",(0,i.jsx)(n.h4,{id:"push",children:"PUSH"}),"\n",(0,i.jsx)(n.p,{children:"Push a branch to github."}),"\n",(0,i.jsx)(n.h4,{id:"send_pr",children:"SEND_PR"}),"\n",(0,i.jsx)(n.p,{children:"Send a PR to github."})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(r,{...e})}):r(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>o});var i=t(6540);const s={},l=i.createContext(s);function a(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8750],{2464:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>c,metadata:()=>a,toc:()=>r});var o=t(4848),i=t(8453);const c={sidebar_label:"base",title:"opendevin.action.base"},s=void 0,a={id:"python/opendevin/action/base",title:"opendevin.action.base",description:"NullAction Objects",source:"@site/modules/python/opendevin/action/base.md",sourceDirName:"python/opendevin/action",slug:"/python/opendevin/action/base",permalink:"/OpenDevin/modules/python/opendevin/action/base",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"base",title:"opendevin.action.base"},sidebar:"apiSidebar",previous:{title:"action",permalink:"/OpenDevin/modules/python/opendevin/action/__init__"},next:{title:"fileop",permalink:"/OpenDevin/modules/python/opendevin/action/fileop"}},l={},r=[{value:"NullAction Objects",id:"nullaction-objects",level:2}];function p(e){const n={code:"code",h2:"h2",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h2,{id:"nullaction-objects",children:"NullAction Objects"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"@dataclass\nclass NullAction(NotExecutableAction)\n"})}),"\n",(0,o.jsx)(n.p,{children:"An action that does nothing."})]})}function d(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(p,{...e})}):p(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>s,x:()=>a});var o=t(6540);const i={},c=o.createContext(i);function s(e){const n=o.useContext(c);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),o.createElement(c.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2042],{1865:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>c,frontMatter:()=>l,metadata:()=>r,toc:()=>d});var s=t(4848),i=t(8453);const l={sidebar_label:"listen",title:"opendevin.server.listen"},o=void 0,r={id:"python/opendevin/server/listen",title:"opendevin.server.listen",description:"get\\litellm\\models",source:"@site/modules/python/opendevin/server/listen.md",sourceDirName:"python/opendevin/server",slug:"/python/opendevin/server/listen",permalink:"/OpenDevin/modules/python/opendevin/server/listen",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"listen",title:"opendevin.server.listen"},sidebar:"apiSidebar",previous:{title:"session",permalink:"/OpenDevin/modules/python/opendevin/server/session/"},next:{title:"system",permalink:"/OpenDevin/modules/python/opendevin/utils/system"}},a={},d=[{value:"get_litellm_models",id:"get_litellm_models",level:4},{value:"get_agents",id:"get_agents",level:4},{value:"get_token",id:"get_token",level:4}];function p(e){const n={code:"code",h4:"h4",p:"p",pre:"pre",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h4,{id:"get_litellm_models",children:"get_litellm_models"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@app.get('/api/litellm-models')\nasync def get_litellm_models()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Get all models supported by LiteLLM."}),"\n",(0,s.jsx)(n.h4,{id:"get_agents",children:"get_agents"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@app.get('/api/agents')\nasync def get_agents()\n"})}),"\n",(0,s.jsx)(n.p,{children:"Get all agents supported by LiteLLM."}),"\n",(0,s.jsx)(n.h4,{id:"get_token",children:"get_token"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"@app.get('/api/auth')\nasync def get_token(\n credentials: HTTPAuthorizationCredentials = Depends(security_scheme))\n"})}),"\n",(0,s.jsx)(n.p,{children:"Generate a JWT for authentication when starting a WebSocket connection. This endpoint checks if valid credentials\nare provided and uses them to get a session ID. If no valid credentials are provided, it generates a new session ID."})]})}function c(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>o,x:()=>r});var s=t(6540);const i={},l=s.createContext(i);function o(e){const n=s.useContext(l);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8474],{7976:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=t(4848),s=t(8453);const r={sidebar_label:"json",title:"agenthub.monologue_agent.utils.json"},l=void 0,i={id:"python/agenthub/monologue_agent/utils/json",title:"agenthub.monologue_agent.utils.json",description:"my\\_encoder",source:"@site/modules/python/agenthub/monologue_agent/utils/json.md",sourceDirName:"python/agenthub/monologue_agent/utils",slug:"/python/agenthub/monologue_agent/utils/json",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/json",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"json",title:"agenthub.monologue_agent.utils.json"},sidebar:"apiSidebar",previous:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/micro/agent"},next:{title:"memory",permalink:"/OpenDevin/modules/python/agenthub/monologue_agent/utils/memory"}},a={},c=[{value:"my_encoder",id:"my_encoder",level:4},{value:"dumps",id:"dumps",level:4},{value:"loads",id:"loads",level:4}];function d(e){const n={code:"code",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h4,{id:"my_encoder",children:"my_encoder"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def my_encoder(obj)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Encodes objects as dictionaries"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"obj (Object): An object that will be converted"}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"dict: If the object can be converted it is returned in dict format"}),"\n"]}),"\n",(0,o.jsx)(n.h4,{id:"dumps",children:"dumps"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def dumps(obj, **kwargs)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Serialize an object to str format"}),"\n",(0,o.jsx)(n.h4,{id:"loads",children:"loads"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-python",children:"def loads(s, **kwargs)\n"})}),"\n",(0,o.jsx)(n.p,{children:"Create a JSON object from str"})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>l,x:()=>i});var o=t(6540);const s={},r=o.createContext(s);function l(e){const n=o.useContext(r);return o.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),o.createElement(r.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2609],{6817:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>c,contentTitle:()=>i,default:()=>p,frontMatter:()=>r,metadata:()=>a,toc:()=>d});var t=n(4848),o=n(8453);const r={sidebar_label:"msg_stack",title:"opendevin.server.session.msg_stack"},i=void 0,a={id:"python/opendevin/server/session/msg_stack",title:"opendevin.server.session.msg_stack",description:"Message Objects",source:"@site/modules/python/opendevin/server/session/msg_stack.md",sourceDirName:"python/opendevin/server/session",slug:"/python/opendevin/server/session/msg_stack",permalink:"/OpenDevin/modules/python/opendevin/server/session/msg_stack",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"msg_stack",title:"opendevin.server.session.msg_stack"},sidebar:"apiSidebar",previous:{title:"manager",permalink:"/OpenDevin/modules/python/opendevin/server/session/manager"},next:{title:"session",permalink:"/OpenDevin/modules/python/opendevin/server/session/"}},c={},d=[{value:"Message Objects",id:"message-objects",level:2},{value:"role",id:"role",level:4}];function l(e){const s={code:"code",h2:"h2",h4:"h4",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.h2,{id:"message-objects",children:"Message Objects"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-python",children:"class Message()\n"})}),"\n",(0,t.jsx)(s.h4,{id:"role",children:"role"}),"\n",(0,t.jsx)(s.p,{children:'"user"| "assistant"'})]})}function p(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(l,{...e})}):l(e)}},8453:(e,s,n)=>{n.d(s,{R:()=>i,x:()=>a});var t=n(6540);const o={},r=t.createContext(o);function i(e){const s=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function a(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),t.createElement(r.Provider,{value:s},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[300],{4761:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>a,frontMatter:()=>o,metadata:()=>l,toc:()=>d});var r=t(4848),s=t(8453);const o={sidebar_label:"files",title:"opendevin.files"},i=void 0,l={id:"python/opendevin/files",title:"opendevin.files",description:"WorkspaceFile Objects",source:"@site/modules/python/opendevin/files.md",sourceDirName:"python/opendevin",slug:"/python/opendevin/files",permalink:"/OpenDevin/modules/python/opendevin/files",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"files",title:"opendevin.files"},sidebar:"apiSidebar",previous:{title:"config",permalink:"/OpenDevin/modules/python/opendevin/config"},next:{title:"logger",permalink:"/OpenDevin/modules/python/opendevin/logger"}},c={},d=[{value:"WorkspaceFile Objects",id:"workspacefile-objects",level:2},{value:"to_dict",id:"to_dict",level:4},{value:"get_folder_structure",id:"get_folder_structure",level:4}];function p(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"workspacefile-objects",children:"WorkspaceFile Objects"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"class WorkspaceFile()\n"})}),"\n",(0,r.jsx)(n.h4,{id:"to_dict",children:"to_dict"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"def to_dict() -> Dict[str, Any]\n"})}),"\n",(0,r.jsx)(n.p,{children:"Converts the File object to a dictionary."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,r.jsx)(n.p,{children:"The dictionary representation of the File object."}),"\n",(0,r.jsx)(n.h4,{id:"get_folder_structure",children:"get_folder_structure"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:"def get_folder_structure(workdir: Path) -> WorkspaceFile\n"})}),"\n",(0,r.jsx)(n.p,{children:"Gets the folder structure of a directory."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"workdir"})," - The directory path."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,r.jsx)(n.p,{children:"The folder structure."})]})}function a(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>i,x:()=>l});var r=t(6540);const s={},o=r.createContext(s);function i(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);
+1
View File
@@ -0,0 +1 @@
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[8176],{6677:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>r});var s=t(4848),o=t(8453);const a={sidebar_label:"codeact_agent",title:"agenthub.codeact_agent.codeact_agent"},c=void 0,i={id:"python/agenthub/codeact_agent/codeact_agent",title:"agenthub.codeact_agent.codeact_agent",description:"CodeActAgent Objects",source:"@site/modules/python/agenthub/codeact_agent/codeact_agent.md",sourceDirName:"python/agenthub/codeact_agent",slug:"/python/agenthub/codeact_agent/",permalink:"/OpenDevin/modules/python/agenthub/codeact_agent/",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{sidebar_label:"codeact_agent",title:"agenthub.codeact_agent.codeact_agent"},sidebar:"apiSidebar",previous:{title:"parser",permalink:"/OpenDevin/modules/python/agenthub/SWE_agent/parser"},next:{title:"agent",permalink:"/OpenDevin/modules/python/agenthub/delegator_agent/agent"}},d={},r=[{value:"CodeActAgent Objects",id:"codeactagent-objects",level:2},{value:"__init__",id:"__init__",level:4},{value:"step",id:"step",level:4}];function l(e){const n={code:"code",h2:"h2",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"codeactagent-objects",children:"CodeActAgent Objects"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"class CodeActAgent(Agent)\n"})}),"\n",(0,s.jsx)(n.p,{children:"The Code Act Agent is a minimalist agent.\nThe agent works by passing the model a list of action-observation pairs and prompting the model to take the next step."}),"\n",(0,s.jsx)(n.h4,{id:"__init__",children:"__init__"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"def __init__(llm: LLM) -> None\n"})}),"\n",(0,s.jsx)(n.p,{children:"Initializes a new instance of the CodeActAgent class."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"llm (LLM): The llm to be used by this agent"}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"step",children:"step"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:"def step(state: State) -> Action\n"})}),"\n",(0,s.jsx)(n.p,{children:"Performs one step using the Code Act Agent.\nThis includes gathering info on previous steps and prompting the model to make a command to execute."}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Arguments"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"state (State): used to get updated info and background commands"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Returns"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"CmdRunAction(command) - command action to run"}),"\n",(0,s.jsx)(n.li,{children:"AgentEchoAction(content=INVALID_INPUT_MESSAGE) - invalid command output"}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Raises"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"NotImplementedError - for actions other than CmdOutputObservation or AgentMessageObservation"}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>c,x:()=>i});var s=t(6540);const o={},a=s.createContext(o);function c(e){const n=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:c(e.components),s.createElement(a.Provider,{value:n},e.children)}}}]);
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More