mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
Compare commits
119 Commits
feature/pa
...
docs/using
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04112e4a24 | ||
|
|
7b19ee0d5e | ||
|
|
4b6f2aeb4d | ||
|
|
0023eb0982 | ||
|
|
c3ab4b480b | ||
|
|
35f7efb9d7 | ||
|
|
14498c5e25 | ||
|
|
cdb9aeb9ba | ||
|
|
318883e5e0 | ||
|
|
767b6ce600 | ||
|
|
3ccc96d794 | ||
|
|
6f1effba5b | ||
|
|
bc223885a0 | ||
|
|
0dcd5e9d30 | ||
|
|
8ee85a45a2 | ||
|
|
342563d113 | ||
|
|
af037b3a8a | ||
|
|
33b714e0a0 | ||
|
|
35d2281717 | ||
|
|
83bfbc7045 | ||
|
|
11e6d40c7a | ||
|
|
41d84ee8cd | ||
|
|
0c2924453f | ||
|
|
77cd05c33b | ||
|
|
ff22712686 | ||
|
|
edc43ca60d | ||
|
|
b838ea0427 | ||
|
|
9a5e5956fc | ||
|
|
35426a04d8 | ||
|
|
598d19cd5d | ||
|
|
dd3b3d1253 | ||
|
|
693d912361 | ||
|
|
31ad7fc175 | ||
|
|
5e43dbadcb | ||
|
|
b0b5a6c2a1 | ||
|
|
92f8061558 | ||
|
|
2bb1b7b7aa | ||
|
|
ca9fe7c5c8 | ||
|
|
a40443f5f4 | ||
|
|
20983a2128 | ||
|
|
efe287ce34 | ||
|
|
fa5b52298e | ||
|
|
57bfef3735 | ||
|
|
f3a127a17f | ||
|
|
8cc039997f | ||
|
|
50d4c79094 | ||
|
|
f7cdf4720f | ||
|
|
6d3c2170b1 | ||
|
|
926b425e12 | ||
|
|
3980ba53c9 | ||
|
|
be78cc07bd | ||
|
|
13f9acd48a | ||
|
|
2906a9023f | ||
|
|
66f33bfa96 | ||
|
|
cfa2725abd | ||
|
|
097f757c65 | ||
|
|
ac87ff8d27 | ||
|
|
a3d1a92353 | ||
|
|
70573dcbc0 | ||
|
|
637cb0726a | ||
|
|
2bd10de636 | ||
|
|
70322c8418 | ||
|
|
8b08958efe | ||
|
|
5b021ad1bb | ||
|
|
890796cc9d | ||
|
|
7305c8fb31 | ||
|
|
f1897b8095 | ||
|
|
c26ef180f2 | ||
|
|
37e9933092 | ||
|
|
c353fb6e7e | ||
|
|
3280f450ac | ||
|
|
6335afb010 | ||
|
|
40d9b0b13a | ||
|
|
005c5d6bde | ||
|
|
0deabd5935 | ||
|
|
6f5bb4341f | ||
|
|
a5daf0e3c1 | ||
|
|
3873d9f002 | ||
|
|
5e1039e4b5 | ||
|
|
d648d249d8 | ||
|
|
aa55da27fa | ||
|
|
e69d6b3ef1 | ||
|
|
be1ddaa57d | ||
|
|
7b59e81048 | ||
|
|
470687f826 | ||
|
|
38b4d93237 | ||
|
|
872b97a3c8 | ||
|
|
14334040f1 | ||
|
|
b244138ec5 | ||
|
|
4a3d2e6859 | ||
|
|
1a3cb16ba6 | ||
|
|
2ecc39ffcc | ||
|
|
0b26174d60 | ||
|
|
b0005d4e09 | ||
|
|
2dc7b37fe8 | ||
|
|
27c18f5bdd | ||
|
|
5077fea5c7 | ||
|
|
bf383b4881 | ||
|
|
c17b0ebfc6 | ||
|
|
1f390430e5 | ||
|
|
819bad0777 | ||
|
|
2faed14139 | ||
|
|
4733270e3c | ||
|
|
21dd91de63 | ||
|
|
25619c5a93 | ||
|
|
15f71e7ed6 | ||
|
|
5b583e5f27 | ||
|
|
c191a17afb | ||
|
|
8ec5d0e043 | ||
|
|
f3f038bb60 | ||
|
|
b8d3027cfe | ||
|
|
feb04dc65f | ||
|
|
1f827170f4 | ||
|
|
f7cb2d0f64 | ||
|
|
033788c2d0 | ||
|
|
21d0990be4 | ||
|
|
6227073cff | ||
|
|
4c38113cb7 | ||
|
|
fb516dfa0f |
15
.devcontainer/devcontainer.json
Normal file
15
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,15 @@
|
||||
// For format details, see: https://aka.ms/devcontainer.json
|
||||
{
|
||||
"name": "Python 3",
|
||||
// Documentation for this image:
|
||||
// - https://github.com/devcontainers/templates/tree/main/src/python
|
||||
// - https://github.com/microsoft/vscode-remote-try-python
|
||||
// - https://hub.docker.com/r/microsoft/devcontainers-python
|
||||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
|
||||
"ghcr.io/devcontainers-extra/features/poetry:2": {},
|
||||
"ghcr.io/devcontainers/features/node:1": {},
|
||||
},
|
||||
"postCreateCommand": ".devcontainer/setup.sh",
|
||||
}
|
||||
7
.devcontainer/setup.sh
Normal file
7
.devcontainer/setup.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Install `nc`
|
||||
sudo apt update && sudo apt install netcat -y
|
||||
|
||||
# Do common setup tasks
|
||||
source .openhands/setup.sh
|
||||
5
.editorconfig
Normal file
5
.editorconfig
Normal file
@@ -0,0 +1,5 @@
|
||||
[*]
|
||||
# force *nix line endings so files don't look modified in container run from Windows clone
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
6
.gitattributes
vendored
6
.gitattributes
vendored
@@ -1 +1,7 @@
|
||||
*.ipynb linguist-vendored
|
||||
|
||||
# force *nix line endings so files don't look modified in container run from Windows clone
|
||||
* text eol=lf
|
||||
# Git incorrectly thinks some media is text
|
||||
*.png -text
|
||||
*.mp4 -text
|
||||
|
||||
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -13,6 +13,10 @@ updates:
|
||||
browsergym:
|
||||
patterns:
|
||||
- "browsergym*"
|
||||
mcp-packages:
|
||||
patterns:
|
||||
- "mcp"
|
||||
- "mcpm"
|
||||
security-all:
|
||||
applies-to: "security-updates"
|
||||
patterns:
|
||||
|
||||
3
.github/workflows/lint.yml
vendored
3
.github/workflows/lint.yml
vendored
@@ -30,11 +30,12 @@ jobs:
|
||||
run: |
|
||||
cd frontend
|
||||
npm install --frozen-lockfile
|
||||
- name: Lint and TypeScript compilation
|
||||
- name: Lint, TypeScript compilation, and translation checks
|
||||
run: |
|
||||
cd frontend
|
||||
npm run lint
|
||||
npm run make-i18n && tsc
|
||||
npm run check-translation-completeness
|
||||
|
||||
# Run lint on the python code
|
||||
lint-python:
|
||||
|
||||
2
.github/workflows/openhands-resolver.yml
vendored
2
.github/workflows/openhands-resolver.yml
vendored
@@ -24,7 +24,7 @@ on:
|
||||
LLM_MODEL:
|
||||
required: false
|
||||
type: string
|
||||
default: "anthropic/claude-3-7-sonnet-20250219"
|
||||
default: "anthropic/claude-sonnet-4-20250514"
|
||||
LLM_API_VERSION:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
6
.github/workflows/py-unit-tests.yml
vendored
6
.github/workflows/py-unit-tests.yml
vendored
@@ -47,8 +47,10 @@ jobs:
|
||||
run: poetry install --without evaluation
|
||||
- name: Build Environment
|
||||
run: make build
|
||||
- name: Run Tests
|
||||
- name: Run Unit Tests
|
||||
run: poetry run pytest --forked -n auto -svv ./tests/unit
|
||||
- name: Run Runtime Tests with CLIRuntime
|
||||
run: TEST_RUNTIME=cli poetry run pytest -svv tests/runtime/test_bash.py
|
||||
|
||||
# Run specific Windows python tests
|
||||
test-on-windows:
|
||||
@@ -72,5 +74,5 @@ jobs:
|
||||
run: poetry install --without evaluation
|
||||
- name: Run Windows unit tests
|
||||
run: poetry run pytest -svv tests/unit/test_windows_bash.py
|
||||
- name: Run Windows runtime tests
|
||||
- name: Run Windows runtime tests with LocalRuntime
|
||||
run: $env:TEST_RUNTIME="local"; poetry run pytest -svv tests/runtime/test_bash.py
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -161,9 +161,16 @@ cython_debug/
|
||||
# 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
|
||||
|
||||
# VS Code: Ignore all but certain files that specify repo-specific settings.
|
||||
# https://stackoverflow.com/questions/32964920/should-i-commit-the-vscode-folder-to-source-control
|
||||
.vscode/**/*
|
||||
!.vscode/extensions.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
|
||||
# evaluation
|
||||
evaluation/evaluation_outputs
|
||||
evaluation/outputs
|
||||
|
||||
33
.openhands/microagents/documentation.md
Normal file
33
.openhands/microagents/documentation.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
name: documentation
|
||||
type: knowledge
|
||||
version: 1.0.0
|
||||
agent: CodeActAgent
|
||||
triggers:
|
||||
- documentation
|
||||
- docs
|
||||
- document
|
||||
---
|
||||
|
||||
# Documentation Guidelines
|
||||
|
||||
All documentation must be grounded in fact, so you must not make anything up without proper evidence. When you have finished writing documentation, convey to the user what reference source, including web pages, source code, or other sources of documentation you referenced when writing each new fact in the documentation. If you cannot reference a source for anything do not include it in the pull request.
|
||||
|
||||
## Best Practices for Documentation
|
||||
|
||||
1. **Be Factual**: Only include information that can be verified from reliable sources.
|
||||
2. **Cite Sources**: Always reference the source of information (code, web pages, official documentation).
|
||||
3. **Be Clear and Concise**: Use simple language and avoid unnecessary jargon.
|
||||
4. **Use Examples**: Include practical examples to illustrate concepts.
|
||||
5. **Structure Properly**: Use headings, lists, and code blocks to organize information.
|
||||
6. **Keep Updated**: Ensure documentation reflects the current state of the code or system.
|
||||
|
||||
## Documentation Process
|
||||
|
||||
1. Research and gather information from reliable sources
|
||||
2. Draft documentation based on verified facts
|
||||
3. Review for accuracy and completeness
|
||||
4. Include references for all factual statements
|
||||
5. Submit only when all information is properly sourced
|
||||
|
||||
Remember: If you cannot verify a piece of information, it's better to exclude it than to include potentially incorrect information.
|
||||
@@ -66,3 +66,18 @@ These details may or may not be useful for your current task.
|
||||
- Actions with `thought` property are displayed in the UI based on their action type:
|
||||
- Regular actions (like "run", "edit") display the thought as a separate message
|
||||
- Special actions (like "think") are displayed as collapsible elements only
|
||||
|
||||
#### Adding User Settings:
|
||||
- To add a new user setting to OpenHands, follow these steps:
|
||||
1. Add the setting to the frontend:
|
||||
- Add the setting to the `Settings` type in `frontend/src/types/settings.ts`
|
||||
- Add the setting to the `ApiSettings` type in the same file
|
||||
- Add the setting with an appropriate default value to `DEFAULT_SETTINGS` in `frontend/src/services/settings.ts`
|
||||
- Update the `useSettings` hook in `frontend/src/hooks/query/use-settings.ts` to map the API response
|
||||
- Update the `useSaveSettings` hook in `frontend/src/hooks/mutation/use-save-settings.ts` to include the setting in API requests
|
||||
- Add UI components (like toggle switches) in the appropriate settings screen (e.g., `frontend/src/routes/app-settings.tsx`)
|
||||
- Add i18n translations for the setting name and any tooltips in `frontend/src/i18n/translation.json`
|
||||
- Add the translation key to `frontend/src/i18n/declaration.ts`
|
||||
2. Add the setting to the backend:
|
||||
- Add the setting to the `Settings` model in `openhands/storage/data_models/settings.py`
|
||||
- Update any relevant backend code to apply the setting (e.g., in session creation)
|
||||
|
||||
@@ -9,4 +9,5 @@ python -m pip install pre-commit
|
||||
if [ -d ".git" ]; then
|
||||
echo "Installing pre-commit hooks..."
|
||||
pre-commit install
|
||||
make install-pre-commit-hooks
|
||||
fi
|
||||
|
||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
// force *nix line endings so files don't look modified in container run from Windows clone
|
||||
"files.eol": "\n",
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"files.insertFinalNewline": true,
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
# 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.
|
||||
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
|
||||
|
||||
@@ -19,9 +21,20 @@ initially before moving on. Otherwise, you can clone the OpenHands project direc
|
||||
|
||||
Make sure you have all these dependencies installed before moving on to `make build`.
|
||||
|
||||
#### Dev container
|
||||
|
||||
There is a [dev container](https://containers.dev/) available which provides a
|
||||
pre-configured environment with all the necessary dependencies installed if you
|
||||
are using a [supported editor or tool](https://containers.dev/supporting). For
|
||||
example, if you are using Visual Studio Code (VS Code) with the
|
||||
[Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
||||
extension installed, you can open the project in a dev container by using the
|
||||
_Dev Container: Reopen in Container_ command from the Command Palette
|
||||
(Ctrl+Shift+P).
|
||||
|
||||
#### Develop without sudo access
|
||||
|
||||
If you want to develop without system admin/sudo access to upgrade/install `Python` and/or `NodeJs`, you can use
|
||||
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
|
||||
@@ -37,7 +50,7 @@ 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
|
||||
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
|
||||
@@ -54,11 +67,11 @@ To configure the LM of your choice, run:
|
||||
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,
|
||||
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
|
||||
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
|
||||
|
||||
@@ -77,14 +90,14 @@ make run
|
||||
|
||||
#### Option B: Individual Server Startup
|
||||
|
||||
- **Start the Backend Server:** If you prefer, you can start the backend server independently to focus on
|
||||
- **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
|
||||
- **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
|
||||
@@ -120,10 +133,10 @@ poetry run pytest ./tests/unit/test_*.py
|
||||
|
||||
### 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
|
||||
To reduce build time (e.g., if no changes were made to the client-runtime component), you can use an existing Docker
|
||||
container image by setting the SANDBOX_RUNTIME_CONTAINER_IMAGE environment variable to the desired Docker image.
|
||||
|
||||
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.38-nikolaik`
|
||||
Example: `export SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.39-nikolaik`
|
||||
|
||||
## Develop inside Docker container
|
||||
|
||||
|
||||
30
Makefile
30
Makefile
@@ -5,6 +5,7 @@ SHELL=/usr/bin/env bash
|
||||
BACKEND_HOST ?= "127.0.0.1"
|
||||
BACKEND_PORT = 3000
|
||||
BACKEND_HOST_PORT = "$(BACKEND_HOST):$(BACKEND_PORT)"
|
||||
FRONTEND_HOST ?= "127.0.0.1"
|
||||
FRONTEND_PORT = 3001
|
||||
DEFAULT_WORKSPACE_DIR = "./workspace"
|
||||
DEFAULT_MODEL = "gpt-4o"
|
||||
@@ -154,20 +155,21 @@ install-python-dependencies:
|
||||
fi
|
||||
@if [ "${INSTALL_PLAYWRIGHT}" != "false" ] && [ "${INSTALL_PLAYWRIGHT}" != "0" ]; then \
|
||||
if [ -f "/etc/manjaro-release" ]; then \
|
||||
echo "$(BLUE)Detected Manjaro Linux. Installing Patchright dependencies...$(RESET)"; \
|
||||
poetry run patchright install chromium; \
|
||||
echo "$(BLUE)Detected Manjaro Linux. Installing Playwright dependencies...$(RESET)"; \
|
||||
poetry run pip install playwright; \
|
||||
poetry run playwright install chromium; \
|
||||
else \
|
||||
if [ ! -f cache/patchright_chromium_is_installed.txt ]; then \
|
||||
echo "Installing patchright chromium..."; \
|
||||
poetry run patchright install chromium; \
|
||||
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/patchright_chromium_is_installed.txt; \
|
||||
touch cache/playwright_chromium_is_installed.txt; \
|
||||
else \
|
||||
echo "Setup already done. Skipping patchright installation."; \
|
||||
echo "Setup already done. Skipping playwright installation."; \
|
||||
fi \
|
||||
fi \
|
||||
else \
|
||||
echo "Skipping Patchright installation (INSTALL_PLAYWRIGHT=${INSTALL_PLAYWRIGHT})."; \
|
||||
echo "Skipping Playwright installation (INSTALL_PLAYWRIGHT=${INSTALL_PLAYWRIGHT})."; \
|
||||
fi
|
||||
@echo "$(GREEN)Python dependencies installed successfully.$(RESET)"
|
||||
|
||||
@@ -287,6 +289,15 @@ setup-config-prompts:
|
||||
@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
|
||||
|
||||
setup-config-basic:
|
||||
@printf '%s\n' \
|
||||
'[core]' \
|
||||
'workspace_base="./workspace"' \
|
||||
> config.toml
|
||||
@echo "$(GREEN)config.toml created.$(RESET)"
|
||||
|
||||
openhands-cloud-run:
|
||||
@$(MAKE) run BACKEND_HOST="0.0.0.0" BACKEND_PORT="12000" FRONTEND_HOST="0.0.0.0" FRONTEND_PORT="12001"
|
||||
|
||||
# Develop in container
|
||||
docker-dev:
|
||||
@@ -321,5 +332,4 @@ help:
|
||||
@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
|
||||
.PHONY: build check-dependencies check-system check-python check-npm check-nodejs check-docker check-poetry install-python-dependencies install-frontend-dependencies install-pre-commit-hooks lint-backend lint-frontend lint test-frontend test build-frontend start-backend start-frontend _run_setup run run-wsl setup-config setup-config-prompts setup-config-basic openhands-cloud-run docker-dev docker-run clean help
|
||||
|
||||
@@ -51,23 +51,23 @@ system requirements and more information.
|
||||
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
You'll find OpenHands running at [http://localhost:3000](http://localhost:3000)!
|
||||
|
||||
When you open the application, you'll be asked to choose an LLM provider and add an API key.
|
||||
[Anthropic's Claude 3.7 Sonnet](https://www.anthropic.com/api) (`anthropic/claude-3-7-sonnet-20250219`)
|
||||
[Anthropic's Claude Sonnet 4](https://www.anthropic.com/api) (`anthropic/claude-sonnet-4-20250514`)
|
||||
works best, but you have [many options](https://docs.all-hands.dev/modules/usage/llms).
|
||||
|
||||
## 💡 Other ways to run OpenHands
|
||||
@@ -92,6 +92,7 @@ If you want to modify the OpenHands source code, check out [Development.md](http
|
||||
Having issues? The [Troubleshooting Guide](https://docs.all-hands.dev/modules/usage/troubleshooting) can help.
|
||||
|
||||
## 📖 Documentation
|
||||
<a href="https://deepwiki.com/All-Hands-AI/OpenHands"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" title="Autogenerated Documentation by DeepWiki"></a>
|
||||
|
||||
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).
|
||||
|
||||
146
README_CN.md
Normal file
146
README_CN.md
Normal file
@@ -0,0 +1,146 @@
|
||||
|
||||
<a name="readme-top"></a>
|
||||
|
||||
<div align="center">
|
||||
<img src="./docs/static/img/logo.png" alt="Logo" width="200">
|
||||
<h1 align="center">OpenHands: 少写代码,多做事</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://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-34zm4j0gj-Qz5kRHoca8DFCbqXPS~f_A"><img src="https://img.shields.io/badge/Slack-Join%20Us-red?logo=slack&logoColor=white&style=for-the-badge" alt="加入我们的Slack社区"></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="加入我们的Discord社区"></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="致谢"></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="查看文档"></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="Arxiv论文"></a>
|
||||
<a href="https://docs.google.com/spreadsheets/d/1wOUdFCMyY6Nt0AIqF705KN4JKOWgeI4wUGUP60krXXs/edit?gid=0#gid=0"><img src="https://img.shields.io/badge/Benchmark%20score-000?logoColor=FFE165&logo=huggingface&style=for-the-badge" alt="评估基准分数"></a>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
欢迎使用OpenHands(前身为OpenDevin),这是一个由AI驱动的软件开发代理平台。
|
||||
|
||||
OpenHands代理可以完成人类开发者能做的任何事情:修改代码、运行命令、浏览网页、调用API,甚至从StackOverflow复制代码片段。
|
||||
|
||||
在[docs.all-hands.dev](https://docs.all-hands.dev)了解更多信息,或[注册OpenHands Cloud](https://app.all-hands.dev)开始使用。
|
||||
|
||||
> [!IMPORTANT]
|
||||
> 在工作中使用OpenHands?我们很想与您交流!填写
|
||||
> [这份简短表格](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform)
|
||||
> 加入我们的设计合作伙伴计划,您将获得商业功能的早期访问权限,并有机会对我们的产品路线图提供意见。
|
||||
|
||||

|
||||
|
||||
## ☁️ OpenHands Cloud
|
||||
开始使用OpenHands的最简单方式是在[OpenHands Cloud](https://app.all-hands.dev)上,
|
||||
新用户可获得$50的免费额度。
|
||||
|
||||
## 💻 在本地运行OpenHands
|
||||
|
||||
OpenHands也可以使用Docker在本地系统上运行。
|
||||
查看[运行OpenHands](https://docs.all-hands.dev/modules/usage/installation)指南了解
|
||||
系统要求和更多信息。
|
||||
|
||||
> [!WARNING]
|
||||
> 在公共网络上?请参阅我们的[强化Docker安装指南](https://docs.all-hands.dev/modules/usage/runtimes/docker#hardened-docker-installation)
|
||||
> 通过限制网络绑定和实施其他安全措施来保护您的部署。
|
||||
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
您将在[http://localhost:3000](http://localhost:3000)找到运行中的OpenHands!
|
||||
|
||||
打开应用程序时,您将被要求选择一个LLM提供商并添加API密钥。
|
||||
[Anthropic的Claude Sonnet 4](https://www.anthropic.com/api)(`anthropic/claude-sonnet-4-20250514`)
|
||||
效果最佳,但您还有[许多选择](https://docs.all-hands.dev/modules/usage/llms)。
|
||||
|
||||
## 💡 运行OpenHands的其他方式
|
||||
|
||||
> [!CAUTION]
|
||||
> OpenHands旨在由单个用户在其本地工作站上运行。
|
||||
> 它不适合多租户部署,即多个用户共享同一实例。没有内置的身份验证、隔离或可扩展性。
|
||||
>
|
||||
> 如果您有兴趣在多租户环境中运行OpenHands,请
|
||||
> [与我们联系](https://docs.google.com/forms/d/e/1FAIpQLSet3VbGaz8z32gW9Wm-Grl4jpt5WgMXPgJ4EDPVmCETCBpJtQ/viewform)
|
||||
> 了解高级部署选项。
|
||||
|
||||
您还可以[将OpenHands连接到本地文件系统](https://docs.all-hands.dev/modules/usage/runtimes/docker#connecting-to-your-filesystem),
|
||||
以可编程的[无头模式](https://docs.all-hands.dev/modules/usage/how-to/headless-mode)运行OpenHands,
|
||||
通过[友好的CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode)与其交互,
|
||||
或使用[GitHub Action](https://docs.all-hands.dev/modules/usage/how-to/github-action)在标记的问题上运行它。
|
||||
|
||||
访问[运行OpenHands](https://docs.all-hands.dev/modules/usage/installation)获取更多信息和设置说明。
|
||||
|
||||
如果您想修改OpenHands源代码,请查看[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)。
|
||||
|
||||
遇到问题?[故障排除指南](https://docs.all-hands.dev/modules/usage/troubleshooting)可以提供帮助。
|
||||
|
||||
## 📖 文档
|
||||
<a href="https://deepwiki.com/All-Hands-AI/OpenHands"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" title="DeepWiki自动生成文档"></a>
|
||||
|
||||
要了解有关项目的更多信息,以及使用OpenHands的技巧,
|
||||
请查看我们的[文档](https://docs.all-hands.dev/modules/usage/getting-started)。
|
||||
|
||||
在那里,您将找到有关如何使用不同LLM提供商、
|
||||
故障排除资源和高级配置选项的资源。
|
||||
|
||||
## 🤝 如何加入社区
|
||||
|
||||
OpenHands是一个社区驱动的项目,我们欢迎每个人的贡献。我们大部分沟通
|
||||
通过Slack进行,因此这是开始的最佳场所,但我们也很乐意您通过Discord或Github与我们联系:
|
||||
|
||||
- [加入我们的Slack工作空间](https://join.slack.com/t/openhands-ai/shared_invite/zt-34zm4j0gj-Qz5kRHoca8DFCbqXPS~f_A) - 这里我们讨论研究、架构和未来发展。
|
||||
- [加入我们的Discord服务器](https://discord.gg/ESHStjSjD4) - 这是一个社区运营的服务器,用于一般讨论、问题和反馈。
|
||||
- [阅读或发布Github问题](https://github.com/All-Hands-AI/OpenHands/issues) - 查看我们正在处理的问题,或添加您自己的想法。
|
||||
|
||||
在[COMMUNITY.md](./COMMUNITY.md)中了解更多关于社区的信息,或在[CONTRIBUTING.md](./CONTRIBUTING.md)中找到有关贡献的详细信息。
|
||||
|
||||
## 📈 进展
|
||||
|
||||
在[这里](https://github.com/orgs/All-Hands-AI/projects/1)查看OpenHands月度路线图(每月月底在维护者会议上更新)。
|
||||
|
||||
<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>
|
||||
|
||||
## 📜 许可证
|
||||
|
||||
根据MIT许可证分发。有关更多信息,请参阅[`LICENSE`](./LICENSE)。
|
||||
|
||||
## 🙏 致谢
|
||||
|
||||
OpenHands由大量贡献者构建,每一份贡献都备受感谢!我们还借鉴了其他开源项目,对他们的工作深表感谢。
|
||||
|
||||
有关OpenHands中使用的开源项目和许可证列表,请参阅我们的[CREDITS.md](./CREDITS.md)文件。
|
||||
|
||||
## 📚 引用
|
||||
|
||||
```
|
||||
@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},
|
||||
}
|
||||
```
|
||||
19
REFACTOR.md
Normal file
19
REFACTOR.md
Normal file
@@ -0,0 +1,19 @@
|
||||
[ ] Rename `Conversation` in openhands/server to `ServerConversation`
|
||||
[ ] Replace all instances of `sid` in openhands/* to `conversation_id`
|
||||
[ ] Make EventStream take in a `conversation_id` in its constructor.
|
||||
* remove `conversation_id` from all methods on EventStream and use self.conversation_id instead.
|
||||
* fix all callers of EventStream to pass in `conversation_id` in the constructor and remove it from the method calls.
|
||||
[ ] Rename AppConfig to OpenHandsConfig
|
||||
[ ] Create a new class `Conversation` in openhands/core/ that will be the main interface for conversations.
|
||||
* Its constructor will take in a:
|
||||
* conversation_id (string)
|
||||
* Runtime
|
||||
* LLM
|
||||
* EventStream
|
||||
* AgentController
|
||||
* No logic, it's just a dataclass
|
||||
[ ] Add a new OpenHands class to openhands/core/ which will take care of creating Conversations
|
||||
* Constructor is ONLY an OpenHandsConfig
|
||||
* Only one method: `create_conversation()`
|
||||
* This will create a Runtime, LLM, EventStream, and AgentController, and return a Conversation object.
|
||||
* These objects will be created according to the OpenHandsConfig passed in to the constructor.
|
||||
@@ -325,6 +325,15 @@ classpath = "my_package.my_module.MyCustomAgent"
|
||||
# Useful when deploying OpenHands in a remote machine where you need to expose a specific port.
|
||||
#vscode_port = 41234
|
||||
|
||||
# Volume mounts in the format 'host_path:container_path[:mode]'
|
||||
# e.g. '/my/host/dir:/workspace:rw'
|
||||
# Multiple mounts can be specified using commas
|
||||
# e.g. '/path1:/workspace/path1,/path2:/workspace/path2:ro'
|
||||
|
||||
# Configure volumes under the [sandbox] section:
|
||||
# [sandbox]
|
||||
# volumes = "/my/host/dir:/workspace:rw,/path2:/workspace/path2:ro"
|
||||
|
||||
#################################### Security ###################################
|
||||
# Configuration for security features
|
||||
##############################################################################
|
||||
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
- BACKEND_HOST=${BACKEND_HOST:-"0.0.0.0"}
|
||||
- SANDBOX_API_HOSTNAME=host.docker.internal
|
||||
#
|
||||
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.38-nikolaik}
|
||||
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-ghcr.io/all-hands-ai/runtime:0.39-nikolaik}
|
||||
- SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234}
|
||||
- WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace}
|
||||
ports:
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
image: openhands:latest
|
||||
container_name: openhands-app-${DATE:-}
|
||||
environment:
|
||||
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik}
|
||||
- SANDBOX_RUNTIME_CONTAINER_IMAGE=${SANDBOX_RUNTIME_CONTAINER_IMAGE:-docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik}
|
||||
#- SANDBOX_USER_ID=${SANDBOX_USER_ID:-1234} # enable this only if you want a specific non-root sandbox user but you will have to manually adjust permissions of openhands-state for this user
|
||||
- WORKSPACE_MOUNT_PATH=${WORKSPACE_BASE:-$PWD/workspace}
|
||||
ports:
|
||||
|
||||
@@ -52,4 +52,4 @@ $ poetry run python docs/translation_updater.py
|
||||
# ...
|
||||
```
|
||||
|
||||
This process uses `claude-3-7-sonnet-20250219` as base model and each language consumes at least ~30k input tokens and ~35k output tokens.
|
||||
This process uses `claude-sonnet-4-20250514` as base model and each language consumes at least ~30k input tokens and ~35k output tokens.
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# Résolveur GitHub Cloud
|
||||
|
||||
Le Résolveur GitHub automatise les corrections de code et fournit une assistance intelligente pour vos dépôts.
|
||||
|
||||
## Configuration
|
||||
|
||||
Le Résolveur GitHub Cloud est disponible automatiquement lorsque vous
|
||||
[accordez l'accès au dépôt OpenHands Cloud](./openhands-cloud#adding-repository-access).
|
||||
|
||||
## Utilisation
|
||||
|
||||
Après avoir accordé l'accès au dépôt OpenHands Cloud, vous pouvez utiliser le Résolveur GitHub Cloud sur les problèmes et les pull requests
|
||||
du dépôt.
|
||||
|
||||
### Problèmes (Issues)
|
||||
|
||||
Sur votre dépôt, étiquetez un problème avec `openhands`. OpenHands va :
|
||||
1. Commenter le problème pour vous informer qu'il y travaille.
|
||||
- Vous pouvez cliquer sur le lien pour suivre la progression sur OpenHands Cloud.
|
||||
2. Ouvrir une pull request s'il détermine que le problème a été résolu avec succès.
|
||||
3. Commenter le problème avec un résumé des tâches effectuées et un lien vers la pull request.
|
||||
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Pour qu'OpenHands travaille sur des pull requests, utilisez `@openhands` dans les commentaires de premier niveau ou en ligne pour :
|
||||
- Poser des questions
|
||||
- Demander des mises à jour
|
||||
- Obtenir des explications de code
|
||||
|
||||
OpenHands va :
|
||||
1. Commenter la PR pour vous informer qu'il y travaille.
|
||||
2. Effectuer la tâche.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Résolveur de Problèmes Cloud
|
||||
|
||||
Le Résolveur de Problèmes Cloud automatise les corrections de code et fournit une assistance intelligente pour vos dépôts sur GitHub et GitLab.
|
||||
|
||||
## Configuration
|
||||
|
||||
Le Résolveur de Problèmes Cloud est disponible automatiquement lorsque vous accordez l'accès au dépôt OpenHands Cloud :
|
||||
- [Accès au dépôt GitHub](./github-installation#adding-repository-access)
|
||||
- [Accès au dépôt GitLab](./gitlab-installation#adding-repository-access)
|
||||
|
||||
## Utilisation
|
||||
|
||||
Après avoir accordé l'accès au dépôt OpenHands Cloud, vous pouvez utiliser le Résolveur de Problèmes Cloud sur les problèmes et les pull/merge requests dans vos dépôts.
|
||||
|
||||
### Travailler avec les Problèmes
|
||||
|
||||
Sur votre dépôt, étiquetez un problème avec `openhands`. OpenHands va :
|
||||
1. Commenter le problème pour vous faire savoir qu'il y travaille
|
||||
- Vous pouvez cliquer sur le lien pour suivre la progression sur OpenHands Cloud
|
||||
2. Ouvrir une pull request (GitHub) ou une merge request (GitLab) s'il détermine que le problème a été résolu avec succès
|
||||
3. Commenter le problème avec un résumé des tâches effectuées et un lien vers la PR/MR
|
||||
|
||||
### Travailler avec les Pull/Merge Requests
|
||||
|
||||
Pour qu'OpenHands travaille sur les pull requests (GitHub) ou les merge requests (GitLab), mentionnez `@openhands` dans les commentaires pour :
|
||||
- Poser des questions
|
||||
- Demander des mises à jour
|
||||
- Obtenir des explications de code
|
||||
|
||||
OpenHands va :
|
||||
1. Commenter pour vous faire savoir qu'il y travaille
|
||||
2. Effectuer la tâche demandée
|
||||
@@ -0,0 +1,29 @@
|
||||
# Interface Cloud
|
||||
|
||||
L'interface Cloud fournit une interface web pour interagir avec OpenHands AI. Cette page explique comment accéder et utiliser l'interface Cloud d'OpenHands.
|
||||
|
||||
## Accès à l'Interface
|
||||
|
||||
L'interface Cloud d'OpenHands est accessible à [app.all-hands.dev](https://app.all-hands.dev). Vous devrez vous connecter avec votre compte GitHub ou GitLab pour accéder à l'interface.
|
||||
|
||||
<!-- Image will be added in a future update -->
|
||||
<!--  -->
|
||||
|
||||
## Fonctionnalités Clés
|
||||
|
||||
Pour des informations détaillées sur les fonctionnalités disponibles dans l'interface Cloud d'OpenHands, veuillez consulter la section [Fonctionnalités Clés](../key-features.md) de la documentation.
|
||||
|
||||
## Paramètres
|
||||
|
||||
La page des paramètres vous permet de :
|
||||
|
||||
1. Configurer les préférences de votre compte
|
||||
2. Gérer l'accès aux dépôts
|
||||
3. Générer des clés API pour un accès programmatique
|
||||
4. Personnaliser votre expérience OpenHands
|
||||
|
||||
## Prochaines Étapes
|
||||
|
||||
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
|
||||
- [En savoir plus sur l'API Cloud](./cloud-api.md) pour un accès programmatique
|
||||
- [Retourner à la Mise en Route](./openhands-cloud.md)
|
||||
@@ -0,0 +1,55 @@
|
||||
# Installation GitHub
|
||||
|
||||
Ce guide vous accompagne dans le processus d'installation et de configuration d'OpenHands Cloud pour vos dépôts GitHub.
|
||||
|
||||
## Prérequis
|
||||
|
||||
- Un compte GitHub
|
||||
- Accès à OpenHands Cloud
|
||||
|
||||
## Étapes d'Installation
|
||||
|
||||
1. Connectez-vous à [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. Si vous n'avez pas encore connecté votre compte GitHub :
|
||||
- Cliquez sur `Se connecter à GitHub`
|
||||
- Examinez et acceptez les conditions d'utilisation
|
||||
- Autorisez l'application OpenHands AI
|
||||
|
||||
## Ajout d'Accès au Dépôt
|
||||
|
||||
Vous pouvez accorder à OpenHands l'accès à des dépôts spécifiques :
|
||||
|
||||
1. Cliquez sur le menu déroulant `Sélectionner un projet GitHub`, puis sélectionnez `Ajouter plus de dépôts...`
|
||||
2. Sélectionnez votre organisation et choisissez les dépôts spécifiques auxquels vous souhaitez accorder l'accès à OpenHands.
|
||||
- OpenHands demande des jetons à courte durée de vie (expiration de 8 heures) avec ces permissions :
|
||||
- Actions : Lecture et écriture
|
||||
- Administration : Lecture seule
|
||||
- Statuts de commit : Lecture et écriture
|
||||
- Contenus : Lecture et écriture
|
||||
- Problèmes : Lecture et écriture
|
||||
- Métadonnées : Lecture seule
|
||||
- Pull requests : Lecture et écriture
|
||||
- Webhooks : Lecture et écriture
|
||||
- Workflows : Lecture et écriture
|
||||
- L'accès au dépôt pour un utilisateur est accordé en fonction de :
|
||||
- Permission accordée pour le dépôt
|
||||
- Permissions GitHub de l'utilisateur (propriétaire/collaborateur)
|
||||
3. Cliquez sur `Installer & Autoriser`
|
||||
|
||||
## Modification de l'Accès au Dépôt
|
||||
|
||||
Vous pouvez modifier l'accès au dépôt à tout moment :
|
||||
* En utilisant le même workflow `Sélectionner un projet GitHub > Ajouter plus de dépôts`, ou
|
||||
* En visitant la page Paramètres et en sélectionnant `Configurer les Dépôts GitHub` dans la section `Paramètres GitHub`.
|
||||
|
||||
## Utilisation d'OpenHands avec GitHub
|
||||
|
||||
Une fois que vous avez accordé l'accès au dépôt, vous pouvez utiliser OpenHands avec vos dépôts GitHub.
|
||||
|
||||
Pour plus de détails sur l'utilisation d'OpenHands avec les problèmes et les pull requests GitHub, consultez la documentation du [Résolveur de Problèmes Cloud](./cloud-issue-resolver.md).
|
||||
|
||||
## Prochaines Étapes
|
||||
|
||||
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
|
||||
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
|
||||
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
|
||||
@@ -0,0 +1,50 @@
|
||||
# Installation GitLab
|
||||
|
||||
Ce guide vous accompagne dans le processus d'installation et de configuration d'OpenHands Cloud pour vos dépôts GitLab.
|
||||
|
||||
## Prérequis
|
||||
|
||||
- Un compte GitLab
|
||||
- Accès à OpenHands Cloud
|
||||
|
||||
## Étapes d'Installation
|
||||
|
||||
1. Connectez-vous à [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. Si vous n'avez pas encore connecté votre compte GitLab :
|
||||
- Cliquez sur `Se connecter à GitLab`
|
||||
- Examinez et acceptez les conditions d'utilisation
|
||||
- Autorisez l'application OpenHands AI
|
||||
|
||||
## Ajout d'Accès au Dépôt
|
||||
|
||||
Vous pouvez accorder à OpenHands l'accès à des dépôts spécifiques :
|
||||
|
||||
1. Cliquez sur le menu déroulant `Sélectionner un projet GitLab`, puis sélectionnez `Ajouter plus de dépôts...`
|
||||
2. Sélectionnez votre organisation et choisissez les dépôts spécifiques auxquels vous souhaitez accorder l'accès à OpenHands.
|
||||
- OpenHands demande des permissions avec ces portées :
|
||||
- api : Accès complet à l'API
|
||||
- read_user : Lecture des informations utilisateur
|
||||
- read_repository : Lecture des informations du dépôt
|
||||
- write_repository : Écriture dans le dépôt
|
||||
- L'accès au dépôt pour un utilisateur est accordé en fonction de :
|
||||
- Permission accordée pour le dépôt
|
||||
- Permissions GitLab de l'utilisateur (propriétaire/mainteneur/développeur)
|
||||
3. Cliquez sur `Installer & Autoriser`
|
||||
|
||||
## Modification de l'Accès au Dépôt
|
||||
|
||||
Vous pouvez modifier l'accès au dépôt à tout moment :
|
||||
* En utilisant le même workflow `Sélectionner un projet GitLab > Ajouter plus de dépôts`, ou
|
||||
* En visitant la page Paramètres et en sélectionnant `Configurer les Dépôts GitLab` dans la section `Paramètres GitLab`.
|
||||
|
||||
## Utilisation d'OpenHands avec GitLab
|
||||
|
||||
Une fois que vous avez accordé l'accès au dépôt, vous pouvez utiliser OpenHands avec vos dépôts GitLab.
|
||||
|
||||
Pour plus de détails sur l'utilisation d'OpenHands avec les problèmes et les merge requests GitLab, consultez la documentation du [Résolveur de Problèmes Cloud](./cloud-issue-resolver.md).
|
||||
|
||||
## Prochaines Étapes
|
||||
|
||||
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
|
||||
- [Utiliser le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et obtenir de l'aide
|
||||
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
|
||||
@@ -0,0 +1,24 @@
|
||||
# OpenHands Cloud
|
||||
|
||||
OpenHands Cloud est la version hébergée dans le cloud d'OpenHands par All Hands AI.
|
||||
|
||||
## Accès à OpenHands Cloud
|
||||
|
||||
Pour commencer avec OpenHands Cloud, visitez [app.all-hands.dev](https://app.all-hands.dev).
|
||||
|
||||
Vous serez invité à vous connecter avec votre compte GitHub ou GitLab :
|
||||
|
||||
1. Après avoir lu et accepté les conditions d'utilisation, cliquez sur `Se connecter à GitHub` ou `Se connecter à GitLab`.
|
||||
2. Examinez les permissions demandées par OpenHands et autorisez l'application.
|
||||
- OpenHands nécessitera certaines permissions de votre compte. Pour en savoir plus sur ces permissions,
|
||||
vous pouvez cliquer sur le lien `En savoir plus` sur la page d'autorisation.
|
||||
|
||||
## Prochaines Étapes
|
||||
|
||||
Une fois que vous avez connecté votre compte, vous pouvez :
|
||||
|
||||
- [Installer l'Intégration GitHub](./github-installation.md) pour utiliser OpenHands avec vos dépôts GitHub
|
||||
- [Installer l'Intégration GitLab](./gitlab-installation.md) pour utiliser OpenHands avec vos dépôts GitLab
|
||||
- [Accéder à l'Interface Cloud](./cloud-ui.md) pour interagir avec l'interface web
|
||||
- [Utiliser l'API Cloud](./cloud-api.md) pour interagir programmatiquement avec OpenHands
|
||||
- [Configurer le Résolveur de Problèmes Cloud](./cloud-issue-resolver.md) pour automatiser les corrections de code et fournir une assistance intelligente
|
||||
@@ -1,65 +0,0 @@
|
||||
# OpenHands Cloud
|
||||
|
||||
OpenHands Cloud est la version hébergée dans le cloud d'OpenHands par All Hands AI.
|
||||
|
||||
## Accéder à OpenHands Cloud
|
||||
|
||||
OpenHands Cloud est accessible à l'adresse https://app.all-hands.dev/.
|
||||
|
||||
Vous pouvez également interagir avec OpenHands Cloud par programmation en utilisant l'[API](./cloud-api).
|
||||
|
||||
## Premiers pas
|
||||
|
||||
Après avoir visité OpenHands Cloud, il vous sera demandé de vous connecter avec votre compte GitHub ou GitLab :
|
||||
|
||||
1. Après avoir lu et accepté les conditions d'utilisation, cliquez sur `Log in with GitHub` ou `Log in with GitLab`.
|
||||
2. Examinez les autorisations demandées par OpenHands, puis cliquez sur `Authorize OpenHands AI`.
|
||||
- OpenHands nécessitera certaines autorisations de votre compte GitHub ou GitLab. Pour en savoir plus sur ces autorisations :
|
||||
- GitHub : Vous pouvez cliquer sur le lien `Learn more` sur la page d'autorisation GitHub.
|
||||
- GitLab : Vous pouvez développer chaque demande d'autorisation sur la page d'autorisation GitLab.
|
||||
|
||||
## Accès aux dépôts
|
||||
|
||||
### GitHub
|
||||
|
||||
#### Ajouter l'accès aux dépôts
|
||||
|
||||
Vous pouvez accorder à OpenHands un accès à des dépôts spécifiques :
|
||||
1. Cliquez sur `Add GitHub repos` sur la page d'accueil.
|
||||
2. Sélectionnez l'organisation, puis choisissez les dépôts spécifiques auxquels vous souhaitez donner accès à OpenHands.
|
||||
<details>
|
||||
<summary>Détails des autorisations pour l'accès aux dépôts</summary>
|
||||
|
||||
Openhands demande des jetons à courte durée de vie (expiration de 8 heures) avec ces autorisations :
|
||||
- Actions : Lecture et écriture
|
||||
- Administration : Lecture seule
|
||||
- Statuts de commit : Lecture et écriture
|
||||
- Contenus : Lecture et écriture
|
||||
- Issues : Lecture et écriture
|
||||
- Métadonnées : Lecture seule
|
||||
- Pull requests : Lecture et écriture
|
||||
- Webhooks : Lecture et écriture
|
||||
- Workflows : Lecture et écriture
|
||||
|
||||
L'accès au dépôt pour un utilisateur est accordé en fonction de :
|
||||
- L'autorisation accordée pour le dépôt.
|
||||
- Les autorisations GitHub de l'utilisateur (propriétaire/collaborateur).
|
||||
</details>
|
||||
|
||||
3. Cliquez sur `Install & Authorize`.
|
||||
|
||||
#### Modifier l'accès aux dépôts
|
||||
|
||||
Vous pouvez modifier l'accès aux dépôts GitHub à tout moment en :
|
||||
* Utilisant le même processus `Add GitHub repos`, ou
|
||||
* Visitant la page Paramètres et en sélectionnant `Configure GitHub Repositories` dans la section `Git Settings`.
|
||||
|
||||
### GitLab
|
||||
|
||||
Lorsque vous utilisez votre compte GitLab, OpenHands aura automatiquement accès à vos dépôts.
|
||||
|
||||
## Persistance des conversations
|
||||
|
||||
- Liste des conversations – Affiche uniquement les 10 conversations les plus récentes initiées au cours des 10 derniers jours.
|
||||
- Espaces de travail – Les espaces de travail de conversation sont conservés pendant 14 jours.
|
||||
- Environnements d'exécution – Les environnements d'exécution restent actifs ("chauds") pendant 30 minutes. Après cette période, la reprise d'une conversation peut prendre 1 à 2 minutes.
|
||||
@@ -37,7 +37,7 @@ Pour exécuter OpenHands en mode CLI avec Docker :
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -46,7 +46,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.cli
|
||||
```
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Pour exécuter OpenHands en mode Headless avec Docker :
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -44,7 +44,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
|
||||
@@ -58,17 +58,17 @@ Un système avec un processeur moderne et un minimum de **4 Go de RAM** est reco
|
||||
La façon la plus simple d'exécuter OpenHands est dans Docker.
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
Vous trouverez OpenHands en cours d'exécution à l'adresse http://localhost:3000 !
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Aperçu des fonctionnalités d'OpenHands
|
||||
# Aperçu des Fonctionnalités d'OpenHands
|
||||
|
||||

|
||||
|
||||
### Panneau de discussion
|
||||
### Panneau de Discussion
|
||||
- Affiche la conversation entre l'utilisateur et OpenHands.
|
||||
- OpenHands explique ses actions dans ce panneau.
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
- Montre les modifications de fichiers effectuées par OpenHands.
|
||||
|
||||
### VS Code
|
||||
- VS Code intégré pour parcourir et modifier des fichiers.
|
||||
- Peut également être utilisé pour télécharger et importer des fichiers.
|
||||
- VS Code intégré pour parcourir et modifier les fichiers.
|
||||
- Peut également être utilisé pour télécharger et envoyer des fichiers.
|
||||
|
||||
### Terminal
|
||||
- Un espace permettant à OpenHands et aux utilisateurs d'exécuter des commandes terminal.
|
||||
@@ -25,5 +25,5 @@
|
||||
- Les utilisateurs peuvent interagir avec l'application en cours d'exécution.
|
||||
|
||||
### Navigateur
|
||||
- Utilisé par OpenHands pour naviguer sur des sites web.
|
||||
- Utilisé par OpenHands pour naviguer sur les sites web.
|
||||
- Le navigateur n'est pas interactif.
|
||||
|
||||
@@ -13,7 +13,7 @@ recommandations pour la sélection de modèles. Nos derniers résultats d'évalu
|
||||
|
||||
Sur la base de ces résultats et des retours de la communauté, les modèles suivants ont été vérifiés comme fonctionnant raisonnablement bien avec OpenHands :
|
||||
|
||||
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recommandé)
|
||||
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recommandé)
|
||||
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
|
||||
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
|
||||
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# Cloud GitHub Resolver
|
||||
|
||||
GitHub Resolverはコードの修正を自動化し、リポジトリに対してインテリジェントな支援を提供します。
|
||||
|
||||
## セットアップ
|
||||
|
||||
Cloud GitHub Resolverは、[OpenHands Cloudにリポジトリアクセス権を付与する](./openhands-cloud#adding-repository-access)と自動的に利用可能になります。
|
||||
|
||||
## 使用方法
|
||||
|
||||
OpenHands Cloudにリポジトリアクセス権を付与した後、リポジトリの課題(Issue)とプルリクエストでCloud GitHub Resolverを使用できます。
|
||||
|
||||
### 課題(Issues)
|
||||
|
||||
リポジトリで課題に`openhands`ラベルを付けると、OpenHandsは以下の操作を行います:
|
||||
1. 課題にコメントして、作業中であることを通知します。
|
||||
- OpenHands Cloudで進捗状況を追跡するためのリンクをクリックできます。
|
||||
2. 課題が正常に解決されたと判断した場合、プルリクエストを開きます。
|
||||
3. 実行されたタスクの概要とプルリクエストへのリンクを含むコメントを課題に投稿します。
|
||||
|
||||
|
||||
### プルリクエスト
|
||||
|
||||
プルリクエストでOpenHandsを利用するには、トップレベルまたはインラインコメントで`@openhands`を使用して:
|
||||
- 質問する
|
||||
- 更新をリクエストする
|
||||
- コードの説明を取得する
|
||||
|
||||
OpenHandsは以下の操作を行います:
|
||||
1. PRにコメントして、作業中であることを通知します。
|
||||
2. タスクを実行します。
|
||||
@@ -0,0 +1,32 @@
|
||||
# クラウド課題リゾルバー
|
||||
|
||||
クラウド課題リゾルバーは、GitHubとGitLabのリポジトリに対してコード修正を自動化し、インテリジェントな支援を提供します。
|
||||
|
||||
## セットアップ
|
||||
|
||||
クラウド課題リゾルバーは、OpenHands Cloudリポジトリアクセスを許可すると自動的に利用可能になります:
|
||||
- [GitHubリポジトリアクセス](./github-installation#adding-repository-access)
|
||||
- [GitLabリポジトリアクセス](./gitlab-installation#adding-repository-access)
|
||||
|
||||
## 使用方法
|
||||
|
||||
OpenHands Cloudリポジトリアクセスを許可した後、リポジトリの課題やプルリクエスト/マージリクエストでクラウド課題リゾルバーを使用できます。
|
||||
|
||||
### 課題の操作
|
||||
|
||||
リポジトリで、課題に`openhands`というラベルを付けます。OpenHandsは以下を行います:
|
||||
1. 課題にコメントして、作業中であることを知らせます
|
||||
- リンクをクリックすると、OpenHands Cloudで進捗状況を追跡できます
|
||||
2. 課題が正常に解決されたと判断した場合、プルリクエスト(GitHub)またはマージリクエスト(GitLab)を開きます
|
||||
3. 実行されたタスクの概要とPR/MRへのリンクを含むコメントを課題に残します
|
||||
|
||||
### プルリクエスト/マージリクエストの操作
|
||||
|
||||
プルリクエスト(GitHub)またはマージリクエスト(GitLab)でOpenHandsを動作させるには、コメントで`@openhands`を言及して以下を行います:
|
||||
- 質問する
|
||||
- 更新をリクエストする
|
||||
- コードの説明を取得する
|
||||
|
||||
OpenHandsは以下を行います:
|
||||
1. 作業中であることを知らせるコメントをします
|
||||
2. リクエストされたタスクを実行します
|
||||
@@ -0,0 +1,29 @@
|
||||
# クラウドUI
|
||||
|
||||
クラウドUIは、OpenHands AIと対話するためのウェブインターフェースを提供します。このページでは、OpenHands クラウドUIへのアクセス方法と使用方法について説明します。
|
||||
|
||||
## UIへのアクセス
|
||||
|
||||
OpenHands クラウドUIは[app.all-hands.dev](https://app.all-hands.dev)でアクセスできます。インターフェースにアクセスするには、GitHubまたはGitLabアカウントでサインインする必要があります。
|
||||
|
||||
<!-- 画像は将来のアップデートで追加されます -->
|
||||
<!--  -->
|
||||
|
||||
## 主な機能
|
||||
|
||||
OpenHands クラウドUIで利用可能な機能の詳細については、ドキュメントの[主な機能](../key-features.md)セクションを参照してください。
|
||||
|
||||
## 設定
|
||||
|
||||
設定ページでは以下のことができます:
|
||||
|
||||
1. アカウント設定の構成
|
||||
2. リポジトリアクセスの管理
|
||||
3. プログラムによるアクセスのためのAPIキーの生成
|
||||
4. OpenHandsエクスペリエンスのカスタマイズ
|
||||
|
||||
## 次のステップ
|
||||
|
||||
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
|
||||
- [クラウドAPIについて学ぶ](./cloud-api.md)でプログラムによるアクセスを行う
|
||||
- [はじめにに戻る](./openhands-cloud.md)
|
||||
@@ -0,0 +1,55 @@
|
||||
# GitHub インストール
|
||||
|
||||
このガイドでは、GitHubリポジトリ用にOpenHands Cloudをインストールおよび設定するプロセスについて説明します。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- GitHubアカウント
|
||||
- OpenHands Cloudへのアクセス
|
||||
|
||||
## インストール手順
|
||||
|
||||
1. [OpenHands Cloud](https://app.all-hands.dev)にログインします
|
||||
2. まだGitHubアカウントを接続していない場合:
|
||||
- `GitHubに接続する`をクリックします
|
||||
- 利用規約を確認して同意します
|
||||
- OpenHands AIアプリケーションを承認します
|
||||
|
||||
## リポジトリアクセスの追加
|
||||
|
||||
特定のリポジトリへのアクセスをOpenHandsに許可できます:
|
||||
|
||||
1. `GitHubプロジェクトを選択`ドロップダウンをクリックし、`リポジトリを追加...`を選択します
|
||||
2. 組織を選択し、OpenHandsにアクセスを許可する特定のリポジトリを選択します。
|
||||
- OpenHandsは以下の権限を持つ短期間のトークン(8時間の有効期限)をリクエストします:
|
||||
- アクション:読み取りと書き込み
|
||||
- 管理:読み取り専用
|
||||
- コミットステータス:読み取りと書き込み
|
||||
- コンテンツ:読み取りと書き込み
|
||||
- 課題:読み取りと書き込み
|
||||
- メタデータ:読み取り専用
|
||||
- プルリクエスト:読み取りと書き込み
|
||||
- Webhook:読み取りと書き込み
|
||||
- ワークフロー:読み取りと書き込み
|
||||
- ユーザーのリポジトリアクセスは以下に基づいて付与されます:
|
||||
- リポジトリに付与された権限
|
||||
- ユーザーのGitHub権限(所有者/コラボレーター)
|
||||
3. `インストール&承認`をクリックします
|
||||
|
||||
## リポジトリアクセスの変更
|
||||
|
||||
リポジトリアクセスはいつでも変更できます:
|
||||
* 同じ`GitHubプロジェクトを選択 > リポジトリを追加`ワークフローを使用する、または
|
||||
* 設定ページにアクセスし、`GitHub設定`セクションで`GitHubリポジトリを設定する`を選択します。
|
||||
|
||||
## GitHubでのOpenHandsの使用
|
||||
|
||||
リポジトリアクセスを許可すると、GitHubリポジトリでOpenHandsを使用できます。
|
||||
|
||||
GitHub課題とプルリクエストでOpenHandsを使用する方法の詳細については、[クラウド課題リゾルバー](./cloud-issue-resolver.md)のドキュメントを参照してください。
|
||||
|
||||
## 次のステップ
|
||||
|
||||
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
|
||||
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
|
||||
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
|
||||
@@ -0,0 +1,50 @@
|
||||
# GitLab インストール
|
||||
|
||||
このガイドでは、GitLabリポジトリ用にOpenHands Cloudをインストールおよび設定するプロセスについて説明します。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- GitLabアカウント
|
||||
- OpenHands Cloudへのアクセス
|
||||
|
||||
## インストール手順
|
||||
|
||||
1. [OpenHands Cloud](https://app.all-hands.dev)にログインします
|
||||
2. まだGitLabアカウントを接続していない場合:
|
||||
- `GitLabに接続する`をクリックします
|
||||
- 利用規約を確認して同意します
|
||||
- OpenHands AIアプリケーションを承認します
|
||||
|
||||
## リポジトリアクセスの追加
|
||||
|
||||
特定のリポジトリへのアクセスをOpenHandsに許可できます:
|
||||
|
||||
1. `GitLabプロジェクトを選択`ドロップダウンをクリックし、`リポジトリを追加...`を選択します
|
||||
2. 組織を選択し、OpenHandsにアクセスを許可する特定のリポジトリを選択します。
|
||||
- OpenHandsは以下のスコープで権限をリクエストします:
|
||||
- api:完全なAPIアクセス
|
||||
- read_user:ユーザー情報の読み取り
|
||||
- read_repository:リポジトリ情報の読み取り
|
||||
- write_repository:リポジトリへの書き込み
|
||||
- ユーザーのリポジトリアクセスは以下に基づいて付与されます:
|
||||
- リポジトリに付与された権限
|
||||
- ユーザーのGitLab権限(所有者/メンテナー/開発者)
|
||||
3. `インストール&承認`をクリックします
|
||||
|
||||
## リポジトリアクセスの変更
|
||||
|
||||
リポジトリアクセスはいつでも変更できます:
|
||||
* 同じ`GitLabプロジェクトを選択 > リポジトリを追加`ワークフローを使用する、または
|
||||
* 設定ページにアクセスし、`GitLab設定`セクションで`GitLabリポジトリを設定する`を選択します。
|
||||
|
||||
## GitLabでのOpenHandsの使用
|
||||
|
||||
リポジトリアクセスを許可すると、GitLabリポジトリでOpenHandsを使用できます。
|
||||
|
||||
GitLab課題とマージリクエストでOpenHandsを使用する方法の詳細については、[クラウド課題リゾルバー](./cloud-issue-resolver.md)のドキュメントを参照してください。
|
||||
|
||||
## 次のステップ
|
||||
|
||||
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
|
||||
- [クラウド課題リゾルバーを使用する](./cloud-issue-resolver.md)でコード修正を自動化し、支援を受ける
|
||||
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
|
||||
@@ -0,0 +1,24 @@
|
||||
# OpenHands クラウド
|
||||
|
||||
OpenHands クラウドは、All Hands AIのOpenHandsのホスト型クラウドバージョンです。
|
||||
|
||||
## OpenHands クラウドへのアクセス
|
||||
|
||||
OpenHands クラウドを始めるには、[app.all-hands.dev](https://app.all-hands.dev)にアクセスしてください。
|
||||
|
||||
GitHubまたはGitLabアカウントで接続するよう求められます:
|
||||
|
||||
1. 利用規約を読んで同意した後、`GitHubに接続する`または`GitLabに接続する`をクリックします。
|
||||
2. OpenHandsがリクエストする権限を確認し、アプリケーションを承認します。
|
||||
- OpenHandsはあなたのアカウントから特定の権限を必要とします。これらの権限について詳しく知るには、
|
||||
承認ページの`詳細を見る`リンクをクリックしてください。
|
||||
|
||||
## 次のステップ
|
||||
|
||||
アカウントを接続したら、以下のことができます:
|
||||
|
||||
- [GitHub統合をインストールする](./github-installation.md)でGitHubリポジトリでOpenHandsを使用する
|
||||
- [GitLab統合をインストールする](./gitlab-installation.md)でGitLabリポジトリでOpenHandsを使用する
|
||||
- [クラウドUIにアクセスする](./cloud-ui.md)でウェブインターフェースと対話する
|
||||
- [クラウドAPIを使用する](./cloud-api.md)でプログラムによりOpenHandsと対話する
|
||||
- [クラウド課題リゾルバーを設定する](./cloud-issue-resolver.md)でコード修正を自動化し、インテリジェントな支援を提供する
|
||||
@@ -1,65 +0,0 @@
|
||||
# OpenHands Cloud
|
||||
|
||||
OpenHands CloudはAll Hands AIによるOpenHandsのクラウドホスト版です。
|
||||
|
||||
## OpenHands Cloudへのアクセス
|
||||
|
||||
OpenHands Cloudは https://app.all-hands.dev/ でアクセスできます。
|
||||
|
||||
[API](./cloud-api)を使用してプログラム的にOpenHands Cloudと対話することもできます。
|
||||
|
||||
## はじめに
|
||||
|
||||
OpenHands Cloudにアクセスすると、GitHubまたはGitLabアカウントとの接続を求められます:
|
||||
|
||||
1. 利用規約を読んで同意した後、`Log in with GitHub`または`Log in with GitLab`をクリックします。
|
||||
2. OpenHandsが要求する権限を確認し、`Authorize OpenHands AI`をクリックします。
|
||||
- OpenHandsはGitHubまたはGitLabアカウントからいくつかの権限を必要とします。これらの権限について詳しく知るには:
|
||||
- GitHub:GitHub認証ページの`Learn more`リンクをクリックできます。
|
||||
- GitLab:GitLab認証ページで各権限リクエストを展開できます。
|
||||
|
||||
## リポジトリアクセス
|
||||
|
||||
### GitHub
|
||||
|
||||
#### リポジトリアクセスの追加
|
||||
|
||||
OpenHandsに特定のリポジトリへのアクセス権を付与できます:
|
||||
1. ホームページで`Add GitHub repos`をクリックします。
|
||||
2. 組織を選択し、OpenHandsにアクセス権を付与する特定のリポジトリを選択します。
|
||||
<details>
|
||||
<summary>リポジトリアクセスの権限詳細</summary>
|
||||
|
||||
Openhandsは短期間のトークン(8時間で期限切れ)を以下の権限で要求します:
|
||||
- Actions:読み取りと書き込み
|
||||
- Administration:読み取り専用
|
||||
- Commit statuses:読み取りと書き込み
|
||||
- Contents:読み取りと書き込み
|
||||
- Issues:読み取りと書き込み
|
||||
- Metadata:読み取り専用
|
||||
- Pull requests:読み取りと書き込み
|
||||
- Webhooks:読み取りと書き込み
|
||||
- Workflows:読み取りと書き込み
|
||||
|
||||
ユーザーのリポジトリアクセスは以下に基づいて付与されます:
|
||||
- リポジトリに対して付与された権限
|
||||
- ユーザーのGitHub権限(オーナー/コラボレーター)
|
||||
</details>
|
||||
|
||||
3. `Install & Authorize`をクリックします。
|
||||
|
||||
#### リポジトリアクセスの変更
|
||||
|
||||
GitHubリポジトリアクセスはいつでも以下の方法で変更できます:
|
||||
* 同じ`Add GitHub repos`ワークフローを使用する、または
|
||||
* 設定ページにアクセスし、`Git Settings`セクションの下にある`Configure GitHub Repositories`を選択する。
|
||||
|
||||
### GitLab
|
||||
|
||||
GitLabアカウントを使用する場合、OpenHandsは自動的にあなたのリポジトリにアクセスできるようになります。
|
||||
|
||||
## 会話の保持
|
||||
|
||||
- 会話リスト – 過去10日間に開始された最新10件の会話のみが表示されます。
|
||||
- ワークスペース – 会話ワークスペースは14日間保持されます。
|
||||
- ランタイム – ランタイムは30分間アクティブ(「ウォーム」)な状態を維持します。この期間後、会話を再開するには1〜2分かかる場合があります。
|
||||
@@ -36,7 +36,7 @@ DockerでOpenHandsをCLIモードで実行するには:
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -45,7 +45,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.cli
|
||||
```
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ DockerでヘッドレスモードでOpenHandsを実行するには:
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -43,7 +43,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
|
||||
@@ -58,17 +58,17 @@ OpenHandsを実行するには、最新のプロセッサと最低**4GB RAM**を
|
||||
OpenHandsを実行する最も簡単な方法はDockerを使用することです。
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
OpenHandsは http://localhost:3000 で実行されています!
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||

|
||||
|
||||
### チャットパネル
|
||||
- ユーザーとOpenHandsの会話を表示します。
|
||||
- ユーザーとOpenHands間の会話を表示します。
|
||||
- OpenHandsはこのパネルで自身の行動を説明します。
|
||||
|
||||
### 変更点
|
||||
- OpenHandsによって実行されたファイルの変更を表示します。
|
||||
### 変更
|
||||
- OpenHandsによって実行されたファイル変更を表示します。
|
||||
|
||||
### VS Code
|
||||
- ファイルの閲覧や修正のための組み込みVS Code。
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
### Jupyter
|
||||
- OpenHandsによって実行されたすべてのPythonコマンドを表示します。
|
||||
- OpenHandsを使用してデータ可視化タスクを実行する際に特に便利です。
|
||||
- データ可視化タスクにOpenHandsを使用する際に特に便利です。
|
||||
|
||||
### アプリ
|
||||
- OpenHandsがアプリケーションを実行する際にウェブサーバーを表示します。
|
||||
@@ -26,4 +26,4 @@
|
||||
|
||||
### ブラウザ
|
||||
- OpenHandsがウェブサイトを閲覧するために使用します。
|
||||
- このブラウザは非対話型です。
|
||||
- ブラウザは非対話式です。
|
||||
|
||||
@@ -13,7 +13,7 @@ OpenHandsはLiteLLMでサポートされているあらゆるLLMに接続でき
|
||||
|
||||
これらの調査結果とコミュニティからのフィードバックに基づき、以下のモデルはOpenHandsでうまく動作することが確認されています:
|
||||
|
||||
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (推奨)
|
||||
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (推奨)
|
||||
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
|
||||
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
|
||||
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# Resolvedor GitHub na Nuvem
|
||||
|
||||
O Resolvedor GitHub automatiza correções de código e fornece assistência inteligente para seus repositórios.
|
||||
|
||||
## Configuração
|
||||
|
||||
O Resolvedor GitHub na Nuvem está disponível automaticamente quando você
|
||||
[concede acesso de repositório ao OpenHands Cloud](./openhands-cloud#adding-repository-access).
|
||||
|
||||
## Uso
|
||||
|
||||
Após conceder acesso de repositório ao OpenHands Cloud, você pode usar o Resolvedor GitHub na Nuvem nos problemas e pull requests
|
||||
do repositório.
|
||||
|
||||
### Problemas (Issues)
|
||||
|
||||
No seu repositório, rotule um problema com `openhands`. O OpenHands irá:
|
||||
1. Comentar no problema para informar que está trabalhando nele.
|
||||
- Você pode clicar no link para acompanhar o progresso no OpenHands Cloud.
|
||||
2. Abrir um pull request se determinar que o problema foi resolvido com sucesso.
|
||||
3. Comentar no problema com um resumo das tarefas realizadas e um link para o pull request.
|
||||
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Para fazer o OpenHands trabalhar em pull requests, use `@openhands` em comentários de nível superior ou em linha para:
|
||||
- Fazer perguntas
|
||||
- Solicitar atualizações
|
||||
- Obter explicações de código
|
||||
|
||||
O OpenHands irá:
|
||||
1. Comentar no PR para informar que está trabalhando nele.
|
||||
2. Realizar a tarefa.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Resolvedor de Problemas na Nuvem
|
||||
|
||||
O Resolvedor de Problemas na Nuvem automatiza correções de código e fornece assistência inteligente para seus repositórios no GitHub e GitLab.
|
||||
|
||||
## Configuração
|
||||
|
||||
O Resolvedor de Problemas na Nuvem está disponível automaticamente quando você concede acesso ao repositório OpenHands Cloud:
|
||||
- [Acesso ao repositório GitHub](./github-installation#adding-repository-access)
|
||||
- [Acesso ao repositório GitLab](./gitlab-installation#adding-repository-access)
|
||||
|
||||
## Uso
|
||||
|
||||
Após conceder acesso ao repositório OpenHands Cloud, você pode usar o Resolvedor de Problemas na Nuvem em issues e pull/merge requests em seus repositórios.
|
||||
|
||||
### Trabalhando com Issues
|
||||
|
||||
No seu repositório, rotule uma issue com `openhands`. O OpenHands irá:
|
||||
1. Comentar na issue para informar que está trabalhando nela
|
||||
- Você pode clicar no link para acompanhar o progresso no OpenHands Cloud
|
||||
2. Abrir um pull request (GitHub) ou merge request (GitLab) se determinar que o problema foi resolvido com sucesso
|
||||
3. Comentar na issue com um resumo das tarefas realizadas e um link para o PR/MR
|
||||
|
||||
### Trabalhando com Pull/Merge Requests
|
||||
|
||||
Para fazer o OpenHands trabalhar em pull requests (GitHub) ou merge requests (GitLab), mencione `@openhands` nos comentários para:
|
||||
- Fazer perguntas
|
||||
- Solicitar atualizações
|
||||
- Obter explicações de código
|
||||
|
||||
O OpenHands irá:
|
||||
1. Comentar para informar que está trabalhando nisso
|
||||
2. Realizar a tarefa solicitada
|
||||
@@ -0,0 +1,29 @@
|
||||
# Interface da Nuvem
|
||||
|
||||
A Interface da Nuvem fornece uma interface web para interagir com o OpenHands AI. Esta página explica como acessar e usar a Interface da Nuvem do OpenHands.
|
||||
|
||||
## Acessando a Interface
|
||||
|
||||
A Interface da Nuvem do OpenHands pode ser acessada em [app.all-hands.dev](https://app.all-hands.dev). Você precisará fazer login com sua conta do GitHub ou GitLab para acessar a interface.
|
||||
|
||||
<!-- A imagem será adicionada em uma atualização futura -->
|
||||
<!--  -->
|
||||
|
||||
## Recursos Principais
|
||||
|
||||
Para informações detalhadas sobre os recursos disponíveis na Interface da Nuvem do OpenHands, consulte a seção [Recursos Principais](../key-features.md) da documentação.
|
||||
|
||||
## Configurações
|
||||
|
||||
A página de configurações permite que você:
|
||||
|
||||
1. Configure as preferências da sua conta
|
||||
2. Gerencie o acesso ao repositório
|
||||
3. Gere chaves de API para acesso programático
|
||||
4. Personalize sua experiência com o OpenHands
|
||||
|
||||
## Próximos Passos
|
||||
|
||||
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
|
||||
- [Aprenda sobre a API da Nuvem](./cloud-api.md) para acesso programático
|
||||
- [Voltar para Introdução](./openhands-cloud.md)
|
||||
@@ -0,0 +1,55 @@
|
||||
# Instalação do GitHub
|
||||
|
||||
Este guia orienta você pelo processo de instalação e configuração do OpenHands Cloud para seus repositórios GitHub.
|
||||
|
||||
## Pré-requisitos
|
||||
|
||||
- Uma conta GitHub
|
||||
- Acesso ao OpenHands Cloud
|
||||
|
||||
## Passos de Instalação
|
||||
|
||||
1. Faça login no [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. Se você ainda não conectou sua conta GitHub:
|
||||
- Clique em `Conectar ao GitHub`
|
||||
- Revise e aceite os termos de serviço
|
||||
- Autorize a aplicação OpenHands AI
|
||||
|
||||
## Adicionando Acesso ao Repositório
|
||||
|
||||
Você pode conceder ao OpenHands acesso a repositórios específicos:
|
||||
|
||||
1. Clique no menu suspenso `Selecionar um projeto GitHub`, depois selecione `Adicionar mais repositórios...`
|
||||
2. Selecione sua organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
|
||||
- OpenHands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
|
||||
- Ações: Leitura e escrita
|
||||
- Administração: Somente leitura
|
||||
- Status de commit: Leitura e escrita
|
||||
- Conteúdos: Leitura e escrita
|
||||
- Issues: Leitura e escrita
|
||||
- Metadados: Somente leitura
|
||||
- Pull requests: Leitura e escrita
|
||||
- Webhooks: Leitura e escrita
|
||||
- Workflows: Leitura e escrita
|
||||
- O acesso ao repositório para um usuário é concedido com base em:
|
||||
- Permissão concedida para o repositório
|
||||
- Permissões do GitHub do usuário (proprietário/colaborador)
|
||||
3. Clique em `Instalar e Autorizar`
|
||||
|
||||
## Modificando o Acesso ao Repositório
|
||||
|
||||
Você pode modificar o acesso ao repositório a qualquer momento:
|
||||
* Usando o mesmo fluxo de trabalho `Selecionar um projeto GitHub > Adicionar mais repositórios`, ou
|
||||
* Visitando a página de Configurações e selecionando `Configurar Repositórios GitHub` na seção `Configurações do GitHub`.
|
||||
|
||||
## Usando OpenHands com GitHub
|
||||
|
||||
Depois de conceder acesso ao repositório, você pode usar o OpenHands com seus repositórios GitHub.
|
||||
|
||||
Para detalhes sobre como usar o OpenHands com issues e pull requests do GitHub, consulte a documentação do [Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md).
|
||||
|
||||
## Próximos Passos
|
||||
|
||||
- [Acesse a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
|
||||
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
|
||||
- [Use a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
|
||||
@@ -0,0 +1,50 @@
|
||||
# Instalação do GitLab
|
||||
|
||||
Este guia orienta você pelo processo de instalação e configuração do OpenHands Cloud para seus repositórios GitLab.
|
||||
|
||||
## Pré-requisitos
|
||||
|
||||
- Uma conta GitLab
|
||||
- Acesso ao OpenHands Cloud
|
||||
|
||||
## Passos de Instalação
|
||||
|
||||
1. Faça login no [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. Se você ainda não conectou sua conta GitLab:
|
||||
- Clique em `Conectar ao GitLab`
|
||||
- Revise e aceite os termos de serviço
|
||||
- Autorize a aplicação OpenHands AI
|
||||
|
||||
## Adicionando Acesso ao Repositório
|
||||
|
||||
Você pode conceder ao OpenHands acesso a repositórios específicos:
|
||||
|
||||
1. Clique no menu suspenso `Selecionar um projeto GitLab`, depois selecione `Adicionar mais repositórios...`
|
||||
2. Selecione sua organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
|
||||
- OpenHands solicita permissões com estes escopos:
|
||||
- api: Acesso completo à API
|
||||
- read_user: Ler informações do usuário
|
||||
- read_repository: Ler informações do repositório
|
||||
- write_repository: Escrever no repositório
|
||||
- O acesso ao repositório para um usuário é concedido com base em:
|
||||
- Permissão concedida para o repositório
|
||||
- Permissões do GitLab do usuário (proprietário/mantenedor/desenvolvedor)
|
||||
3. Clique em `Instalar e Autorizar`
|
||||
|
||||
## Modificando o Acesso ao Repositório
|
||||
|
||||
Você pode modificar o acesso ao repositório a qualquer momento:
|
||||
* Usando o mesmo fluxo de trabalho `Selecionar um projeto GitLab > Adicionar mais repositórios`, ou
|
||||
* Visitando a página de Configurações e selecionando `Configurar Repositórios GitLab` na seção `Configurações do GitLab`.
|
||||
|
||||
## Usando OpenHands com GitLab
|
||||
|
||||
Depois de conceder acesso ao repositório, você pode usar o OpenHands com seus repositórios GitLab.
|
||||
|
||||
Para detalhes sobre como usar o OpenHands com issues e merge requests do GitLab, consulte a documentação do [Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md).
|
||||
|
||||
## Próximos Passos
|
||||
|
||||
- [Acesse a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
|
||||
- [Use o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e obter assistência
|
||||
- [Use a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
|
||||
@@ -1,45 +1,24 @@
|
||||
# Openhands Cloud
|
||||
# OpenHands Cloud
|
||||
|
||||
O OpenHands Cloud é a versão hospedada na nuvem do OpenHands da All Hands AI.
|
||||
OpenHands Cloud é a versão hospedada na nuvem do OpenHands da All Hands AI.
|
||||
|
||||
## Acessando o OpenHands Cloud
|
||||
|
||||
Atualmente, os usuários estão sendo admitidos para acessar o OpenHands Cloud em ondas. Para se inscrever,
|
||||
[entre na lista de espera](https://www.all-hands.dev/join-waitlist). Assim que for aprovado, você receberá um e-mail com
|
||||
instruções sobre como acessá-lo.
|
||||
Para começar com o OpenHands Cloud, visite [app.all-hands.dev](https://app.all-hands.dev).
|
||||
|
||||
## Primeiros Passos
|
||||
Você será solicitado a se conectar com sua conta GitHub ou GitLab:
|
||||
|
||||
Após visitar o OpenHands Cloud, você será solicitado a se conectar com sua conta do GitHub:
|
||||
1. Após ler e aceitar os termos de serviço, clique em `Connect to GitHub`.
|
||||
2. Revise as permissões solicitadas pelo OpenHands e clique em `Authorize OpenHands AI`.
|
||||
- O OpenHands exigirá algumas permissões da sua conta do GitHub. Para ler mais sobre essas permissões,
|
||||
você pode clicar no link `Learn more` na página de autorização do GitHub.
|
||||
1. Após ler e aceitar os termos de serviço, clique em `Conectar ao GitHub` ou `Conectar ao GitLab`.
|
||||
2. Revise as permissões solicitadas pelo OpenHands e autorize a aplicação.
|
||||
- OpenHands exigirá certas permissões da sua conta. Para ler mais sobre essas permissões,
|
||||
você pode clicar no link `Saiba mais` na página de autorização.
|
||||
|
||||
## Acesso ao Repositório
|
||||
## Próximos Passos
|
||||
|
||||
### Adicionando Acesso ao Repositório
|
||||
Depois de conectar sua conta, você pode:
|
||||
|
||||
Você pode conceder ao OpenHands acesso específico ao repositório:
|
||||
1. Clique no menu suspenso `Select a GitHub project`, selecione `Add more repositories...`.
|
||||
2. Selecione a organização e escolha os repositórios específicos para conceder acesso ao OpenHands.
|
||||
- O Openhands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
|
||||
- Actions: Read and write
|
||||
- Administration: Read-only
|
||||
- Commit statuses: Read and write
|
||||
- Contents: Read and write
|
||||
- Issues: Read and write
|
||||
- Metadata: Read-only
|
||||
- Pull requests: Read and write
|
||||
- Webhooks: Read and write
|
||||
- Workflows: Read and write
|
||||
- O acesso ao repositório para um usuário é concedido com base em:
|
||||
- Permissão concedida para o repositório.
|
||||
- Permissões do GitHub do usuário (proprietário/colaborador).
|
||||
3. Clique em `Install & Authorize`.
|
||||
|
||||
### Modificando o Acesso ao Repositório
|
||||
|
||||
Você pode modificar o acesso ao repositório a qualquer momento:
|
||||
* Usando o mesmo fluxo de trabalho `Select a GitHub project > Add more repositories`, ou
|
||||
* Visitando a página de Configurações e selecionando `Configure GitHub Repositories` na seção `GitHub Settings`.
|
||||
- [Instalar a Integração com GitHub](./github-installation.md) para usar o OpenHands com seus repositórios GitHub
|
||||
- [Instalar a Integração com GitLab](./gitlab-installation.md) para usar o OpenHands com seus repositórios GitLab
|
||||
- [Acessar a Interface da Nuvem](./cloud-ui.md) para interagir com a interface web
|
||||
- [Usar a API da Nuvem](./cloud-api.md) para interagir programaticamente com o OpenHands
|
||||
- [Configurar o Resolvedor de Problemas na Nuvem](./cloud-issue-resolver.md) para automatizar correções de código e fornecer assistência inteligente
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
# Openhands Cloud
|
||||
|
||||
OpenHands Cloud é a versão hospedada na nuvem do OpenHands pela All Hands AI.
|
||||
|
||||
## Acessando o OpenHands Cloud
|
||||
|
||||
O OpenHands Cloud pode ser acessado em https://app.all-hands.dev/.
|
||||
|
||||
Você também pode interagir com o OpenHands Cloud programaticamente usando a [API](./cloud-api).
|
||||
|
||||
## Primeiros Passos
|
||||
|
||||
Ao visitar o OpenHands Cloud, você será solicitado a conectar-se com sua conta GitHub ou GitLab:
|
||||
|
||||
1. Após ler e aceitar os termos de serviço, clique em `Log in with GitHub` ou `Log in with GitLab`.
|
||||
2. Revise as permissões solicitadas pelo OpenHands e então clique em `Authorize OpenHands AI`.
|
||||
- O OpenHands precisará de algumas permissões da sua conta GitHub ou GitLab. Para ler mais sobre essas permissões:
|
||||
- GitHub: Você pode clicar no link `Learn more` na página de autorização do GitHub.
|
||||
- GitLab: Você pode expandir cada solicitação de permissão na página de autorização do GitLab.
|
||||
|
||||
## Acesso ao Repositório
|
||||
|
||||
### GitHub
|
||||
|
||||
#### Adicionando Acesso ao Repositório
|
||||
|
||||
Você pode conceder ao OpenHands acesso específico ao repositório:
|
||||
1. Clique em `Add GitHub repos` na página inicial.
|
||||
2. Selecione a organização e, em seguida, escolha os repositórios específicos para conceder acesso ao OpenHands.
|
||||
<details>
|
||||
<summary>Detalhes de Permissão para Acesso ao Repositório</summary>
|
||||
|
||||
O Openhands solicita tokens de curta duração (expiração de 8 horas) com estas permissões:
|
||||
- Actions: Leitura e escrita
|
||||
- Administration: Somente leitura
|
||||
- Commit statuses: Leitura e escrita
|
||||
- Contents: Leitura e escrita
|
||||
- Issues: Leitura e escrita
|
||||
- Metadata: Somente leitura
|
||||
- Pull requests: Leitura e escrita
|
||||
- Webhooks: Leitura e escrita
|
||||
- Workflows: Leitura e escrita
|
||||
|
||||
O acesso ao repositório para um usuário é concedido com base em:
|
||||
- Permissão concedida para o repositório.
|
||||
- Permissões do GitHub do usuário (proprietário/colaborador).
|
||||
</details>
|
||||
|
||||
3. Clique em `Install & Authorize`.
|
||||
|
||||
#### Modificando o Acesso ao Repositório
|
||||
|
||||
Você pode modificar o acesso ao repositório do GitHub a qualquer momento:
|
||||
* Usando o mesmo fluxo de trabalho `Add GitHub repos`, ou
|
||||
* Visitando a página de Configurações e selecionando `Configure GitHub Repositories` na seção `Git Settings`.
|
||||
|
||||
### GitLab
|
||||
|
||||
Ao usar sua conta GitLab, o OpenHands terá automaticamente acesso aos seus repositórios.
|
||||
|
||||
## Persistência de Conversas
|
||||
|
||||
- Lista de Conversas – Exibe apenas as 10 conversas mais recentes iniciadas nos últimos 10 dias.
|
||||
- Workspaces – Os workspaces de conversas são mantidos por 14 dias.
|
||||
- Runtimes – Os runtimes permanecem ativos ("aquecidos") por 30 minutos. Após esse período, retomar uma conversa pode levar de 1 a 2 minutos.
|
||||
@@ -37,7 +37,7 @@ Para executar o OpenHands no modo CLI com Docker:
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -46,7 +46,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.cli
|
||||
```
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Para executar o OpenHands em modo Headless com Docker:
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -44,7 +44,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
|
||||
@@ -58,17 +58,17 @@
|
||||
A maneira mais fácil de executar o OpenHands é no Docker.
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
Você encontrará o OpenHands rodando em http://localhost:3000!
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Visão Geral dos Recursos do OpenHands
|
||||
# Visão Geral das Funcionalidades do OpenHands
|
||||
|
||||

|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
- Exibe a conversa entre o usuário e o OpenHands.
|
||||
- O OpenHands explica suas ações neste painel.
|
||||
|
||||
### Mudanças
|
||||
### Alterações
|
||||
- Mostra as alterações de arquivos realizadas pelo OpenHands.
|
||||
|
||||
### VS Code
|
||||
@@ -14,13 +14,13 @@
|
||||
- Também pode ser usado para fazer upload e download de arquivos.
|
||||
|
||||
### Terminal
|
||||
- Um espaço para o OpenHands e os usuários executarem comandos de terminal.
|
||||
- Um espaço para o OpenHands e usuários executarem comandos de terminal.
|
||||
|
||||
### Jupyter
|
||||
- Mostra todos os comandos Python que foram executados pelo OpenHands.
|
||||
- Particularmente útil ao usar o OpenHands para realizar tarefas de visualização de dados.
|
||||
- Particularmente útil ao usar o OpenHands para tarefas de visualização de dados.
|
||||
|
||||
### App
|
||||
### Aplicativo
|
||||
- Exibe o servidor web quando o OpenHands executa uma aplicação.
|
||||
- Os usuários podem interagir com a aplicação em execução.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ recomendações para seleção de modelos. Nossos resultados de benchmarking mai
|
||||
|
||||
Com base nessas descobertas e feedback da comunidade, os seguintes modelos foram verificados e funcionam razoavelmente bem com o OpenHands:
|
||||
|
||||
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recomendado)
|
||||
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recomendado)
|
||||
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
|
||||
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
|
||||
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# Cloud GitHub Resolver
|
||||
|
||||
GitHub Resolver 自动修复代码并为您的仓库提供智能辅助。
|
||||
|
||||
## 设置
|
||||
|
||||
当您[授予 OpenHands Cloud 仓库访问权限](./openhands-cloud#adding-repository-access)后,Cloud GitHub Resolver 会自动可用。
|
||||
|
||||
## 使用方法
|
||||
|
||||
授予 OpenHands Cloud 仓库访问权限后,您可以在仓库的 issues 和 pull requests 中使用 Cloud GitHub Resolver。
|
||||
|
||||
### Issues
|
||||
|
||||
在您的仓库中,给 issue 添加 `openhands` 标签。OpenHands 将会:
|
||||
1. 在 issue 上发表评论,让您知道它正在处理该问题。
|
||||
- 您可以点击链接在 OpenHands Cloud 上跟踪进度。
|
||||
2. 如果确定问题已成功解决,则会打开一个 pull request。
|
||||
3. 在 issue 上发表评论,总结已执行的任务并提供 pull request 的链接。
|
||||
|
||||
|
||||
### Pull Requests
|
||||
|
||||
要让 OpenHands 处理 pull requests,请在顶级或内联评论中使用 `@openhands` 来:
|
||||
- 提问
|
||||
- 请求更新
|
||||
- 获取代码解释
|
||||
|
||||
OpenHands 将会:
|
||||
1. 在 PR 上发表评论,让您知道它正在处理该请求。
|
||||
2. 执行任务。
|
||||
@@ -0,0 +1,32 @@
|
||||
# 云问题解决器
|
||||
|
||||
云问题解决器可以自动修复代码并为您的GitHub和GitLab仓库提供智能辅助。
|
||||
|
||||
## 设置
|
||||
|
||||
当您授予OpenHands Cloud仓库访问权限时,云问题解决器会自动可用:
|
||||
- [GitHub仓库访问](./github-installation#adding-repository-access)
|
||||
- [GitLab仓库访问](./gitlab-installation#adding-repository-access)
|
||||
|
||||
## 使用方法
|
||||
|
||||
授予OpenHands Cloud仓库访问权限后,您可以在仓库的问题和拉取/合并请求中使用云问题解决器。
|
||||
|
||||
### 处理问题
|
||||
|
||||
在您的仓库中,给问题添加`openhands`标签。OpenHands将会:
|
||||
1. 在问题上发表评论,让您知道它正在处理
|
||||
- 您可以点击链接在OpenHands Cloud上跟踪进度
|
||||
2. 如果确定问题已成功解决,则打开拉取请求(GitHub)或合并请求(GitLab)
|
||||
3. 在问题上发表评论,总结已执行的任务并提供PR/MR的链接
|
||||
|
||||
### 处理拉取/合并请求
|
||||
|
||||
要让OpenHands处理拉取请求(GitHub)或合并请求(GitLab),在评论中提及`@openhands`以:
|
||||
- 提问
|
||||
- 请求更新
|
||||
- 获取代码解释
|
||||
|
||||
OpenHands将会:
|
||||
1. 发表评论让您知道它正在处理
|
||||
2. 执行请求的任务
|
||||
@@ -0,0 +1,29 @@
|
||||
# 云界面
|
||||
|
||||
云界面为与OpenHands AI交互提供了网页界面。本页面说明如何访问和使用OpenHands云界面。
|
||||
|
||||
## 访问界面
|
||||
|
||||
OpenHands云界面可以在[app.all-hands.dev](https://app.all-hands.dev)访问。您需要使用GitHub或GitLab账户登录才能访问界面。
|
||||
|
||||
<!-- 图片将在未来更新中添加 -->
|
||||
<!--  -->
|
||||
|
||||
## 主要功能
|
||||
|
||||
有关OpenHands云界面中可用功能的详细信息,请参阅文档的[主要功能](../key-features.md)部分。
|
||||
|
||||
## 设置
|
||||
|
||||
设置页面允许您:
|
||||
|
||||
1. 配置您的账户偏好
|
||||
2. 管理仓库访问权限
|
||||
3. 生成用于程序化访问的API密钥
|
||||
4. 自定义您的OpenHands体验
|
||||
|
||||
## 下一步
|
||||
|
||||
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
|
||||
- [了解云API](./cloud-api.md)进行程序化访问
|
||||
- [返回入门指南](./openhands-cloud.md)
|
||||
@@ -0,0 +1,55 @@
|
||||
# GitHub 安装
|
||||
|
||||
本指南将引导您完成为GitHub仓库安装和配置OpenHands Cloud的过程。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- GitHub账户
|
||||
- 访问OpenHands Cloud
|
||||
|
||||
## 安装步骤
|
||||
|
||||
1. 登录[OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. 如果您尚未连接GitHub账户:
|
||||
- 点击`连接到GitHub`
|
||||
- 查看并接受服务条款
|
||||
- 授权OpenHands AI应用程序
|
||||
|
||||
## 添加仓库访问权限
|
||||
|
||||
您可以授予OpenHands访问特定仓库的权限:
|
||||
|
||||
1. 点击`选择GitHub项目`下拉菜单,然后选择`添加更多仓库...`
|
||||
2. 选择您的组织并选择要授予OpenHands访问权限的特定仓库。
|
||||
- OpenHands请求短期令牌(8小时过期)并具有以下权限:
|
||||
- 操作:读取和写入
|
||||
- 管理:只读
|
||||
- 提交状态:读取和写入
|
||||
- 内容:读取和写入
|
||||
- 问题:读取和写入
|
||||
- 元数据:只读
|
||||
- 拉取请求:读取和写入
|
||||
- Webhooks:读取和写入
|
||||
- 工作流程:读取和写入
|
||||
- 用户的仓库访问权限基于:
|
||||
- 为仓库授予的权限
|
||||
- 用户的GitHub权限(所有者/协作者)
|
||||
3. 点击`安装并授权`
|
||||
|
||||
## 修改仓库访问权限
|
||||
|
||||
您可以随时修改仓库访问权限:
|
||||
* 使用相同的`选择GitHub项目 > 添加更多仓库`工作流程,或
|
||||
* 访问设置页面并在`GitHub设置`部分选择`配置GitHub仓库`。
|
||||
|
||||
## 使用OpenHands与GitHub
|
||||
|
||||
一旦您授予了仓库访问权限,您就可以将OpenHands与您的GitHub仓库一起使用。
|
||||
|
||||
有关如何将OpenHands与GitHub问题和拉取请求一起使用的详细信息,请参阅[云问题解决器](./cloud-issue-resolver.md)文档。
|
||||
|
||||
## 下一步
|
||||
|
||||
- [访问云界面](./cloud-ui.md)与网页界面交互
|
||||
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
|
||||
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
|
||||
@@ -0,0 +1,50 @@
|
||||
# GitLab 安装
|
||||
|
||||
本指南将引导您完成为GitLab仓库安装和配置OpenHands Cloud的过程。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- GitLab账户
|
||||
- 访问OpenHands Cloud
|
||||
|
||||
## 安装步骤
|
||||
|
||||
1. 登录[OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. 如果您尚未连接GitLab账户:
|
||||
- 点击`连接到GitLab`
|
||||
- 查看并接受服务条款
|
||||
- 授权OpenHands AI应用程序
|
||||
|
||||
## 添加仓库访问权限
|
||||
|
||||
您可以授予OpenHands访问特定仓库的权限:
|
||||
|
||||
1. 点击`选择GitLab项目`下拉菜单,然后选择`添加更多仓库...`
|
||||
2. 选择您的组织并选择要授予OpenHands访问权限的特定仓库。
|
||||
- OpenHands请求具有以下范围的权限:
|
||||
- api:完全API访问
|
||||
- read_user:读取用户信息
|
||||
- read_repository:读取仓库信息
|
||||
- write_repository:写入仓库
|
||||
- 用户的仓库访问权限基于:
|
||||
- 为仓库授予的权限
|
||||
- 用户的GitLab权限(所有者/维护者/开发者)
|
||||
3. 点击`安装并授权`
|
||||
|
||||
## 修改仓库访问权限
|
||||
|
||||
您可以随时修改仓库访问权限:
|
||||
* 使用相同的`选择GitLab项目 > 添加更多仓库`工作流程,或
|
||||
* 访问设置页面并在`GitLab设置`部分选择`配置GitLab仓库`。
|
||||
|
||||
## 使用OpenHands与GitLab
|
||||
|
||||
一旦您授予了仓库访问权限,您就可以将OpenHands与您的GitLab仓库一起使用。
|
||||
|
||||
有关如何将OpenHands与GitLab问题和合并请求一起使用的详细信息,请参阅[云问题解决器](./cloud-issue-resolver.md)文档。
|
||||
|
||||
## 下一步
|
||||
|
||||
- [访问云界面](./cloud-ui.md)与网页界面交互
|
||||
- [使用云问题解决器](./cloud-issue-resolver.md)自动修复代码并获取帮助
|
||||
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
|
||||
@@ -0,0 +1,24 @@
|
||||
# OpenHands 云
|
||||
|
||||
OpenHands 云是All Hands AI的OpenHands的托管云版本。
|
||||
|
||||
## 访问OpenHands云
|
||||
|
||||
要开始使用OpenHands云,请访问[app.all-hands.dev](https://app.all-hands.dev)。
|
||||
|
||||
系统将提示您连接您的GitHub或GitLab账户:
|
||||
|
||||
1. 阅读并接受服务条款后,点击`连接到GitHub`或`连接到GitLab`。
|
||||
2. 查看OpenHands请求的权限并授权应用程序。
|
||||
- OpenHands将需要您账户的某些权限。要了解更多关于这些权限的信息,
|
||||
您可以点击授权页面上的`了解更多`链接。
|
||||
|
||||
## 下一步
|
||||
|
||||
一旦您连接了账户,您可以:
|
||||
|
||||
- [安装GitHub集成](./github-installation.md)以将OpenHands与您的GitHub仓库一起使用
|
||||
- [安装GitLab集成](./gitlab-installation.md)以将OpenHands与您的GitLab仓库一起使用
|
||||
- [访问云界面](./cloud-ui.md)与网页界面交互
|
||||
- [使用云API](./cloud-api.md)以编程方式与OpenHands交互
|
||||
- [设置云问题解决器](./cloud-issue-resolver.md)自动修复代码并提供智能辅助
|
||||
@@ -1,65 +0,0 @@
|
||||
# OpenHands Cloud
|
||||
|
||||
OpenHands Cloud 是由 All Hands AI 提供的 OpenHands 云托管版本。
|
||||
|
||||
## 访问 OpenHands Cloud
|
||||
|
||||
OpenHands Cloud 可以通过 https://app.all-hands.dev/ 访问。
|
||||
|
||||
您还可以使用 [API](./cloud-api) 以编程方式与 OpenHands Cloud 交互。
|
||||
|
||||
## 入门指南
|
||||
|
||||
访问 OpenHands Cloud 后,系统会要求您连接您的 GitHub 或 GitLab 账户:
|
||||
|
||||
1. 阅读并接受服务条款后,点击 `Log in with GitHub` 或 `Log in with GitLab`。
|
||||
2. 查看 OpenHands 请求的权限,然后点击 `Authorize OpenHands AI`。
|
||||
- OpenHands 将需要您的 GitHub 或 GitLab 账户的一些权限。要了解更多关于这些权限的信息:
|
||||
- GitHub:您可以点击 GitHub 授权页面上的 `Learn more` 链接。
|
||||
- GitLab:您可以在 GitLab 授权页面上展开每个权限请求。
|
||||
|
||||
## 仓库访问
|
||||
|
||||
### GitHub
|
||||
|
||||
#### 添加仓库访问权限
|
||||
|
||||
您可以授予 OpenHands 特定仓库的访问权限:
|
||||
1. 在首页点击 `Add GitHub repos`。
|
||||
2. 选择组织,然后选择要授予 OpenHands 访问权限的特定仓库。
|
||||
<details>
|
||||
<summary>仓库访问权限详情</summary>
|
||||
|
||||
Openhands 请求短期令牌(8小时过期)并具有以下权限:
|
||||
- Actions:读写权限
|
||||
- Administration:只读权限
|
||||
- Commit statuses:读写权限
|
||||
- Contents:读写权限
|
||||
- Issues:读写权限
|
||||
- Metadata:只读权限
|
||||
- Pull requests:读写权限
|
||||
- Webhooks:读写权限
|
||||
- Workflows:读写权限
|
||||
|
||||
用户的仓库访问权限基于:
|
||||
- 为仓库授予的权限。
|
||||
- 用户的 GitHub 权限(所有者/协作者)。
|
||||
</details>
|
||||
|
||||
3. 点击 `Install & Authorize`。
|
||||
|
||||
#### 修改仓库访问权限
|
||||
|
||||
您可以随时修改 GitHub 仓库访问权限,方法是:
|
||||
* 使用相同的 `Add GitHub repos` 流程,或
|
||||
* 访问设置页面,在 `Git Settings` 部分下选择 `Configure GitHub Repositories`。
|
||||
|
||||
### GitLab
|
||||
|
||||
使用 GitLab 账户时,OpenHands 将自动获得对您仓库的访问权限。
|
||||
|
||||
## 对话持久性
|
||||
|
||||
- 对话列表 – 仅显示过去 10 天内发起的 10 个最近对话。
|
||||
- 工作区 – 对话工作区保留 14 天。
|
||||
- 运行时 – 运行时保持活跃("热"状态)30 分钟。在此期间后,恢复对话可能需要 1-2 分钟。
|
||||
@@ -36,7 +36,7 @@ poetry run python -m openhands.core.cli
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -45,7 +45,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.cli
|
||||
```
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ poetry run python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -43,7 +43,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
|
||||
@@ -58,17 +58,17 @@
|
||||
运行 OpenHands 最简单的方法是使用 Docker。
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
OpenHands 将在 http://localhost:3000 运行!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# OpenHands 功能概览
|
||||
|
||||

|
||||

|
||||
|
||||
### 聊天面板
|
||||
- 显示用户与 OpenHands 之间的对话。
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
### 应用
|
||||
- 当 OpenHands 运行应用程序时显示网络服务器。
|
||||
- 用户可以与运行中的应用程序交互。
|
||||
- 用户可以与正在运行的应用程序交互。
|
||||
|
||||
### 浏览器
|
||||
- 由 OpenHands 用于浏览网站。
|
||||
|
||||
@@ -12,7 +12,7 @@ OpenHands 可以连接到任何 LiteLLM 支持的 LLM。但是,它需要一个
|
||||
|
||||
基于这些发现和社区反馈,以下模型已被验证可以与 OpenHands 合理地配合使用:
|
||||
|
||||
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api)(推荐)
|
||||
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api)(推荐)
|
||||
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
|
||||
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
|
||||
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
|
||||
|
||||
84
docs/modules/python/aspirational.md
Normal file
84
docs/modules/python/aspirational.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Using OpenHands as a library
|
||||
|
||||
|
||||
## Hello World
|
||||
```python
|
||||
import asyncio
|
||||
from openhands.core.config import OpenHandsConfig, LLMConfig, AgentConfig
|
||||
from openhands.core.setup import run_agent
|
||||
|
||||
async def run_openhands_agent():
|
||||
final_state = await run_agent(
|
||||
config=OpenHandsConfig(
|
||||
llm=LLMConfig(
|
||||
model="claude-sonnet-4-20250514",
|
||||
api_key="your_api_key_here", # Replace with your actual API key
|
||||
),
|
||||
),
|
||||
initial_user_message="Flip a coin",
|
||||
context_message="You build simple programs and run them.",
|
||||
)
|
||||
|
||||
return final_state
|
||||
|
||||
# Run the async function
|
||||
if __name__ == "__main__":
|
||||
final_state = asyncio.run(run_openhands_agent())
|
||||
print("Agent execution completed!")
|
||||
```
|
||||
|
||||
## Using the internals
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from openhands.controller.agent import Agent
|
||||
from openhands.core.config import OpenHandsConfig, LLMConfig, AgentConfig
|
||||
from openhands.events.action import MessageAction
|
||||
from openhands.llm.llm import LLM
|
||||
from openhands.core.setup import (
|
||||
create_runtime,
|
||||
create_memory,
|
||||
generate_sid,
|
||||
)
|
||||
from openhands.core.main import run_controller
|
||||
|
||||
async def run_openhands_agent():
|
||||
config = OpenHandsConfig(
|
||||
runtime="local",
|
||||
file_store="memory",
|
||||
llm=LLMConfig(
|
||||
model="claude-sonnet-4-20250514", # Choose your preferred model
|
||||
api_key="your_api_key_here", # Replace with your actual API key
|
||||
temperature=0.0, # Set temperature to 0 for deterministic output
|
||||
),
|
||||
agent=AgentConfig(
|
||||
enable_browsing=False,
|
||||
),
|
||||
)
|
||||
|
||||
oh = OpenHands(config=config)
|
||||
|
||||
conversation = oh.create_conversation(
|
||||
conversation_id='hello-world',
|
||||
)
|
||||
await conversation.runtime.connect()
|
||||
|
||||
def on_event(event: Event) -> None:
|
||||
print(f"Event received: {event}")
|
||||
conversation.event_stream.subscribe(EventStreamSubscriber.MAIN, on_event)
|
||||
|
||||
initial_user_action = MessageAction(content="Flip a coin")
|
||||
conversation.event_stream.add_event(initial_user_action, EventSource.USER)
|
||||
|
||||
while conversation.state.agent_state not in end_states:
|
||||
await asyncio.sleep(1)
|
||||
|
||||
await runtime.close()
|
||||
|
||||
return conversation.state
|
||||
|
||||
# Run the async function
|
||||
if __name__ == "__main__":
|
||||
final_state = asyncio.run(run_openhands_agent())
|
||||
print("Agent execution completed!")
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"items": ["python/python"],
|
||||
"items": ["python/python", "python/using-openhands-as-library"],
|
||||
"label": "Backend",
|
||||
"type": "category"
|
||||
}
|
||||
|
||||
399
docs/modules/python/using-openhands-as-library.md
Normal file
399
docs/modules/python/using-openhands-as-library.md
Normal file
@@ -0,0 +1,399 @@
|
||||
# Using OpenHands as a Library
|
||||
|
||||
OpenHands can be used as a Python library in your own applications. This guide will show you how to integrate OpenHands into your Python projects, allowing you to build custom applications that leverage OpenHands' powerful agent capabilities.
|
||||
|
||||
## Installation
|
||||
|
||||
First, install the OpenHands library from PyPI:
|
||||
|
||||
```bash
|
||||
pip install openhands-ai
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
Here's a simple example of how to use OpenHands in your Python code:
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from openhands.controller.agent import Agent
|
||||
from openhands.core.config import AppConfig, LLMConfig, AgentConfig
|
||||
from openhands.events.action import MessageAction
|
||||
from openhands.llm.llm import LLM
|
||||
from openhands.core.setup import (
|
||||
create_runtime,
|
||||
create_memory,
|
||||
generate_sid,
|
||||
)
|
||||
from openhands.core.main import run_controller
|
||||
|
||||
async def run_openhands_agent():
|
||||
# 1. Create configuration
|
||||
config = AppConfig(
|
||||
runtime="local", # Use local runtime
|
||||
file_store="memory", # Store events in memory
|
||||
)
|
||||
|
||||
# 2. Configure LLM
|
||||
llm_config = LLMConfig(
|
||||
model="claude-sonnet-4-20250514", # Choose your preferred model
|
||||
api_key="your_api_key_here", # Replace with your actual API key
|
||||
temperature=0.0,
|
||||
)
|
||||
config.set_llm_config(llm_config)
|
||||
|
||||
# 3. Configure Agent
|
||||
agent_config = AgentConfig(
|
||||
enable_browsing=False, # Disable browsing for this example
|
||||
)
|
||||
config.set_agent_config(agent_config)
|
||||
|
||||
# 4. Create Agent
|
||||
agent = Agent(
|
||||
llm=LLM(config=llm_config),
|
||||
config=agent_config,
|
||||
)
|
||||
|
||||
# 5. Generate a session ID
|
||||
sid = generate_sid(config)
|
||||
|
||||
# 6. Create Runtime
|
||||
runtime = create_runtime(
|
||||
config=config,
|
||||
sid=sid,
|
||||
headless_mode=True,
|
||||
agent=agent,
|
||||
)
|
||||
|
||||
# 7. Connect to the runtime
|
||||
await runtime.connect()
|
||||
|
||||
# 8. Create Memory
|
||||
memory = create_memory(
|
||||
runtime=runtime,
|
||||
event_stream=runtime.event_stream,
|
||||
sid=sid,
|
||||
)
|
||||
|
||||
# 9. Define the initial task
|
||||
initial_user_action = MessageAction(content="Write a Python function that calculates the factorial of a number")
|
||||
|
||||
# 10. Run the agent
|
||||
final_state = await run_controller(
|
||||
config=config,
|
||||
initial_user_action=initial_user_action,
|
||||
sid=sid,
|
||||
runtime=runtime,
|
||||
agent=agent,
|
||||
memory=memory,
|
||||
headless_mode=True,
|
||||
exit_on_message=True, # Exit when the agent asks for user input
|
||||
)
|
||||
|
||||
# 11. Close the runtime
|
||||
await runtime.close()
|
||||
|
||||
return final_state
|
||||
|
||||
# Run the async function
|
||||
if __name__ == "__main__":
|
||||
final_state = asyncio.run(run_openhands_agent())
|
||||
print("Agent execution completed!")
|
||||
```
|
||||
|
||||
## Components Overview
|
||||
|
||||
### AppConfig
|
||||
|
||||
The `AppConfig` class is the main configuration object for OpenHands. It contains settings for the runtime, agent, LLM, and more.
|
||||
|
||||
```python
|
||||
from openhands.core.config import AppConfig
|
||||
|
||||
config = AppConfig(
|
||||
runtime="local", # Options: "local", "docker", "e2b", "modal", etc.
|
||||
file_store="memory", # Options: "memory", "local", etc.
|
||||
file_store_path="/path/to/store", # Only needed for "local" file_store
|
||||
max_iterations=100, # Maximum number of agent iterations
|
||||
)
|
||||
```
|
||||
|
||||
### LLMConfig
|
||||
|
||||
The `LLMConfig` class configures the language model used by the agent.
|
||||
|
||||
```python
|
||||
from openhands.core.config import LLMConfig
|
||||
|
||||
llm_config = LLMConfig(
|
||||
model="claude-sonnet-4-20250514", # Model name
|
||||
api_key="your_api_key_here", # API key
|
||||
temperature=0.0, # Temperature for generation
|
||||
max_output_tokens=4096, # Maximum tokens in the response
|
||||
)
|
||||
```
|
||||
|
||||
### AgentConfig
|
||||
|
||||
The `AgentConfig` class configures the agent's behavior and available tools.
|
||||
|
||||
```python
|
||||
from openhands.core.config import AgentConfig
|
||||
|
||||
agent_config = AgentConfig(
|
||||
enable_browsing=True, # Enable web browsing
|
||||
enable_cmd=True, # Enable bash commands
|
||||
enable_editor=True, # Enable file editing
|
||||
enable_jupyter=True, # Enable Jupyter notebook
|
||||
enable_think=True, # Enable thinking tool
|
||||
enable_finish=True, # Enable finish tool
|
||||
)
|
||||
```
|
||||
|
||||
### Agent
|
||||
|
||||
The `Agent` class represents the AI agent that will perform tasks.
|
||||
|
||||
```python
|
||||
from openhands.controller.agent import Agent
|
||||
from openhands.llm.llm import LLM
|
||||
|
||||
agent = Agent(
|
||||
llm=LLM(config=llm_config),
|
||||
config=agent_config,
|
||||
)
|
||||
```
|
||||
|
||||
### Runtime
|
||||
|
||||
The runtime is the environment where the agent executes commands and interacts with the system.
|
||||
|
||||
```python
|
||||
from openhands.core.setup import create_runtime
|
||||
|
||||
runtime = create_runtime(
|
||||
config=config,
|
||||
sid=sid,
|
||||
headless_mode=True,
|
||||
agent=agent,
|
||||
)
|
||||
```
|
||||
|
||||
### Memory
|
||||
|
||||
The memory component manages the agent's context and conversation history.
|
||||
|
||||
```python
|
||||
from openhands.core.setup import create_memory
|
||||
|
||||
memory = create_memory(
|
||||
runtime=runtime,
|
||||
event_stream=runtime.event_stream,
|
||||
sid=sid,
|
||||
)
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Custom Sandbox Configuration
|
||||
|
||||
You can customize the sandbox environment by configuring the `SandboxConfig`:
|
||||
|
||||
```python
|
||||
from openhands.core.config import SandboxConfig
|
||||
|
||||
sandbox_config = SandboxConfig(
|
||||
selected_repo="username/repo", # GitHub repository to clone
|
||||
base_image="ubuntu:22.04", # Base Docker image
|
||||
)
|
||||
config.sandbox = sandbox_config
|
||||
```
|
||||
|
||||
### Security Configuration
|
||||
|
||||
Configure security settings using the `SecurityConfig`:
|
||||
|
||||
```python
|
||||
from openhands.core.config import SecurityConfig
|
||||
|
||||
security_config = SecurityConfig(
|
||||
confirmation_mode=False, # Whether to require confirmation for actions
|
||||
security_analyzer="default", # Security analyzer to use
|
||||
)
|
||||
config.security = security_config
|
||||
```
|
||||
|
||||
### Custom Agent Response Handling
|
||||
|
||||
You can provide a custom function to handle agent responses:
|
||||
|
||||
```python
|
||||
def custom_response_handler(state):
|
||||
# Process the agent's state and generate a response
|
||||
return "Continue with your current approach"
|
||||
|
||||
final_state = await run_controller(
|
||||
config=config,
|
||||
initial_user_action=initial_user_action,
|
||||
fake_user_response_fn=custom_response_handler,
|
||||
)
|
||||
```
|
||||
|
||||
## Building a Complete Application
|
||||
|
||||
Here's an example of a more complete application that uses OpenHands to assist with code generation:
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
import os
|
||||
from openhands.controller.agent import Agent
|
||||
from openhands.core.config import AppConfig, LLMConfig, AgentConfig, SandboxConfig
|
||||
from openhands.events.action import MessageAction
|
||||
from openhands.llm.llm import LLM
|
||||
from openhands.core.setup import create_runtime, create_memory, generate_sid
|
||||
from openhands.core.main import run_controller
|
||||
from openhands.events import EventStreamSubscriber
|
||||
from openhands.events.observation import AgentStateChangedObservation
|
||||
from openhands.core.schema import AgentState
|
||||
|
||||
class CodeAssistant:
|
||||
def __init__(self, api_key, model="claude-sonnet-4-20250514"):
|
||||
self.api_key = api_key
|
||||
self.model = model
|
||||
self.config = None
|
||||
self.agent = None
|
||||
self.runtime = None
|
||||
self.memory = None
|
||||
self.sid = None
|
||||
self.event_stream = None
|
||||
|
||||
async def initialize(self):
|
||||
# Create configuration
|
||||
self.config = AppConfig(
|
||||
runtime="docker",
|
||||
file_store="memory",
|
||||
)
|
||||
|
||||
# Configure LLM
|
||||
llm_config = LLMConfig(
|
||||
model=self.model,
|
||||
api_key=self.api_key,
|
||||
temperature=0.0,
|
||||
)
|
||||
self.config.set_llm_config(llm_config)
|
||||
|
||||
# Configure Agent
|
||||
agent_config = AgentConfig(
|
||||
enable_browsing=True,
|
||||
enable_cmd=True,
|
||||
enable_editor=True,
|
||||
enable_jupyter=True,
|
||||
)
|
||||
self.config.set_agent_config(agent_config)
|
||||
|
||||
# Configure Sandbox
|
||||
sandbox_config = SandboxConfig(
|
||||
base_image="ubuntu:22.04",
|
||||
)
|
||||
self.config.sandbox = sandbox_config
|
||||
|
||||
# Create Agent
|
||||
self.agent = Agent(
|
||||
llm=LLM(config=llm_config),
|
||||
config=agent_config,
|
||||
)
|
||||
|
||||
# Generate a session ID
|
||||
self.sid = generate_sid(self.config)
|
||||
|
||||
# Create Runtime
|
||||
self.runtime = create_runtime(
|
||||
config=self.config,
|
||||
sid=self.sid,
|
||||
headless_mode=True,
|
||||
agent=self.agent,
|
||||
)
|
||||
|
||||
# Connect to the runtime
|
||||
await self.runtime.connect()
|
||||
|
||||
# Create Memory
|
||||
self.memory = create_memory(
|
||||
runtime=self.runtime,
|
||||
event_stream=self.runtime.event_stream,
|
||||
sid=self.sid,
|
||||
)
|
||||
|
||||
self.event_stream = self.runtime.event_stream
|
||||
|
||||
async def run_task(self, task_description, callback=None):
|
||||
# Define the initial task
|
||||
initial_user_action = MessageAction(content=task_description)
|
||||
|
||||
# Set up event callback if provided
|
||||
if callback:
|
||||
def on_event(event):
|
||||
if isinstance(event, AgentStateChangedObservation):
|
||||
callback(event)
|
||||
|
||||
self.event_stream.subscribe(
|
||||
EventStreamSubscriber.MAIN,
|
||||
on_event,
|
||||
self.sid
|
||||
)
|
||||
|
||||
# Run the agent
|
||||
final_state = await run_controller(
|
||||
config=self.config,
|
||||
initial_user_action=initial_user_action,
|
||||
sid=self.sid,
|
||||
runtime=self.runtime,
|
||||
agent=self.agent,
|
||||
memory=self.memory,
|
||||
headless_mode=True,
|
||||
exit_on_message=True,
|
||||
)
|
||||
|
||||
return final_state
|
||||
|
||||
async def close(self):
|
||||
if self.runtime:
|
||||
await self.runtime.close()
|
||||
|
||||
# Example usage
|
||||
async def main():
|
||||
# Initialize the code assistant
|
||||
assistant = CodeAssistant(api_key=os.environ.get("ANTHROPIC_API_KEY"))
|
||||
await assistant.initialize()
|
||||
|
||||
# Define a callback to process events
|
||||
def event_callback(event):
|
||||
if isinstance(event, AgentStateChangedObservation):
|
||||
print(f"Agent state changed to: {event.agent_state}")
|
||||
|
||||
# Run a task
|
||||
task = """
|
||||
Create a simple Flask API with the following endpoints:
|
||||
1. GET /users - Returns a list of users
|
||||
2. GET /users/{id} - Returns a specific user
|
||||
3. POST /users - Creates a new user
|
||||
|
||||
Use SQLite as the database and implement proper error handling.
|
||||
"""
|
||||
|
||||
final_state = await assistant.run_task(task, callback=event_callback)
|
||||
|
||||
# Close the assistant
|
||||
await assistant.close()
|
||||
|
||||
print("Task completed!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
||||
## Conclusion
|
||||
|
||||
Using OpenHands as a library gives you the flexibility to integrate AI agents into your own applications. You can customize the agent's behavior, runtime environment, and how it interacts with your application.
|
||||
|
||||
For more advanced usage, refer to the OpenHands source code and API documentation. The library is highly customizable and can be adapted to a wide range of use cases.
|
||||
@@ -1,4 +1,4 @@
|
||||
# OpenHands Cloud API
|
||||
# Cloud API
|
||||
|
||||
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if
|
||||
you want to kick off your own jobs from your programs in a flexible way.
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# Cloud GitHub Resolver
|
||||
|
||||
The GitHub Resolver automates code fixes and provides intelligent assistance for your repositories.
|
||||
|
||||
## Setup
|
||||
|
||||
The Cloud GitHub Resolver is available automatically when you
|
||||
[grant OpenHands Cloud repository access](./openhands-cloud#adding-repository-access).
|
||||
|
||||
## Usage
|
||||
|
||||
After granting OpenHands Cloud repository access, you can use the Cloud GitHub Resolver on the issues and pull requests
|
||||
on the repository.
|
||||
|
||||
### Issues
|
||||
|
||||
On your repository, label an issue with `openhands`. OpenHands will:
|
||||
1. Comment on the issue to let you know it is working on it.
|
||||
- You can click on the link to track the progress on OpenHands Cloud.
|
||||
2. Open a pull request if it determines that the issue has been successfully resolved.
|
||||
3. Comment on the issue with a summary of the performed tasks and a link to the pull request.
|
||||
|
||||
|
||||
### Pull Requests
|
||||
|
||||
To get OpenHands to work on pull requests, use `@openhands` in top level or inline comments to:
|
||||
- Ask questions
|
||||
- Request updates
|
||||
- Get code explanations
|
||||
|
||||
OpenHands will:
|
||||
1. Comment on the PR to let you know it is working on it.
|
||||
2. Perform the task.
|
||||
32
docs/modules/usage/cloud/cloud-issue-resolver.md
Normal file
32
docs/modules/usage/cloud/cloud-issue-resolver.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# Cloud Issue Resolver
|
||||
|
||||
The Cloud Issue Resolver automates code fixes and provides intelligent assistance for your repositories on GitHub.
|
||||
|
||||
## Setup
|
||||
|
||||
The Cloud Issue Resolver is available automatically when you grant OpenHands Cloud repository access:
|
||||
- [GitHub repository access](./github-installation#adding-repository-access)
|
||||
|
||||
## Usage
|
||||
|
||||
After granting OpenHands Cloud repository access, you can use the Cloud Issue Resolver on issues and pull requests in your repositories.
|
||||
|
||||
### Working with Issues
|
||||
|
||||
On your repository, label an issue with `openhands` or add a message starting with
|
||||
`@openhands`. OpenHands will:
|
||||
1. Comment on the issue to let you know it is working on it
|
||||
- You can click on the link to track the progress on OpenHands Cloud
|
||||
2. Open a pull request if it determines that the issue has been successfully resolved
|
||||
3. Comment on the issue with a summary of the performed tasks and a link to the PR
|
||||
|
||||
### Working with Pull Requests
|
||||
|
||||
To get OpenHands to work on pull requests, mention `@openhands` in comments to:
|
||||
- Ask questions
|
||||
- Request updates
|
||||
- Get code explanations
|
||||
|
||||
OpenHands will:
|
||||
1. Comment to let you know it is working on it
|
||||
2. Perform the requested task
|
||||
26
docs/modules/usage/cloud/cloud-ui.md
Normal file
26
docs/modules/usage/cloud/cloud-ui.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Cloud UI
|
||||
|
||||
The Cloud UI provides a web interface for interacting with OpenHands AI. This page explains how to access and use the OpenHands Cloud UI.
|
||||
|
||||
## Accessing the UI
|
||||
|
||||
The OpenHands Cloud UI can be accessed at [app.all-hands.dev](https://app.all-hands.dev). You'll need to sign in with your GitHub or GitLab account to access the interface.
|
||||
|
||||
|
||||
## Key Features
|
||||
|
||||
For detailed information about the features available in the OpenHands Cloud UI, please refer to the [Key Features](../key-features.md) section of the documentation.
|
||||
|
||||
## Settings
|
||||
|
||||
The settings page allows you to:
|
||||
|
||||
- Configure your account preferences.
|
||||
- Manage repository access.
|
||||
- Generate API keys for programmatic access.
|
||||
- Generate custom secrets for the agent.
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Use the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and get assistance.
|
||||
- [Learn about the Cloud API](./cloud-api.md) for programmatic access.
|
||||
53
docs/modules/usage/cloud/github-installation.md
Normal file
53
docs/modules/usage/cloud/github-installation.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# GitHub Installation
|
||||
|
||||
This guide walks you through the process of installing and configuring OpenHands Cloud for your GitHub repositories.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A GitHub account
|
||||
- Access to OpenHands Cloud
|
||||
|
||||
## Installation Steps
|
||||
|
||||
1. Log in to [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. If you haven't connected your GitHub account yet:
|
||||
- Click on `Connect to GitHub`
|
||||
- Review and accept the terms of service
|
||||
- Authorize the OpenHands AI application
|
||||
|
||||
## Adding Repository Access
|
||||
|
||||
You can grant OpenHands access to specific repositories:
|
||||
|
||||
1. Click on `Add GitHub repos`
|
||||
2. Select your organization and choose the specific repositories to grant OpenHands access to.
|
||||
- OpenHands requests short-lived tokens (8-hour expiration) with these permissions:
|
||||
- Actions: Read and write
|
||||
- Administration: Read-only
|
||||
- Commit statuses: Read and write
|
||||
- Contents: Read and write
|
||||
- Issues: Read and write
|
||||
- Metadata: Read-only
|
||||
- Pull requests: Read and write
|
||||
- Webhooks: Read and write
|
||||
- Workflows: Read and write
|
||||
- Repository access for a user is granted based on:
|
||||
- Permission granted for the repository
|
||||
- User's GitHub permissions (owner/collaborator)
|
||||
3. Click `Install & Authorize`
|
||||
|
||||
## Modifying Repository Access
|
||||
|
||||
You can modify repository access at any time by visiting the Settings page and selecting `Configure GitHub Repositories` under the `Git` tab.
|
||||
|
||||
## Using OpenHands with GitHub
|
||||
|
||||
Once you've granted repository access, you can use OpenHands with your GitHub repositories.
|
||||
|
||||
For details on how to use OpenHands with GitHub issues and pull requests, see the [Cloud Issue Resolver](./cloud-issue-resolver.md) documentation.
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
|
||||
- [Use the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and get assistance
|
||||
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
|
||||
22
docs/modules/usage/cloud/gitlab-installation.md
Normal file
22
docs/modules/usage/cloud/gitlab-installation.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# GitLab Installation
|
||||
|
||||
This guide walks you through the process of installing and configuring OpenHands Cloud for your GitLab repositories.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- A GitLab account
|
||||
- Access to OpenHands Cloud
|
||||
|
||||
## Installation Steps
|
||||
|
||||
1. Log in to [OpenHands Cloud](https://app.all-hands.dev)
|
||||
2. If you haven't connected your GitLab account yet:
|
||||
- Click on `Log in with GitLab`
|
||||
- Authorize the OpenHands application
|
||||
|
||||
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
|
||||
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
|
||||
24
docs/modules/usage/cloud/openhands-cloud.md
Normal file
24
docs/modules/usage/cloud/openhands-cloud.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# OpenHands Cloud
|
||||
|
||||
OpenHands Cloud is the hosted cloud version of All Hands AI's OpenHands.
|
||||
|
||||
## Accessing OpenHands Cloud
|
||||
|
||||
To get started with OpenHands Cloud, visit [app.all-hands.dev](https://app.all-hands.dev).
|
||||
|
||||
You'll be prompted to connect with your GitHub or GitLab account:
|
||||
|
||||
1. Click `Log in with GitHub` or `Log in with GitLab`.
|
||||
2. Review the permissions requested by OpenHands and authorize the application.
|
||||
- OpenHands will require certain permissions from your account. To read more about these permissions,
|
||||
you can click the `Learn more` link on the authorization page.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Once you've connected your account, you can:
|
||||
|
||||
- [Install GitHub Integration](./github-installation.md) to use OpenHands with your GitHub repositories
|
||||
- [Install GitLab Integration](./gitlab-installation.md) to use OpenHands with your GitLab repositories
|
||||
- [Access the Cloud UI](./cloud-ui.md) to interact with the web interface
|
||||
- [Use the Cloud API](./cloud-api.md) to programmatically interact with OpenHands
|
||||
- [Set up the Cloud Issue Resolver](./cloud-issue-resolver.md) to automate code fixes and provide intelligent assistance
|
||||
@@ -331,6 +331,8 @@ The agent configuration options are defined in the `[agent]` and `[agent.<agent_
|
||||
|
||||
The sandbox configuration options are defined in the `[sandbox]` section of the `config.toml` file.
|
||||
|
||||
|
||||
|
||||
To use these with the docker command, pass in `-e SANDBOX_<option>`. Example: `-e SANDBOX_TIMEOUT`.
|
||||
|
||||
### Execution
|
||||
|
||||
@@ -23,7 +23,7 @@ This command opens an interactive prompt where you can type tasks or commands an
|
||||
|
||||
1. Set the following environment variables in your terminal:
|
||||
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
|
||||
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
|
||||
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-sonnet-4-20250514"`)
|
||||
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
|
||||
|
||||
2. Run the following command:
|
||||
@@ -31,7 +31,7 @@ This command opens an interactive prompt where you can type tasks or commands an
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -40,7 +40,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.cli.main
|
||||
```
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ The following `launch.json` will allow debugging the agent, controller and serve
|
||||
"name": "OpenHands CLI",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "openhands.core.cli",
|
||||
"module": "openhands.cli.main",
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ To run OpenHands in Headless mode with Docker:
|
||||
|
||||
1. Set the following environment variables in your terminal:
|
||||
- `SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
|
||||
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
|
||||
- `LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-sonnet-4-20250514"`)
|
||||
- `LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
|
||||
|
||||
2. Run the following Docker command:
|
||||
@@ -31,7 +31,7 @@ To run OpenHands in Headless mode with Docker:
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e SANDBOX_VOLUMES=$SANDBOX_VOLUMES \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
@@ -41,7 +41,7 @@ docker run -it \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38 \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
|
||||
181
docs/modules/usage/how-to/websocket-connection.md
Normal file
181
docs/modules/usage/how-to/websocket-connection.md
Normal file
@@ -0,0 +1,181 @@
|
||||
---
|
||||
sidebar_position: 9
|
||||
---
|
||||
|
||||
# Connecting to the WebSocket
|
||||
|
||||
This guide explains how to connect to the OpenHands WebSocket API to receive real-time events and send actions to the agent.
|
||||
|
||||
## Overview
|
||||
|
||||
OpenHands uses [Socket.IO](https://socket.io/) for WebSocket communication between the client and server. The WebSocket connection allows you to:
|
||||
|
||||
1. Receive real-time events from the agent
|
||||
2. Send user actions to the agent
|
||||
3. Maintain a persistent connection for ongoing conversations
|
||||
|
||||
## Connecting to the WebSocket
|
||||
|
||||
### Connection Parameters
|
||||
|
||||
When connecting to the WebSocket, you need to provide the following query parameters:
|
||||
|
||||
- `conversation_id`: The ID of the conversation you want to join
|
||||
- `latest_event_id`: The ID of the latest event you've received (use `-1` for a new connection)
|
||||
- `providers_set`: (Optional) A comma-separated list of provider types
|
||||
|
||||
### Connection Example
|
||||
|
||||
Here's a basic example of connecting to the WebSocket using JavaScript:
|
||||
|
||||
```javascript
|
||||
import { io } from "socket.io-client";
|
||||
|
||||
const socket = io("http://localhost:3000", {
|
||||
transports: ["websocket"],
|
||||
query: {
|
||||
conversation_id: "your-conversation-id",
|
||||
latest_event_id: -1,
|
||||
providers_set: "github,gitlab" // Optional
|
||||
}
|
||||
});
|
||||
|
||||
socket.on("connect", () => {
|
||||
console.log("Connected to OpenHands WebSocket");
|
||||
});
|
||||
|
||||
socket.on("oh_event", (event) => {
|
||||
console.log("Received event:", event);
|
||||
});
|
||||
|
||||
socket.on("connect_error", (error) => {
|
||||
console.error("Connection error:", error);
|
||||
});
|
||||
|
||||
socket.on("disconnect", (reason) => {
|
||||
console.log("Disconnected:", reason);
|
||||
});
|
||||
```
|
||||
|
||||
## Sending Actions to the Agent
|
||||
|
||||
To send an action to the agent, use the `oh_user_action` event:
|
||||
|
||||
```javascript
|
||||
// Send a user message to the agent
|
||||
socket.emit("oh_user_action", {
|
||||
type: "message",
|
||||
source: "user",
|
||||
message: "Hello, can you help me with my project?"
|
||||
});
|
||||
```
|
||||
|
||||
## Receiving Events from the Agent
|
||||
|
||||
The server emits events using the `oh_event` event type. Here are some common event types you might receive:
|
||||
|
||||
- User messages (`source: "user", type: "message"`)
|
||||
- Agent messages (`source: "agent", type: "message"`)
|
||||
- File edits (`action: "edit"`)
|
||||
- File writes (`action: "write"`)
|
||||
- Command executions (`action: "run"`)
|
||||
|
||||
Example event handler:
|
||||
|
||||
```javascript
|
||||
socket.on("oh_event", (event) => {
|
||||
if (event.source === "agent" && event.type === "message") {
|
||||
console.log("Agent says:", event.message);
|
||||
} else if (event.action === "run") {
|
||||
console.log("Command executed:", event.args.command);
|
||||
console.log("Result:", event.result);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## Using Websocat for Testing
|
||||
|
||||
[Websocat](https://github.com/vi/websocat) is a command-line tool for interacting with WebSockets. It's useful for testing your WebSocket connection without writing a full client application.
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# On macOS
|
||||
brew install websocat
|
||||
|
||||
# On Linux
|
||||
curl -L https://github.com/vi/websocat/releases/download/v1.11.0/websocat.x86_64-unknown-linux-musl > websocat
|
||||
chmod +x websocat
|
||||
sudo mv websocat /usr/local/bin/
|
||||
```
|
||||
|
||||
### Connecting to the WebSocket
|
||||
|
||||
```bash
|
||||
# Connect to the WebSocket and print all received messages
|
||||
echo "40{}" | \
|
||||
websocat "ws://localhost:3000/socket.io/?EIO=4&transport=websocket&conversation_id=your-conversation-id&latest_event_id=-1"
|
||||
```
|
||||
|
||||
### Sending a Message
|
||||
|
||||
```bash
|
||||
# Send a message to the agent
|
||||
echo '42["oh_user_action",{"type":"message","source":"user","message":"Hello, agent!"}]' | \
|
||||
websocat "ws://localhost:3000/socket.io/?EIO=4&transport=websocket&conversation_id=your-conversation-id&latest_event_id=-1"
|
||||
```
|
||||
|
||||
### Complete Example with Websocat
|
||||
|
||||
Here's a complete example of connecting to the WebSocket, sending a message, and receiving events:
|
||||
|
||||
```bash
|
||||
# Start a persistent connection
|
||||
websocat -v "ws://localhost:3000/socket.io/?EIO=4&transport=websocket&conversation_id=your-conversation-id&latest_event_id=-1"
|
||||
|
||||
# In another terminal, send a message
|
||||
echo '42["oh_user_action",{"type":"message","source":"user","message":"Can you help me with my project?"}]' | \
|
||||
websocat "ws://localhost:3000/socket.io/?EIO=4&transport=websocket&conversation_id=your-conversation-id&latest_event_id=-1"
|
||||
```
|
||||
|
||||
## Event Structure
|
||||
|
||||
Events sent and received through the WebSocket follow a specific structure:
|
||||
|
||||
```typescript
|
||||
interface OpenHandsEvent {
|
||||
id: string; // Unique event ID
|
||||
source: string; // "user" or "agent"
|
||||
timestamp: string; // ISO timestamp
|
||||
message?: string; // For message events
|
||||
type?: string; // Event type (e.g., "message")
|
||||
action?: string; // Action type (e.g., "run", "edit", "write")
|
||||
args?: any; // Action arguments
|
||||
result?: any; // Action result
|
||||
}
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Handle Reconnection**: Implement reconnection logic in your client to handle network interruptions.
|
||||
2. **Track Event IDs**: Store the latest event ID you've received and use it when reconnecting to avoid duplicate events.
|
||||
3. **Error Handling**: Implement proper error handling for connection errors and failed actions.
|
||||
4. **Rate Limiting**: Avoid sending too many actions in a short period to prevent overloading the server.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Connection Issues
|
||||
|
||||
- Verify that the OpenHands server is running and accessible
|
||||
- Check that you're providing the correct conversation ID
|
||||
- Ensure your WebSocket URL is correctly formatted
|
||||
|
||||
### Authentication Issues
|
||||
|
||||
- Make sure you have the necessary authentication cookies if required
|
||||
- Verify that you have permission to access the specified conversation
|
||||
|
||||
### Event Handling Issues
|
||||
|
||||
- Check that you're correctly parsing the event data
|
||||
- Verify that your event handlers are properly registered
|
||||
@@ -58,17 +58,17 @@ A system with a modern processor and a minimum of **4GB RAM** is recommended to
|
||||
The easiest way to run OpenHands is in Docker.
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.38-nikolaik \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.38
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
You'll find OpenHands running at http://localhost:3000!
|
||||
|
||||
@@ -13,7 +13,7 @@ recommendations for model selection. Our latest benchmarking results can be foun
|
||||
|
||||
Based on these findings and community feedback, these are the latest models that have been verified to work reasonably well with OpenHands:
|
||||
|
||||
- [anthropic/claude-3-7-sonnet-20250219](https://www.anthropic.com/api) (recommended)
|
||||
- [anthropic/claude-sonnet-4-20250514](https://www.anthropic.com/api) (recommended)
|
||||
- [openai/o4-mini](https://openai.com/index/introducing-o3-and-o4-mini/)
|
||||
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
|
||||
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Local LLM with SGLang or vLLM
|
||||
# Local LLMs
|
||||
|
||||
:::warning
|
||||
When using a Local LLM, OpenHands may have limited functionality.
|
||||
@@ -7,10 +7,91 @@ It is highly recommended that you use GPUs to serve local models for optimal exp
|
||||
|
||||
## News
|
||||
|
||||
- 2025/05/21: We collaborated with Mistral AI and released [Devstral Small](https://mistral.ai/news/devstral) that achieves [46.8% on SWE-Bench Verified](https://github.com/SWE-bench/experiments/pull/228)!
|
||||
- 2025/03/31: We released an open model OpenHands LM v0.1 32B that achieves 37.1% on SWE-Bench Verified
|
||||
([blog](https://www.all-hands.dev/blog/introducing-openhands-lm-32b----a-strong-open-coding-agent-model), [model](https://huggingface.co/all-hands/openhands-lm-32b-v0.1)).
|
||||
|
||||
## Download the Model from Huggingface
|
||||
|
||||
## Quickstart: Running OpenHands on Your Macbook
|
||||
|
||||
### Serve the model on your Macbook
|
||||
|
||||
We recommend using [LMStudio](https://lmstudio.ai/) for serving these models locally.
|
||||
|
||||
1. Download [LM Studio](https://lmstudio.ai/) and install it
|
||||
|
||||
2. Download the model:
|
||||
- Option 1: Directly download the LLM from [this link](https://lmstudio.ai/model/devstral-small-2505-mlx) or by searching for the name `Devstral-Small-2505` in LM Studio
|
||||
- Option 2: Download a LLM in GGUF format. For example, to download [Devstral Small 2505 GGUF](https://huggingface.co/mistralai/Devstral-Small-2505_gguf), using `huggingface-cli download mistralai/Devstral-Small-2505_gguf --local-dir mistralai/Devstral-Small-2505_gguf`. Then in bash terminal, run `lms import {model_name}` in the directory where you've downloaded the model checkpoint (e.g. run `lms import devstralQ4_K_M.gguf` in `mistralai/Devstral-Small-2505_gguf`)
|
||||
|
||||
3. Open LM Studio application, you should first switch to `power user` mode, and then open the developer tab:
|
||||
|
||||

|
||||
|
||||
4. Then click `Select a model to load` on top of the application:
|
||||
|
||||

|
||||
|
||||
5. And choose the model you want to use, holding `option` on mac to enable advanced loading options:
|
||||
|
||||

|
||||
|
||||
6. You should then pick an appropriate context window for OpenHands based on your hardware configuration (larger than 32768 is recommended for using OpenHands, but too large may cause you to run out of memory); Flash attention is also recommended if it works on your machine.
|
||||
|
||||

|
||||
|
||||
7. And you should start the server (if it is not already in `Running` status), un-toggle `Serve on Local Network` and remember the port number of the LMStudio URL (`1234` is the port number for `http://127.0.0.1:1234` in this example):
|
||||
|
||||

|
||||
|
||||
8. Finally, you can click the `copy` button near model name to copy the model name (`imported-models/uncategorized/devstralq4_k_m.gguf` in this example):
|
||||
|
||||

|
||||
|
||||
### Start OpenHands with locally served model
|
||||
|
||||
Check [the installation guide](https://docs.all-hands.dev/modules/usage/installation) to make sure you have all the prerequisites for running OpenHands.
|
||||
|
||||
```bash
|
||||
export LMSTUDIO_MODEL_NAME="imported-models/uncategorized/devstralq4_k_m.gguf" # <- Replace this with the model name you copied from LMStudio
|
||||
export LMSTUDIO_URL="http://host.docker.internal:1234" # <- Replace this with the port from LMStudio
|
||||
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik
|
||||
|
||||
mkdir -p ~/.openhands-state && echo '{"language":"en","agent":"CodeActAgent","max_iterations":null,"security_analyzer":null,"confirmation_mode":false,"llm_model":"lm_studio/'$LMSTUDIO_MODEL_NAME'","llm_api_key":"dummy","llm_base_url":"'$LMSTUDIO_URL/v1'","remote_runtime_resource_factor":null,"github_token":null,"enable_default_condenser":true,"user_consents_to_analytics":true}' > ~/.openhands-state/settings.json
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.39-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
```
|
||||
|
||||
Once your server is running -- you can visit `http://localhost:3000` in your browser to use OpenHands with local Devstral model:
|
||||
```
|
||||
Digest: sha256:e72f9baecb458aedb9afc2cd5bc935118d1868719e55d50da73190d3a85c674f
|
||||
Status: Image is up to date for docker.all-hands.dev/all-hands-ai/openhands:0.39
|
||||
Starting OpenHands...
|
||||
Running OpenHands as root
|
||||
14:22:13 - openhands:INFO: server_config.py:50 - Using config class None
|
||||
INFO: Started server process [8]
|
||||
INFO: Waiting for application startup.
|
||||
INFO: Application startup complete.
|
||||
INFO: Uvicorn running on http://0.0.0.0:3000 (Press CTRL+C to quit)
|
||||
```
|
||||
|
||||
|
||||
## Advanced: Serving LLM on GPUs
|
||||
|
||||
### Download model checkpoints
|
||||
|
||||
:::note
|
||||
The model checkpoints downloaded here should NOT be in GGUF format.
|
||||
:::
|
||||
|
||||
For example, to download [OpenHands LM 32B v0.1](https://huggingface.co/all-hands/openhands-lm-32b-v0.1):
|
||||
|
||||
@@ -18,9 +99,7 @@ For example, to download [OpenHands LM 32B v0.1](https://huggingface.co/all-hand
|
||||
huggingface-cli download all-hands/openhands-lm-32b-v0.1 --local-dir all-hands/openhands-lm-32b-v0.1
|
||||
```
|
||||
|
||||
## Create an OpenAI-Compatible Endpoint With a Model Serving Framework
|
||||
|
||||
### Serving with SGLang
|
||||
### Create an OpenAI-Compatible Endpoint With SGLang
|
||||
|
||||
- Install SGLang following [the official documentation](https://docs.sglang.ai/start/install.html).
|
||||
- Example launch command for OpenHands LM 32B (with at least 2 GPUs):
|
||||
@@ -35,7 +114,7 @@ SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 python3 -m sglang.launch_server \
|
||||
--api-key mykey --context-length 131072
|
||||
```
|
||||
|
||||
### Serving with vLLM
|
||||
### Create an OpenAI-Compatible Endpoint with vLLM
|
||||
|
||||
- Install vLLM following [the official documentation](https://docs.vllm.ai/en/latest/getting_started/installation.html).
|
||||
- Example launch command for OpenHands LM 32B (with at least 2 GPUs):
|
||||
@@ -49,7 +128,7 @@ vllm serve all-hands/openhands-lm-32b-v0.1 \
|
||||
--enable-prefix-caching
|
||||
```
|
||||
|
||||
## Run and Configure OpenHands
|
||||
## Advanced: Run and Configure OpenHands
|
||||
|
||||
### Run OpenHands
|
||||
|
||||
|
||||
BIN
docs/modules/usage/llms/screenshots/1_select_power_user.png
Normal file
BIN
docs/modules/usage/llms/screenshots/1_select_power_user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 228 KiB |
BIN
docs/modules/usage/llms/screenshots/2_select_model.png
Normal file
BIN
docs/modules/usage/llms/screenshots/2_select_model.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 420 KiB |
BIN
docs/modules/usage/llms/screenshots/3_select_devstral.png
Normal file
BIN
docs/modules/usage/llms/screenshots/3_select_devstral.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
BIN
docs/modules/usage/llms/screenshots/4_set_context_window.png
Normal file
BIN
docs/modules/usage/llms/screenshots/4_set_context_window.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 558 KiB |
BIN
docs/modules/usage/llms/screenshots/5_copy_url.png
Normal file
BIN
docs/modules/usage/llms/screenshots/5_copy_url.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 646 KiB |
BIN
docs/modules/usage/llms/screenshots/6_copy_to_get_model_name.png
Normal file
BIN
docs/modules/usage/llms/screenshots/6_copy_to_get_model_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
23
docs/modules/usage/prompting/microagents-org.md
Normal file
23
docs/modules/usage/prompting/microagents-org.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Organization and User Microagents
|
||||
|
||||
## Purpose
|
||||
|
||||
Organizations and users can define microagents that apply to all repositories belonging to the organization or user.
|
||||
|
||||
## Usage
|
||||
|
||||
These microagents can be [any type of microagent](./microagents-overview#microagent-types) and will be loaded
|
||||
accordingly. However, they are applied to all repositories belonging to the organization or user.
|
||||
|
||||
Add a `.openhands` repository under the organization or user and create a `microagents` directory and place the
|
||||
microagents in that directory.
|
||||
|
||||
## Example
|
||||
|
||||
General microagent file example for organization `Great-Co` located inside the `.openhands` repository:
|
||||
`microagents/org-microagent.md`:
|
||||
```
|
||||
* Use type hints and error boundaries; validate inputs at system boundaries and fail with meaningful error messages.
|
||||
* Document interfaces and public APIs; use implementation comments only for non-obvious logic.
|
||||
* Follow the same naming convention for variables, classes, constants, etc. already used in each repository.
|
||||
```
|
||||
@@ -7,7 +7,7 @@ They provide expert guidance, automate common tasks, and ensure consistent pract
|
||||
|
||||
Currently OpenHands supports the following types of microagents:
|
||||
|
||||
- [General Repository Microagents](./microagents-repo): General guidelines for OpenHands about the repository.
|
||||
- [General Microagents](./microagents-repo): General guidelines for OpenHands about the repository.
|
||||
- [Keyword-Triggered Microagents](./microagents-keyword): Guidelines activated by specific keywords in prompts.
|
||||
|
||||
To customize OpenHands' behavior, create a .openhands/microagents/ directory in the root of your repository and
|
||||
@@ -24,7 +24,7 @@ Example repository structure:
|
||||
some-repository/
|
||||
└── .openhands/
|
||||
└── microagents/
|
||||
└── repo.md # General repository guidelines
|
||||
└── repo.md # General guidelines
|
||||
└── trigger_this.md # Microagent triggered by specific keywords
|
||||
└── trigger_that.md # Microagent triggered by specific keywords
|
||||
```
|
||||
@@ -34,7 +34,7 @@ some-repository/
|
||||
Each microagent file may include frontmatter that provides additional information. In some cases, this frontmatter
|
||||
is required:
|
||||
|
||||
| Microagent Type | Required |
|
||||
|----------------------------------|----------|
|
||||
| `General Repository Microagents` | No |
|
||||
| `Keyword-Triggered Microagents` | Yes |
|
||||
| Microagent Type | Required |
|
||||
|---------------------------------|----------|
|
||||
| `General Microagents` | No |
|
||||
| `Keyword-Triggered Microagents` | Yes |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# General Repository Microagents
|
||||
# General Microagents
|
||||
|
||||
## Purpose
|
||||
|
||||
@@ -20,7 +20,7 @@ Frontmatter should be enclosed in triple dashes (---) and may include the follow
|
||||
|
||||
## Example
|
||||
|
||||
General repository microagent file example located at `.openhands/microagents/repo.md`:
|
||||
General microagent file example located at `.openhands/microagents/repo.md`:
|
||||
```
|
||||
This project is a TODO application that allows users to track TODO items.
|
||||
|
||||
@@ -28,4 +28,4 @@ To set it up, you can run `npm run build`.
|
||||
Always make sure the tests are passing before committing changes. You can run the tests by running `npm run test`.
|
||||
```
|
||||
|
||||
[See more examples of general repository microagents here.](https://github.com/All-Hands-AI/OpenHands/tree/main/.openhands/microagents)
|
||||
[See more examples of general microagents here.](https://github.com/All-Hands-AI/OpenHands/tree/main/.openhands/microagents)
|
||||
|
||||
@@ -13,14 +13,16 @@ files on your machine. Only use this runtime in controlled environments or when
|
||||
Before using the Local Runtime, ensure that:
|
||||
|
||||
1. You can run OpenHands using the [Development workflow](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
|
||||
2. tmux is available on your system.
|
||||
2. For Linux and Mac, tmux is available on your system.
|
||||
3. For Windows, PowerShell is available on your system.
|
||||
- Only [CLI mode](../how-to/cli-mode) and [headless mode](../how-to/headless-mode) are supported in Windows with Local Runtime.
|
||||
|
||||
## Configuration
|
||||
|
||||
To use the Local Runtime, besides required configurations like the LLM provider, model and API key, you'll need to set
|
||||
the following options via environment variables or the [config.toml file](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) when starting OpenHands:
|
||||
|
||||
Via environment variables:
|
||||
Via environment variables (please use PowerShell syntax for Windows PowerShell):
|
||||
|
||||
```bash
|
||||
# Required
|
||||
@@ -65,4 +67,4 @@ The Local Runtime is particularly useful for:
|
||||
|
||||
- CI/CD pipelines where Docker is not available.
|
||||
- Testing and development of OpenHands itself.
|
||||
- Environments where container usage is restricted.
|
||||
- Environments where container usage is restricted (e.g. native Windows).
|
||||
|
||||
8
docs/package-lock.json
generated
8
docs/package-lock.json
generated
@@ -27,7 +27,7 @@
|
||||
"@docusaurus/tsconfig": "^3.7.0",
|
||||
"@docusaurus/types": "^3.5.1",
|
||||
"swagger-cli": "^4.0.4",
|
||||
"swagger-ui-dist": "^5.21.0",
|
||||
"swagger-ui-dist": "^5.22.0",
|
||||
"typescript": "~5.8.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -18730,9 +18730,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/swagger-ui-dist": {
|
||||
"version": "5.21.0",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.21.0.tgz",
|
||||
"integrity": "sha512-E0K3AB6HvQd8yQNSMR7eE5bk+323AUxjtCz/4ZNKiahOlPhPJxqn3UPIGs00cyY/dhrTDJ61L7C/a8u6zhGrZg==",
|
||||
"version": "5.22.0",
|
||||
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.22.0.tgz",
|
||||
"integrity": "sha512-8YlCSxiyb8uPFa7qoB1lRHYr1PBbT1NuV9RvQdFFPFPudRBTPf9coU5jl02KhzvrtmTEw4jXRgb0kg8pJvVuWQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"@docusaurus/tsconfig": "^3.7.0",
|
||||
"@docusaurus/types": "^3.5.1",
|
||||
"swagger-cli": "^4.0.4",
|
||||
"swagger-ui-dist": "^5.21.0",
|
||||
"swagger-ui-dist": "^5.22.0",
|
||||
"typescript": "~5.8.3"
|
||||
},
|
||||
"browserslist": {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user