mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-04-29 03:00:45 -04:00
Compare commits
10 Commits
default-se
...
budget-err
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b5200e632 | ||
|
|
6d90e80c51 | ||
|
|
f3ea6034b1 | ||
|
|
7fdf61018b | ||
|
|
aab818716e | ||
|
|
ac8b5e7934 | ||
|
|
23505576a6 | ||
|
|
d69e4feb1b | ||
|
|
faf0b93299 | ||
|
|
0356df8c6b |
16
.github/scripts/check_version_consistency.py
vendored
16
.github/scripts/check_version_consistency.py
vendored
@@ -13,8 +13,8 @@ def find_version_references(directory: str) -> Tuple[Set[str], Set[str]]:
|
||||
version_pattern_runtime = re.compile(r'runtime:(\d{1})\.(\d{2})')
|
||||
|
||||
for root, _, files in os.walk(directory):
|
||||
# Skip .git directory
|
||||
if '.git' in root:
|
||||
# Skip .git directory and docs/build directory
|
||||
if '.git' in root or 'docs/build' in root:
|
||||
continue
|
||||
|
||||
for file in files:
|
||||
@@ -28,11 +28,15 @@ def find_version_references(directory: str) -> Tuple[Set[str], Set[str]]:
|
||||
|
||||
# Find all openhands version references
|
||||
matches = version_pattern_openhands.findall(content)
|
||||
openhands_versions.update(matches)
|
||||
if matches:
|
||||
print(f'Found openhands version {matches} in {file_path}')
|
||||
openhands_versions.update(matches)
|
||||
|
||||
# Find all runtime version references
|
||||
matches = version_pattern_runtime.findall(content)
|
||||
runtime_versions.update(matches)
|
||||
if matches:
|
||||
print(f'Found runtime version {matches} in {file_path}')
|
||||
runtime_versions.update(matches)
|
||||
except Exception as e:
|
||||
print(f'Error reading {file_path}: {e}', file=sys.stderr)
|
||||
|
||||
@@ -41,8 +45,12 @@ def find_version_references(directory: str) -> Tuple[Set[str], Set[str]]:
|
||||
|
||||
def main():
|
||||
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||
print(f'Checking version consistency in {repo_root}')
|
||||
openhands_versions, runtime_versions = find_version_references(repo_root)
|
||||
|
||||
print(f'Found openhands versions: {sorted(openhands_versions)}')
|
||||
print(f'Found runtime versions: {sorted(runtime_versions)}')
|
||||
|
||||
exit_code = 0
|
||||
|
||||
if len(openhands_versions) > 1:
|
||||
|
||||
0
.openhands/setup.sh
Normal file → Executable file
0
.openhands/setup.sh
Normal file → Executable file
@@ -11,7 +11,7 @@ Otherwise, you can clone the OpenHands project directly.
|
||||
- Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu >= 22.04]
|
||||
- [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!)
|
||||
- [Python](https://www.python.org/downloads/) = 3.12
|
||||
- [NodeJS](https://nodejs.org/en/download/package-manager) >= 20.x
|
||||
- [NodeJS](https://nodejs.org/en/download/package-manager) >= 22.x
|
||||
- [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8
|
||||
- OS-specific dependencies:
|
||||
- Ubuntu: build-essential => `sudo apt-get install build-essential`
|
||||
|
||||
15
Makefile
15
Makefile
@@ -195,7 +195,14 @@ start-backend:
|
||||
# Start frontend
|
||||
start-frontend:
|
||||
@echo "$(YELLOW)Starting frontend...$(RESET)"
|
||||
@cd frontend && VITE_BACKEND_HOST=$(BACKEND_HOST_PORT) VITE_FRONTEND_PORT=$(FRONTEND_PORT) npm run dev -- --port $(FRONTEND_PORT) --host $(BACKEND_HOST)
|
||||
@cd frontend && \
|
||||
if grep -qi microsoft /proc/version 2>/dev/null; then \
|
||||
echo "Detected WSL environment. Using 'dev_wsl'"; \
|
||||
SCRIPT=dev_wsl; \
|
||||
else \
|
||||
SCRIPT=dev; \
|
||||
fi; \
|
||||
VITE_BACKEND_HOST=$(BACKEND_HOST_PORT) VITE_FRONTEND_PORT=$(FRONTEND_PORT) npm run $$SCRIPT -- --port $(FRONTEND_PORT) --host $(BACKEND_HOST)
|
||||
|
||||
# Common setup for running the app (non-callable)
|
||||
_run_setup:
|
||||
@@ -231,12 +238,6 @@ docker-run:
|
||||
docker compose up $(OPTIONS); \
|
||||
fi
|
||||
|
||||
# Run the app (WSL mode)
|
||||
run-wsl:
|
||||
@echo "$(YELLOW)Running the app in WSL mode...$(RESET)"
|
||||
@$(MAKE) -s _run_setup
|
||||
@cd frontend && echo "$(BLUE)Starting frontend with npm (WSL mode)...$(RESET)" && npm run dev_wsl -- --port $(FRONTEND_PORT)
|
||||
@echo "$(GREEN)Application started successfully in WSL mode.$(RESET)"
|
||||
|
||||
# Setup config.toml
|
||||
setup-config:
|
||||
|
||||
@@ -68,7 +68,7 @@ works best, but you have [many options](https://docs.all-hands.dev/modules/usage
|
||||
|
||||
---
|
||||
|
||||
You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes#connecting-to-your-filesystem),
|
||||
You can also [connect OpenHands to your local filesystem](https://docs.all-hands.dev/modules/usage/runtimes/docker#connecting-to-your-filesystem),
|
||||
run OpenHands in a scriptable [headless mode](https://docs.all-hands.dev/modules/usage/how-to/headless-mode),
|
||||
interact with it via a [friendly CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode),
|
||||
or run it on tagged issues with [a github action](https://docs.all-hands.dev/modules/usage/how-to/github-action).
|
||||
|
||||
@@ -6,6 +6,7 @@ select = [
|
||||
"I",
|
||||
"Q",
|
||||
"B",
|
||||
"ASYNC",
|
||||
]
|
||||
|
||||
ignore = [
|
||||
|
||||
@@ -24,7 +24,7 @@ const config: Config = {
|
||||
// may want to replace "en" with "zh-Hans".
|
||||
i18n: {
|
||||
defaultLocale: 'en',
|
||||
locales: ['en', 'fr', 'zh-Hans', 'pt-BR'],
|
||||
locales: ['en', 'fr', 'zh-Hans', 'ja', 'pt-BR'],
|
||||
localeConfigs: {
|
||||
en: {
|
||||
htmlLang: 'en-GB',
|
||||
|
||||
@@ -14,5 +14,197 @@
|
||||
"sidebar.apiSidebar.category.Backend": {
|
||||
"message": "Backend",
|
||||
"description": "The label for category Backend in sidebar apiSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.User Guides": {
|
||||
"message": "Guides d'Utilisateur",
|
||||
"description": "The label for category User Guides in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Running OpenHands": {
|
||||
"message": "Exécution d'OpenHands",
|
||||
"description": "The label for category Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Prompting": {
|
||||
"message": "Prompting",
|
||||
"description": "The label for category Prompting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Architecture": {
|
||||
"message": "Architecture",
|
||||
"description": "The label for category Architecture in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Running OpenHands": {
|
||||
"message": "Exécution d'OpenHands",
|
||||
"description": "The label for document Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Getting Started": {
|
||||
"message": "Commencer",
|
||||
"description": "The label for document Getting Started in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Key Features": {
|
||||
"message": "Fonctionnalités Clés",
|
||||
"description": "The label for document Key Features in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Customization": {
|
||||
"message": "Personnalisation",
|
||||
"description": "The label for category Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Usage Methods": {
|
||||
"message": "Méthodes d'Utilisation",
|
||||
"description": "The label for category Usage Methods in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Advanced Configuration": {
|
||||
"message": "Configuration Avancée",
|
||||
"description": "The label for category Advanced Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Troubleshooting": {
|
||||
"message": "Dépannage",
|
||||
"description": "The label for document Troubleshooting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Feedback": {
|
||||
"message": "Retour d'Information",
|
||||
"description": "The label for document Feedback in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.For OpenHands Developers": {
|
||||
"message": "Pour les Développeurs OpenHands",
|
||||
"description": "The label for category For OpenHands Developers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.About": {
|
||||
"message": "À Propos",
|
||||
"description": "The label for document About in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Best Practices": {
|
||||
"message": "Meilleures Pratiques",
|
||||
"description": "The label for document Best Practices in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Microagents": {
|
||||
"message": "Micro-agents",
|
||||
"description": "The label for category Microagents in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Overview": {
|
||||
"message": "Aperçu",
|
||||
"description": "The label for document Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository": {
|
||||
"message": "Dépôt",
|
||||
"description": "The label for document Repository in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Public": {
|
||||
"message": "Public",
|
||||
"description": "The label for document Public in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository Customization": {
|
||||
"message": "Personnalisation du Dépôt",
|
||||
"description": "The label for document Repository Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.GUI Mode": {
|
||||
"message": "Mode GUI",
|
||||
"description": "The label for document GUI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.CLI Mode": {
|
||||
"message": "Mode CLI",
|
||||
"description": "The label for document CLI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Headless Mode": {
|
||||
"message": "Mode Sans Interface",
|
||||
"description": "The label for document Headless Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Github Action": {
|
||||
"message": "Action GitHub",
|
||||
"description": "The label for document Github Action in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Cloud": {
|
||||
"message": "Cloud",
|
||||
"description": "The label for category Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Openhands Cloud": {
|
||||
"message": "OpenHands Cloud",
|
||||
"description": "The label for document Openhands Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Cloud GitHub Resolver": {
|
||||
"message": "Résolveur GitHub Cloud",
|
||||
"description": "The label for document Cloud GitHub Resolver in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.LLM Configuration": {
|
||||
"message": "Configuration LLM",
|
||||
"description": "The label for category LLM Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Providers": {
|
||||
"message": "Fournisseurs",
|
||||
"description": "The label for category Providers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Azure": {
|
||||
"message": "Azure",
|
||||
"description": "The label for document Azure in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Google": {
|
||||
"message": "Google",
|
||||
"description": "The label for document Google in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Groq": {
|
||||
"message": "Groq",
|
||||
"description": "The label for document Groq in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.LiteLLM Proxy": {
|
||||
"message": "Proxy LiteLLM",
|
||||
"description": "The label for document LiteLLM Proxy in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenAI": {
|
||||
"message": "OpenAI",
|
||||
"description": "The label for document OpenAI in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenRouter": {
|
||||
"message": "OpenRouter",
|
||||
"description": "The label for document OpenRouter in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Runtime Configuration": {
|
||||
"message": "Configuration d'Exécution",
|
||||
"description": "The label for category Runtime Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Docker Runtime": {
|
||||
"message": "Environnement Docker",
|
||||
"description": "The label for document Docker Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Remote Runtime": {
|
||||
"message": "Environnement Distant",
|
||||
"description": "The label for document Remote Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Modal Runtime": {
|
||||
"message": "Environnement Modal",
|
||||
"description": "The label for document Modal Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Daytona Runtime": {
|
||||
"message": "Environnement Daytona",
|
||||
"description": "The label for document Daytona Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Local Runtime": {
|
||||
"message": "Environnement Local",
|
||||
"description": "The label for document Local Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Configuration Options": {
|
||||
"message": "Options de Configuration",
|
||||
"description": "The label for document Configuration Options in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Custom Sandbox": {
|
||||
"message": "Bac à Sable Personnalisé",
|
||||
"description": "The label for document Custom Sandbox in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Development Overview": {
|
||||
"message": "Aperçu du Développement",
|
||||
"description": "The label for document Development Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Backend": {
|
||||
"message": "Backend",
|
||||
"description": "The label for document Backend in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Runtime": {
|
||||
"message": "Environnement d'Exécution",
|
||||
"description": "The label for document Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Debugging": {
|
||||
"message": "Débogage",
|
||||
"description": "The label for document Debugging in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Evaluation": {
|
||||
"message": "Évaluation",
|
||||
"description": "The label for document Evaluation in sidebar docsSidebar"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
# Installation
|
||||
# Exécution d'OpenHands
|
||||
|
||||
## Configuration système requise
|
||||
|
||||
|
||||
427
docs/i18n/ja/code.json
Normal file
427
docs/i18n/ja/code.json
Normal file
@@ -0,0 +1,427 @@
|
||||
{
|
||||
"footer.title": {
|
||||
"message": "OpenHands"
|
||||
},
|
||||
"footer.docs": {
|
||||
"message": "ドキュメント"
|
||||
},
|
||||
"footer.community": {
|
||||
"message": "コミュニティ"
|
||||
},
|
||||
"footer.copyright": {
|
||||
"message": "© {year} OpenHands"
|
||||
},
|
||||
"faq.title": {
|
||||
"message": "よくある質問",
|
||||
"description": "FAQ Title"
|
||||
},
|
||||
"faq.description": {
|
||||
"message": "よくある質問"
|
||||
},
|
||||
"faq.section.title.1": {
|
||||
"message": "OpenHandsとは何ですか?",
|
||||
"description": "First Section Title"
|
||||
},
|
||||
"faq.section.highlight": {
|
||||
"message": "OpenHands",
|
||||
"description": "Highlight Text"
|
||||
},
|
||||
"faq.section.description.1": {
|
||||
"message": "はソフトウェアエンジニアリングとウェブナビゲーションのタスクをいつでも解決できる自律型ソフトウェアエンジニアです。「過去数ヶ月間のOpenHandsリポジトリへのプルリクエスト数を調べる」などのデータサイエンスクエリや、「このファイルにテストを追加して、すべてのテストが通るか確認してください。通らない場合は、ファイルを修正してください」などのソフトウェアエンジニアリングタスクを実行できます。",
|
||||
"description": "Description for OpenHands"
|
||||
},
|
||||
"faq.section.description.2": {
|
||||
"message": "さらに、OpenHandsは新しいエージェントをテストおよび評価したいエージェント開発者向けのプラットフォームとコミュニティでもあります。",
|
||||
"description": "Further Description for OpenHands"
|
||||
},
|
||||
"faq.section.title.2": {
|
||||
"message": "サポート",
|
||||
"description": "Support Section Title"
|
||||
},
|
||||
"faq.section.support.answer": {
|
||||
"message": "他のユーザーも同様に発生する可能性のある問題が発生した場合は、{githubLink}で報告してください。インストールに関する問題や一般的な質問がある場合は、{discordLink}または{slackLink}にご参加ください。",
|
||||
"description": "Support Answer"
|
||||
},
|
||||
"faq.section.title.3": {
|
||||
"message": "OpenHandsでGitHubの問題を解決するには?",
|
||||
"description": "GitHub Issue Section Title"
|
||||
},
|
||||
"faq.section.github.steps.intro": {
|
||||
"message": "OpenHandsを使用してGitHubの問題を解決するには、以下のようなステップを実行するようOpenHandsにコマンドを送信します:",
|
||||
"description": "GitHub Steps Introduction"
|
||||
},
|
||||
"faq.section.github.step1": {
|
||||
"message": "イシュー https://github.com/All-Hands-AI/OpenHands/issues/1611 を読む",
|
||||
"description": "GitHub Step 1"
|
||||
},
|
||||
"faq.section.github.step2": {
|
||||
"message": "リポジトリをクローンして新しいブランチをチェックアウトする",
|
||||
"description": "GitHub Step 2"
|
||||
},
|
||||
"faq.section.github.step3": {
|
||||
"message": "イシューの説明に基づいて、問題を解決するためにファイルを修正する",
|
||||
"description": "GitHub Step 3"
|
||||
},
|
||||
"faq.section.github.step4": {
|
||||
"message": "GITHUB_TOKEN環境変数を使用して結果をGitHubにプッシュする",
|
||||
"description": "GitHub Step 4"
|
||||
},
|
||||
"faq.section.github.step5": {
|
||||
"message": "プルリクエストを送信するために使用するリンクを教えてください",
|
||||
"description": "GitHub Step 5"
|
||||
},
|
||||
"faq.section.github.steps.preRun": {
|
||||
"message": "OpenHandsを起動する前に、以下を実行できます:",
|
||||
"description": "GitHub Steps Pre-Run"
|
||||
},
|
||||
"faq.section.github.steps.tokenInfo": {
|
||||
"message": "ここでXXXはあなたが作成したGitHubトークンで、OpenHandsリポジトリにプッシュする権限を持っています。OpenHandsリポジトリの変更権限がない場合は、次のように変更する必要があるかもしれません:",
|
||||
"description": "GitHub Steps Token Info"
|
||||
},
|
||||
"faq.section.github.steps.usernameInfo": {
|
||||
"message": "ここでUSERNAMEはあなたのGitHubユーザー名です。",
|
||||
"description": "GitHub Steps Username Info"
|
||||
},
|
||||
"faq.section.title.4": {
|
||||
"message": "OpenHandsはDevinとどう違いますか?",
|
||||
"description": "Devin Section Title"
|
||||
},
|
||||
"faq.section.openhands.linkText": {
|
||||
"message": "Devin",
|
||||
"description": "Devin Link Text"
|
||||
},
|
||||
"faq.section.openhands.description": {
|
||||
"message": "はCognition Inc.の商用製品で、OpenHandsの最初のインスピレーションとなりました。どちらもソフトウェアエンジニアリングの仕事をうまくこなすことを目指していますが、OpenHandsはダウンロード、使用、修正が可能である一方、DevinはCognitionのサイトを通じてのみ使用できます。さらに、OpenHandsは最初のインスピレーションを超えて進化し、現在はエージェント開発全般のためのコミュニティエコシステムとなっており、あなたの参加と",
|
||||
"description": "Devin Description"
|
||||
},
|
||||
"faq.section.openhands.contribute": {
|
||||
"message": "貢献",
|
||||
"description": "Contribute Link"
|
||||
},
|
||||
"faq.section.title.5": {
|
||||
"message": "OpenHandsはChatGPTとどう違いますか?",
|
||||
"description": "ChatGPT Section Title"
|
||||
},
|
||||
"faq.section.chatgpt.description": {
|
||||
"message": "ChatGPTはオンラインでアクセスでき、ローカルファイルに接続せず、コード実行能力も限られています。コードを書くことはできますが、テストや実行が難しいです。",
|
||||
"description": "ChatGPT Description"
|
||||
},
|
||||
"homepage.description": {
|
||||
"message": "ソフトウェアエンジニアリングのためのAIコード生成。",
|
||||
"description": "The homepage description"
|
||||
},
|
||||
"homepage.getStarted": {
|
||||
"message": "はじめる"
|
||||
},
|
||||
"welcome.message": {
|
||||
"message": "OpenHandsへようこそ。複雑なエンジニアリングタスクを実行し、ソフトウェア開発プロジェクトでユーザーと積極的に協力できる自律型AIソフトウェアエンジニアシステムです。"
|
||||
},
|
||||
"theme.ErrorPageContent.title": {
|
||||
"message": "このページはクラッシュしました。",
|
||||
"description": "The title of the fallback page when the page crashed"
|
||||
},
|
||||
"theme.BackToTopButton.buttonAriaLabel": {
|
||||
"message": "ページの先頭に戻る",
|
||||
"description": "The ARIA label for the back to top button"
|
||||
},
|
||||
"theme.blog.archive.title": {
|
||||
"message": "アーカイブ",
|
||||
"description": "The page & hero title of the blog archive page"
|
||||
},
|
||||
"theme.blog.archive.description": {
|
||||
"message": "アーカイブ",
|
||||
"description": "The page & hero description of the blog archive page"
|
||||
},
|
||||
"theme.blog.paginator.navAriaLabel": {
|
||||
"message": "ブログ記事リストのページネーション",
|
||||
"description": "The ARIA label for the blog pagination"
|
||||
},
|
||||
"theme.blog.paginator.newerEntries": {
|
||||
"message": "新しい記事",
|
||||
"description": "The label used to navigate to the newer blog posts page (previous page)"
|
||||
},
|
||||
"theme.blog.paginator.olderEntries": {
|
||||
"message": "古い記事",
|
||||
"description": "The label used to navigate to the older blog posts page (next page)"
|
||||
},
|
||||
"theme.blog.post.paginator.navAriaLabel": {
|
||||
"message": "ブログ記事のページネーション",
|
||||
"description": "The ARIA label for the blog posts pagination"
|
||||
},
|
||||
"theme.blog.post.paginator.newerPost": {
|
||||
"message": "新しい記事",
|
||||
"description": "The blog post button label to navigate to the newer/previous post"
|
||||
},
|
||||
"theme.blog.post.paginator.olderPost": {
|
||||
"message": "古い記事",
|
||||
"description": "The blog post button label to navigate to the older/next post"
|
||||
},
|
||||
"theme.blog.post.plurals": {
|
||||
"message": "1記事|{count}記事",
|
||||
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.blog.tagTitle": {
|
||||
"message": "「{tagName}」のタグが付いた{nPosts}",
|
||||
"description": "The title of the page for a blog tag"
|
||||
},
|
||||
"theme.tags.tagsPageLink": {
|
||||
"message": "すべてのタグを表示",
|
||||
"description": "The label of the link targeting the tag list page"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel": {
|
||||
"message": "ダークモードとライトモードを切り替える(現在は{mode})",
|
||||
"description": "The ARIA label for the navbar color mode toggle"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel.mode.dark": {
|
||||
"message": "ダークモード",
|
||||
"description": "The name for the dark color mode"
|
||||
},
|
||||
"theme.colorToggle.ariaLabel.mode.light": {
|
||||
"message": "ライトモード",
|
||||
"description": "The name for the light color mode"
|
||||
},
|
||||
"theme.docs.breadcrumbs.navAriaLabel": {
|
||||
"message": "パンくずリストナビゲーション",
|
||||
"description": "The ARIA label for the breadcrumbs"
|
||||
},
|
||||
"theme.docs.DocCard.categoryDescription.plurals": {
|
||||
"message": "1項目|{count}項目",
|
||||
"description": "The default description for a category card in the generated index about how many items this category includes"
|
||||
},
|
||||
"theme.docs.paginator.navAriaLabel": {
|
||||
"message": "ドキュメントページ",
|
||||
"description": "The ARIA label for the docs pagination"
|
||||
},
|
||||
"theme.docs.paginator.previous": {
|
||||
"message": "前へ",
|
||||
"description": "The label used to navigate to the previous doc"
|
||||
},
|
||||
"theme.docs.paginator.next": {
|
||||
"message": "次へ",
|
||||
"description": "The label used to navigate to the next doc"
|
||||
},
|
||||
"theme.docs.tagDocListPageTitle.nDocsTagged": {
|
||||
"message": "1つのドキュメントにタグ付け|{count}のドキュメントにタグ付け",
|
||||
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.docs.tagDocListPageTitle": {
|
||||
"message": "\"{tagName}\"で{nDocsTagged}",
|
||||
"description": "The title of the page for a docs tag"
|
||||
},
|
||||
"theme.docs.versionBadge.label": {
|
||||
"message": "バージョン: {versionLabel}"
|
||||
},
|
||||
"theme.docs.versions.unreleasedVersionLabel": {
|
||||
"message": "これは{siteTitle}の次期バージョン{versionLabel}のドキュメントです。",
|
||||
"description": "The label used to tell the user that he's browsing an unreleased doc version"
|
||||
},
|
||||
"theme.docs.versions.unmaintainedVersionLabel": {
|
||||
"message": "これは{siteTitle} {versionLabel}のドキュメントで、現在はアクティブにメンテナンスされていません。",
|
||||
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
|
||||
},
|
||||
"theme.docs.versions.latestVersionSuggestionLabel": {
|
||||
"message": "最新のドキュメントについては、{latestVersionLink}({versionLabel})をご覧ください。",
|
||||
"description": "The label used to tell the user to check the latest version"
|
||||
},
|
||||
"theme.docs.versions.latestVersionLinkLabel": {
|
||||
"message": "最新バージョン",
|
||||
"description": "The label used for the latest version suggestion link label"
|
||||
},
|
||||
"theme.common.editThisPage": {
|
||||
"message": "このページを編集",
|
||||
"description": "The link label to edit the current page"
|
||||
},
|
||||
"theme.common.headingLinkTitle": {
|
||||
"message": "{heading}への直接リンク",
|
||||
"description": "Title for link to heading"
|
||||
},
|
||||
"theme.lastUpdated.atDate": {
|
||||
"message": " {date}に",
|
||||
"description": "The words used to describe on which date a page has been last updated"
|
||||
},
|
||||
"theme.lastUpdated.byUser": {
|
||||
"message": " {user}によって",
|
||||
"description": "The words used to describe by who the page has been last updated"
|
||||
},
|
||||
"theme.lastUpdated.lastUpdatedAtBy": {
|
||||
"message": "最終更新{atDate}{byUser}",
|
||||
"description": "The sentence used to display when a page has been last updated, and by who"
|
||||
},
|
||||
"theme.navbar.mobileVersionsDropdown.label": {
|
||||
"message": "バージョン",
|
||||
"description": "The label for the navbar versions dropdown on mobile view"
|
||||
},
|
||||
"theme.NotFound.title": {
|
||||
"message": "ページが見つかりません",
|
||||
"description": "The title of the 404 page"
|
||||
},
|
||||
"theme.tags.tagsListLabel": {
|
||||
"message": "タグ:",
|
||||
"description": "The label alongside a tag list"
|
||||
},
|
||||
"theme.admonition.caution": {
|
||||
"message": "注意",
|
||||
"description": "The default label used for the Caution admonition (:::caution)"
|
||||
},
|
||||
"theme.admonition.danger": {
|
||||
"message": "危険",
|
||||
"description": "The default label used for the Danger admonition (:::danger)"
|
||||
},
|
||||
"theme.admonition.info": {
|
||||
"message": "情報",
|
||||
"description": "The default label used for the Info admonition (:::info)"
|
||||
},
|
||||
"theme.admonition.note": {
|
||||
"message": "メモ",
|
||||
"description": "The default label used for the Note admonition (:::note)"
|
||||
},
|
||||
"theme.admonition.tip": {
|
||||
"message": "ヒント",
|
||||
"description": "The default label used for the Tip admonition (:::tip)"
|
||||
},
|
||||
"theme.admonition.warning": {
|
||||
"message": "警告",
|
||||
"description": "The default label used for the Warning admonition (:::warning)"
|
||||
},
|
||||
"theme.AnnouncementBar.closeButtonAriaLabel": {
|
||||
"message": "閉じる",
|
||||
"description": "The ARIA label for close button of announcement bar"
|
||||
},
|
||||
"theme.blog.sidebar.navAriaLabel": {
|
||||
"message": "最近のブログ記事ナビゲーション",
|
||||
"description": "The ARIA label for recent posts in the blog sidebar"
|
||||
},
|
||||
"theme.CodeBlock.copied": {
|
||||
"message": "コピーしました",
|
||||
"description": "The copied button label on code blocks"
|
||||
},
|
||||
"theme.CodeBlock.copyButtonAriaLabel": {
|
||||
"message": "コードをコピー",
|
||||
"description": "The ARIA label for copy code blocks button"
|
||||
},
|
||||
"theme.CodeBlock.copy": {
|
||||
"message": "コピー",
|
||||
"description": "The copy button label on code blocks"
|
||||
},
|
||||
"theme.CodeBlock.wordWrapToggle": {
|
||||
"message": "折り返し表示の切り替え",
|
||||
"description": "The title attribute for toggle word wrapping button of code block lines"
|
||||
},
|
||||
"theme.DocSidebarItem.expandCategoryAriaLabel": {
|
||||
"message": "サイドバーカテゴリ「{label}」を展開",
|
||||
"description": "The ARIA label to expand the sidebar category"
|
||||
},
|
||||
"theme.DocSidebarItem.collapseCategoryAriaLabel": {
|
||||
"message": "サイドバーカテゴリ「{label}」を折りたたむ",
|
||||
"description": "The ARIA label to collapse the sidebar category"
|
||||
},
|
||||
"theme.NavBar.navAriaLabel": {
|
||||
"message": "メイン",
|
||||
"description": "The ARIA label for the main navigation"
|
||||
},
|
||||
"theme.navbar.mobileLanguageDropdown.label": {
|
||||
"message": "言語",
|
||||
"description": "The label for the mobile language switcher dropdown"
|
||||
},
|
||||
"theme.NotFound.p1": {
|
||||
"message": "お探しのものが見つかりませんでした。",
|
||||
"description": "The first paragraph of the 404 page"
|
||||
},
|
||||
"theme.NotFound.p2": {
|
||||
"message": "元のURLにリンクしたサイトの所有者に連絡して、リンクが切れていることを知らせてください。",
|
||||
"description": "The 2nd paragraph of the 404 page"
|
||||
},
|
||||
"theme.TOCCollapsible.toggleButtonLabel": {
|
||||
"message": "このページの内容",
|
||||
"description": "The label used by the button on the collapsible TOC component"
|
||||
},
|
||||
"theme.blog.post.readMore": {
|
||||
"message": "もっと読む",
|
||||
"description": "The label used in blog post item excerpts to link to full blog posts"
|
||||
},
|
||||
"theme.blog.post.readMoreLabel": {
|
||||
"message": "{title}についてもっと読む",
|
||||
"description": "The ARIA label for the link to full blog posts from excerpts"
|
||||
},
|
||||
"theme.blog.post.readingTime.plurals": {
|
||||
"message": "1分で読めます|{readingTime}分で読めます",
|
||||
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
|
||||
},
|
||||
"theme.docs.breadcrumbs.home": {
|
||||
"message": "ホームページ",
|
||||
"description": "The ARIA label for the home page in the breadcrumbs"
|
||||
},
|
||||
"theme.docs.sidebar.collapseButtonTitle": {
|
||||
"message": "サイドバーを折りたたむ",
|
||||
"description": "The title attribute for collapse button of doc sidebar"
|
||||
},
|
||||
"theme.docs.sidebar.collapseButtonAriaLabel": {
|
||||
"message": "サイドバーを折りたたむ",
|
||||
"description": "The title attribute for collapse button of doc sidebar"
|
||||
},
|
||||
"theme.docs.sidebar.navAriaLabel": {
|
||||
"message": "ドキュメントサイドバーナビゲーション",
|
||||
"description": "The ARIA label for the sidebar navigation"
|
||||
},
|
||||
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
|
||||
"message": "ナビゲーションバーを閉じる",
|
||||
"description": "The ARIA label for close button of mobile sidebar"
|
||||
},
|
||||
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
|
||||
"message": "← メインメニューに戻る",
|
||||
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
|
||||
},
|
||||
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
|
||||
"message": "ナビゲーションバーの開閉",
|
||||
"description": "The ARIA label for hamburger menu button of mobile navigation"
|
||||
},
|
||||
"theme.docs.sidebar.expandButtonTitle": {
|
||||
"message": "サイドバーを展開",
|
||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||
},
|
||||
"theme.docs.sidebar.expandButtonAriaLabel": {
|
||||
"message": "サイドバーを展開",
|
||||
"description": "The ARIA label and title attribute for expand button of doc sidebar"
|
||||
},
|
||||
"theme.ErrorPageContent.tryAgain": {
|
||||
"message": "再試行",
|
||||
"description": "The label of the button to try again rendering when the React error boundary captures an error"
|
||||
},
|
||||
"theme.common.skipToMainContent": {
|
||||
"message": "メインコンテンツに直接移動",
|
||||
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
|
||||
},
|
||||
"theme.tags.tagsPageTitle": {
|
||||
"message": "タグ",
|
||||
"description": "The title of the tag list page"
|
||||
},
|
||||
"theme.unlistedContent.title": {
|
||||
"message": "非公開ページ",
|
||||
"description": "The unlisted content banner title"
|
||||
},
|
||||
"theme.unlistedContent.message": {
|
||||
"message": "このページは非公開です。検索エンジンにインデックスされず、直接リンクを持つユーザーのみがアクセスできます。",
|
||||
"description": "The unlisted content banner message"
|
||||
},
|
||||
"Use AI to tackle the toil in your backlog. Our agents have all the same tools as a human developer: they can modify code, run commands, browse the web, call APIs, and yes-even copy code snippets from StackOverflow.": {
|
||||
"message": "AIを使用してバックログの作業を効率化しましょう。私たちのエージェントは人間の開発者と同じツールを持っています:コードの修正、コマンドの実行、ウェブの閲覧、APIの呼び出し、そしてStackOverflowからのコードスニペットのコピーさえも可能です。"
|
||||
},
|
||||
"Get started with OpenHands.": {
|
||||
"message": "OpenHandsを始める"
|
||||
},
|
||||
"Most Popular Links": {
|
||||
"message": "人気のリンク"
|
||||
},
|
||||
"Customizing OpenHands to a repository": {
|
||||
"message": "リポジトリ向けにOpenHandsをカスタマイズする"
|
||||
},
|
||||
"Integrating OpenHands with Github": {
|
||||
"message": "OpenHandsをGithubと統合する"
|
||||
},
|
||||
"Recommended models to use": {
|
||||
"message": "推奨モデル"
|
||||
},
|
||||
"Connecting OpenHands to your filesystem": {
|
||||
"message": "OpenHandsをファイルシステムに接続する"
|
||||
}
|
||||
}
|
||||
14
docs/i18n/ja/docusaurus-plugin-content-blog/options.json
Normal file
14
docs/i18n/ja/docusaurus-plugin-content-blog/options.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"title": {
|
||||
"message": "ブログ",
|
||||
"description": "The title for the blog used in SEO"
|
||||
},
|
||||
"description": {
|
||||
"message": "OpenHands ブログ",
|
||||
"description": "The description for the blog used in SEO"
|
||||
},
|
||||
"sidebar.title": {
|
||||
"message": "最近の投稿",
|
||||
"description": "The label for the left sidebar"
|
||||
}
|
||||
}
|
||||
210
docs/i18n/ja/docusaurus-plugin-content-docs/current.json
Normal file
210
docs/i18n/ja/docusaurus-plugin-content-docs/current.json
Normal file
@@ -0,0 +1,210 @@
|
||||
{
|
||||
"version.label": {
|
||||
"message": "次のバージョン",
|
||||
"description": "The label for version current"
|
||||
},
|
||||
"sidebar.docsSidebar.category.🤖 Backends LLM": {
|
||||
"message": "🤖 LLMバックエンド",
|
||||
"description": "The label for category 🤖 Backends LLM in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.🚧 Dépannage": {
|
||||
"message": "🚧 トラブルシューティング",
|
||||
"description": "The label for category 🚧 Dépannage in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.apiSidebar.category.Backend": {
|
||||
"message": "バックエンド",
|
||||
"description": "The label for category Backend in sidebar apiSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.User Guides": {
|
||||
"message": "ユーザーガイド",
|
||||
"description": "The label for category User Guides in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Running OpenHands": {
|
||||
"message": "OpenHandsの実行",
|
||||
"description": "The label for category Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Prompting": {
|
||||
"message": "プロンプト",
|
||||
"description": "The label for category Prompting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Architecture": {
|
||||
"message": "アーキテクチャ",
|
||||
"description": "The label for category Architecture in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Running OpenHands": {
|
||||
"message": "OpenHandsの実行",
|
||||
"description": "The label for document Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Getting Started": {
|
||||
"message": "はじめに",
|
||||
"description": "The label for document Getting Started in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Key Features": {
|
||||
"message": "主な機能",
|
||||
"description": "The label for document Key Features in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Customization": {
|
||||
"message": "カスタマイズ",
|
||||
"description": "The label for category Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Usage Methods": {
|
||||
"message": "使用方法",
|
||||
"description": "The label for category Usage Methods in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Advanced Configuration": {
|
||||
"message": "高度な設定",
|
||||
"description": "The label for category Advanced Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Troubleshooting": {
|
||||
"message": "トラブルシューティング",
|
||||
"description": "The label for document Troubleshooting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Feedback": {
|
||||
"message": "フィードバック",
|
||||
"description": "The label for document Feedback in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.For OpenHands Developers": {
|
||||
"message": "OpenHands開発者向け",
|
||||
"description": "The label for category For OpenHands Developers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.About": {
|
||||
"message": "概要",
|
||||
"description": "The label for document About in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Best Practices": {
|
||||
"message": "ベストプラクティス",
|
||||
"description": "The label for document Best Practices in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Microagents": {
|
||||
"message": "マイクロエージェント",
|
||||
"description": "The label for category Microagents in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Overview": {
|
||||
"message": "概要",
|
||||
"description": "The label for document Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository": {
|
||||
"message": "リポジトリ",
|
||||
"description": "The label for document Repository in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Public": {
|
||||
"message": "パブリック",
|
||||
"description": "The label for document Public in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository Customization": {
|
||||
"message": "リポジトリのカスタマイズ",
|
||||
"description": "The label for document Repository Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.GUI Mode": {
|
||||
"message": "GUIモード",
|
||||
"description": "The label for document GUI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.CLI Mode": {
|
||||
"message": "CLIモード",
|
||||
"description": "The label for document CLI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Headless Mode": {
|
||||
"message": "ヘッドレスモード",
|
||||
"description": "The label for document Headless Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Github Action": {
|
||||
"message": "GitHub アクション",
|
||||
"description": "The label for document Github Action in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Cloud": {
|
||||
"message": "クラウド",
|
||||
"description": "The label for category Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Openhands Cloud": {
|
||||
"message": "OpenHands クラウド",
|
||||
"description": "The label for document Openhands Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Cloud GitHub Resolver": {
|
||||
"message": "クラウド GitHub リゾルバー",
|
||||
"description": "The label for document Cloud GitHub Resolver in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.LLM Configuration": {
|
||||
"message": "LLM 設定",
|
||||
"description": "The label for category LLM Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Providers": {
|
||||
"message": "プロバイダー",
|
||||
"description": "The label for category Providers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Azure": {
|
||||
"message": "Azure",
|
||||
"description": "The label for document Azure in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Google": {
|
||||
"message": "Google",
|
||||
"description": "The label for document Google in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Groq": {
|
||||
"message": "Groq",
|
||||
"description": "The label for document Groq in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.LiteLLM Proxy": {
|
||||
"message": "LiteLLM プロキシ",
|
||||
"description": "The label for document LiteLLM Proxy in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenAI": {
|
||||
"message": "OpenAI",
|
||||
"description": "The label for document OpenAI in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenRouter": {
|
||||
"message": "OpenRouter",
|
||||
"description": "The label for document OpenRouter in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Runtime Configuration": {
|
||||
"message": "ランタイム設定",
|
||||
"description": "The label for category Runtime Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Docker Runtime": {
|
||||
"message": "Docker ランタイム",
|
||||
"description": "The label for document Docker Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Remote Runtime": {
|
||||
"message": "リモートランタイム",
|
||||
"description": "The label for document Remote Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Modal Runtime": {
|
||||
"message": "Modal ランタイム",
|
||||
"description": "The label for document Modal Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Daytona Runtime": {
|
||||
"message": "Daytona ランタイム",
|
||||
"description": "The label for document Daytona Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Local Runtime": {
|
||||
"message": "ローカルランタイム",
|
||||
"description": "The label for document Local Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Configuration Options": {
|
||||
"message": "設定オプション",
|
||||
"description": "The label for document Configuration Options in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Custom Sandbox": {
|
||||
"message": "カスタムサンドボックス",
|
||||
"description": "The label for document Custom Sandbox in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Development Overview": {
|
||||
"message": "開発概要",
|
||||
"description": "The label for document Development Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Backend": {
|
||||
"message": "バックエンド",
|
||||
"description": "The label for document Backend in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Runtime": {
|
||||
"message": "ランタイム",
|
||||
"description": "The label for document Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Debugging": {
|
||||
"message": "デバッグ",
|
||||
"description": "The label for document Debugging in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Evaluation": {
|
||||
"message": "評価",
|
||||
"description": "The label for document Evaluation in sidebar docsSidebar"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
# Python API
|
||||
|
||||
OpenHandsは、Pythonコードから直接使用できる豊富なAPIを提供しています。以下は、主要なAPIの概要です。
|
||||
|
||||
## OpenHands クライアント
|
||||
|
||||
```python
|
||||
from openhands import OpenHandsClient
|
||||
|
||||
# クライアントの初期化
|
||||
client = OpenHandsClient(
|
||||
api_key="your-api-key", # OpenAI APIキーなど
|
||||
model="gpt-4", # 使用するLLMモデル
|
||||
workspace="/path/to/workspace" # 作業ディレクトリ
|
||||
)
|
||||
|
||||
# タスクの実行
|
||||
result = client.execute_task("新しいPythonファイルを作成してください")
|
||||
|
||||
# 結果の取得
|
||||
print(result.success) # タスクが成功したかどうか
|
||||
print(result.output) # タスクの出力
|
||||
print(result.error) # エラーメッセージ(存在する場合)
|
||||
```
|
||||
|
||||
## サンドボックス設定
|
||||
|
||||
```python
|
||||
from openhands import SandboxConfig
|
||||
|
||||
# サンドボックス設定のカスタマイズ
|
||||
config = SandboxConfig(
|
||||
allowed_commands=["git", "python"], # 許可するコマンド
|
||||
timeout=300, # タイムアウト(秒)
|
||||
max_memory="2g", # メモリ制限
|
||||
network_access=True # ネットワークアクセスの許可
|
||||
)
|
||||
|
||||
# 設定を使用してクライアントを初期化
|
||||
client = OpenHandsClient(
|
||||
api_key="your-api-key",
|
||||
model="gpt-4",
|
||||
workspace="/path/to/workspace",
|
||||
sandbox_config=config
|
||||
)
|
||||
```
|
||||
|
||||
## イベントハンドリング
|
||||
|
||||
```python
|
||||
from openhands import OpenHandsClient
|
||||
|
||||
def on_progress(event):
|
||||
print(f"進捗: {event.message}")
|
||||
|
||||
def on_error(event):
|
||||
print(f"エラー: {event.error}")
|
||||
|
||||
# イベントハンドラーを設定してクライアントを初期化
|
||||
client = OpenHandsClient(
|
||||
api_key="your-api-key",
|
||||
model="gpt-4",
|
||||
workspace="/path/to/workspace",
|
||||
on_progress=on_progress,
|
||||
on_error=on_error
|
||||
)
|
||||
```
|
||||
|
||||
## 非同期API
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from openhands import AsyncOpenHandsClient
|
||||
|
||||
async def main():
|
||||
# 非同期クライアントの初期化
|
||||
client = AsyncOpenHandsClient(
|
||||
api_key="your-api-key",
|
||||
model="gpt-4",
|
||||
workspace="/path/to/workspace"
|
||||
)
|
||||
|
||||
# タスクの非同期実行
|
||||
result = await client.execute_task("新しいPythonファイルを作成してください")
|
||||
print(result.output)
|
||||
|
||||
# 非同期メインの実行
|
||||
asyncio.run(main())
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"items": ["python/python"],
|
||||
"label": "バックエンド",
|
||||
"type": "categorie"
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# OpenHands について
|
||||
|
||||
## 研究戦略
|
||||
|
||||
LLM を使用して本番レベルのアプリケーションを完全に複製することは複雑な endeavor です。私たちの戦略は以下の通りです:
|
||||
|
||||
- **コア技術研究:** コード生成と処理の技術的側面を理解し改善するための基礎研究に注力します。
|
||||
- **タスク計画:** バグ検出、コードベース管理、最適化の機能を開発します。
|
||||
- **評価:** 私たちのエージェントをより良く理解し改善するための包括的な評価指標を確立します。
|
||||
|
||||
## デフォルトエージェント
|
||||
|
||||
現在のデフォルトエージェントは、コードの生成とファイル処理が可能な [CodeActAgent](agents) です。
|
||||
|
||||
## 構築技術
|
||||
|
||||
OpenHands は、強力なフレームワークとライブラリを組み合わせて構築されており、開発のための堅牢な基盤を提供しています。
|
||||
プロジェクトで使用されている主要な技術は以下の通りです:
|
||||
|
||||
       
|
||||
|
||||
これらの技術の選択は進行中であり、プロジェクトの進化に伴って新しい技術が追加されたり、既存の技術が削除されたりする可能性があることに注意してください。
|
||||
私たちは OpenHands の機能を強化するために、最も適切で効率的なツールを採用するよう努めています。
|
||||
|
||||
## ライセンス
|
||||
|
||||
MIT [ライセンス](https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE) の下で配布されています。
|
||||
@@ -0,0 +1,23 @@
|
||||
# 🧠 メインエージェントと機能
|
||||
|
||||
## CodeActAgent
|
||||
|
||||
### 説明
|
||||
|
||||
このエージェントは、CodeActのアイデア ([論文](https://arxiv.org/abs/2402.01030), [ツイート](https://twitter.com/xingyaow_/status/1754556835703751087)) を実装しており、LLMエージェントの**行動**を、_シンプルさ_と_パフォーマンス_の両方のために、統一された**コード**行動空間に統合します。
|
||||
|
||||
概念的なアイデアは以下の図に示されています。各ターンで、エージェントは以下のことができます。
|
||||
|
||||
1. **会話**: 明確化、確認などのために、自然言語で人間とコミュニケーションをとる。
|
||||
2. **CodeAct**: コードを実行してタスクを実行することを選択する
|
||||
|
||||
- 任意の有効なLinux `bash`コマンドを実行する
|
||||
- [対話型Pythonインタープリター](https://ipython.org/)で任意の有効な`Python`コードを実行する。これは`bash`コマンドを通してシミュレートされます。詳細はプラグインシステムを参照してください。
|
||||
|
||||

|
||||
|
||||
### デモ
|
||||
|
||||
https://github.com/All-Hands-AI/OpenHands/assets/38853559/f592a192-e86c-4f48-ad31-d69282d5f6ac
|
||||
|
||||
_データサイエンスタスク(線形回帰)を実行する`gpt-4-turbo-2024-04-09`を使用したCodeActAgentの例_。
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# 🏛️ システムアーキテクチャの概要
|
||||
|
||||
以下は、システムアーキテクチャの高レベルな概要です。システムは主に2つのコンポーネントに分かれています: フロントエンドとバックエンドです。フロントエンドはユーザーとのインタラクションの管理と結果の表示を担当します。バックエンドはビジネスロジックの管理とエージェントの実行を担当します。
|
||||
|
||||

|
||||
|
||||
この概要は、主要なコンポーネントとそれらの相互作用を示すために簡略化されています。バックエンドアーキテクチャのより詳細なビューについては、[バックエンドアーキテクチャ](#backend-architecture-ja)のセクションを参照してください。
|
||||
|
||||
# バックエンドアーキテクチャ {#backend-architecture-ja}
|
||||
|
||||
_**注意**: バックエンドアーキテクチャは開発中であり、変更される可能性があります。以下の図は、図のフッターに示されているコミットに基づく現在のバックエンドアーキテクチャを示しています。_
|
||||
|
||||

|
||||
|
||||
<details>
|
||||
<summary>この図の更新</summary>
|
||||
<div>
|
||||
バックエンドアーキテクチャ図の生成は部分的に自動化されています。
|
||||
図はpy2pumlツールを使用してコード内の型アノテーションから生成されます。
|
||||
その後、図は手動でレビューされ、調整され、PNGとSVGにエクスポートされます。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- openhandsが実行可能なPython環境
|
||||
(リポジトリのルートにあるREADME.mdファイルの指示に従って)
|
||||
- [py2puml](https://github.com/lucsorel/py2puml)がインストールされていること
|
||||
|
||||
## 手順
|
||||
|
||||
1. リポジトリのルートから以下のコマンドを実行して、図を自動的に生成します:
|
||||
`py2puml openhands openhands > docs/architecture/backend_architecture.puml`
|
||||
|
||||
2. 生成されたファイルをPlantUMLエディタ(Visual Studio CodeのPlantUML拡張機能や[PlantText](https://www.planttext.com/)など)で開きます。
|
||||
|
||||
3. 生成されたPUMLを確認し、図に必要な変更を加えます(欠落している部分を追加し、エラーを修正し、レイアウトを改善します)。
|
||||
_py2pumlはコード内の型アノテーションから図を作成するため、型アノテーションが欠落していたり正しくない場合、図が不完全または不正確になる可能性があります。_
|
||||
|
||||
4. 新しい図と以前の図の違いを確認し、変更が正しいかどうかを手動で確認します。
|
||||
_過去に図に手動で追加され、現在も関連性のある部分を削除しないように注意してください。_
|
||||
|
||||
5. 図の生成に使用されたコミットのハッシュを図のフッターに追加します。
|
||||
|
||||
6. 図をPNGファイルとSVGファイルにエクスポートし、`docs/architecture`ディレクトリ内の既存の図を置き換えます。これは(例えば[PlantText](https://www.planttext.com/)を使用して)行うことができます。
|
||||
|
||||
</div>
|
||||
</details>
|
||||
@@ -0,0 +1,53 @@
|
||||
# 🏛️ システムアーキテクチャ
|
||||
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<img src="https://github.com/All-Hands-AI/OpenHands/assets/16201837/97d747e3-29d8-4ccb-8d34-6ad1adb17f38" alt="OpenHands System Architecture Diagram Jul 4 2024" />
|
||||
<p><em>OpenHands システムアーキテクチャ図 (2024年7月4日)</em></p>
|
||||
</div>
|
||||
|
||||
これはシステムアーキテクチャの高レベルな概要です。システムはフロントエンドとバックエンドの2つの主要コンポーネントに分かれています。フロントエンドはユーザーインタラクションを処理し、結果を表示する役割を担います。バックエンドはビジネスロジックを処理し、エージェントを実行する役割を担います。
|
||||
|
||||
# フロントエンドアーキテクチャ {#frontend-architecture-ja}
|
||||
|
||||

|
||||
|
||||
この概要は、主要なコンポーネントとそれらの相互作用を示すために簡略化されています。バックエンドアーキテクチャのより詳細なビューについては、以下のバックエンドアーキテクチャのセクションを参照してください。
|
||||
|
||||
# バックエンドアーキテクチャ {#backend-architecture-ja}
|
||||
|
||||
_**免責事項**: バックエンドアーキテクチャは現在進行中の作業であり、変更される可能性があります。以下の図は、図のフッターに示されているコミットに基づくバックエンドの現在のアーキテクチャを示しています。_
|
||||
|
||||

|
||||
|
||||
<details>
|
||||
<summary>この図の更新</summary>
|
||||
<div>
|
||||
バックエンドアーキテクチャ図の生成は部分的に自動化されています。
|
||||
この図は、py2pumlツールを使用してコード内の型ヒントから生成されます。
|
||||
その後、図は手動でレビュー、調整され、PNGとSVGにエクスポートされます。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- openhandsが実行可能なPython環境
|
||||
(リポジトリのルートにあるREADME.mdファイルの指示に従って)
|
||||
- [py2puml](https://github.com/lucsorel/py2puml)がインストールされていること
|
||||
|
||||
## 手順
|
||||
|
||||
1. リポジトリのルートから以下のコマンドを実行して、図を自動生成します:
|
||||
`py2puml openhands openhands > docs/architecture/backend_architecture.puml`
|
||||
|
||||
2. 生成されたファイルをPlantUMLエディタで開きます。例えば、PlantUML拡張機能を使用したVisual Studio Codeや[PlantText](https://www.planttext.com/)など。
|
||||
|
||||
3. 生成されたPUMLをレビューし、図に必要な調整を行います(欠落部分の追加、ミスの修正、位置の改善など)。
|
||||
_py2pumlは、コード内の型ヒントに基づいて図を作成するため、型ヒントが欠落していたり正しくない場合、図が不完全または不正確になることがあります。_
|
||||
|
||||
4. 新旧の図の差分をレビューし、変更が正しいかどうかを手動で確認します。
|
||||
_過去に図に手動で追加され、現在も関連性のある部分を削除しないように注意してください。_
|
||||
|
||||
5. 図のフッターに、図の生成に使用されたコミットのコミットハッシュを追加します。
|
||||
|
||||
6. 図をPNGとSVGファイルとしてエクスポートし、`docs/architecture`ディレクトリ内の既存の図を置き換えます。これは(例えば[PlantText](https://www.planttext.com/))で行うことができます。
|
||||
|
||||
</div>
|
||||
</details>
|
||||
@@ -0,0 +1,129 @@
|
||||
以下に翻訳結果を示します。
|
||||
|
||||
# 📦 Dockerランタイム
|
||||
|
||||
OpenHands Dockerランタイムは、AIエージェントのアクションを安全かつ柔軟に実行できるようにするコアコンポーネントです。
|
||||
Dockerを使用してサンドボックス化された環境を作成し、ホストシステムを危険にさらすことなく任意のコードを安全に実行できます。
|
||||
|
||||
## サンドボックス化されたランタイムが必要な理由
|
||||
|
||||
OpenHandsでは、いくつかの理由から、信頼できないコードを安全で隔離された環境で実行する必要があります。
|
||||
|
||||
1. セキュリティ: 信頼できないコードを実行すると、ホストシステムに重大なリスクを及ぼす可能性があります。サンドボックス化された環境では、悪意のあるコードがホストシステムのリソースにアクセスしたり、変更したりすることを防ぐことができます。
|
||||
2. 一貫性: サンドボックス化された環境では、異なるマシンやセットアップ間でコードの実行が一貫していることが保証され、「自分のマシンでは動作する」という問題が解消されます。
|
||||
3. リソース制御: サンドボックス化により、リソースの割り当てと使用をより適切に制御でき、暴走プロセスがホストシステムに影響を与えることを防ぐことができます。
|
||||
4. 分離: 異なるプロジェクトやユーザーは、ホストシステムや他のプロジェクトに干渉することなく、分離された環境で作業できます。
|
||||
5. 再現性: サンドボックス化された環境では、実行環境が一貫しており制御可能であるため、バグや問題を再現しやすくなります。
|
||||
|
||||
## ランタイムの仕組み
|
||||
|
||||
OpenHandsランタイムシステムは、Dockerコンテナを使用してクライアント-サーバーアーキテクチャを実装しています。以下は、その仕組みの概要です。
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[ユーザー提供のカスタムDockerイメージ] --> B[OpenHandsバックエンド]
|
||||
B -->|ビルド| C[OHランタイムイメージ]
|
||||
C -->|起動| D[アクション実行サーバー]
|
||||
D -->|初期化| E[ブラウザ]
|
||||
D -->|初期化| F[Bashシェル]
|
||||
D -->|初期化| G[プラグイン]
|
||||
G -->|初期化| L[Jupyterサーバー]
|
||||
|
||||
B -->|生成| H[エージェント]
|
||||
B -->|生成| I[EventStream]
|
||||
I <--->|REST APIを介して
|
||||
アクションを実行し
|
||||
観測結果を取得
|
||||
| D
|
||||
|
||||
H -->|アクション生成| I
|
||||
I -->|観測結果取得| H
|
||||
|
||||
subgraph "Dockerコンテナ"
|
||||
D
|
||||
E
|
||||
F
|
||||
G
|
||||
L
|
||||
end
|
||||
```
|
||||
|
||||
1. ユーザー入力: ユーザーがカスタムベースDockerイメージを提供します。
|
||||
2. イメージのビルド: OpenHandsは、ユーザー提供のイメージをベースに新しいDockerイメージ(「OHランタイムイメージ」)をビルドします。この新しいイメージには、主に「ランタイムクライアント」であるOpenHands固有のコードが含まれます。
|
||||
3. コンテナの起動: OpenHandsが起動すると、OHランタイムイメージを使用してDockerコンテナが起動します。
|
||||
4. アクション実行サーバーの初期化: アクション実行サーバーは、コンテナ内で`ActionExecutor`を初期化し、Bashシェルなどの必要なコンポーネントをセットアップし、指定されたプラグインをロードします。
|
||||
5. 通信: OpenHandsバックエンド(`openhands/runtime/impl/eventstream/eventstream_runtime.py`)は、RESTful APIを介してアクション実行サーバーと通信し、アクションを送信し、観測結果を受信します。
|
||||
6. アクションの実行: ランタイムクライアントはバックエンドからアクションを受信し、サンドボックス化された環境内でそれらを実行し、観測結果を送り返します。
|
||||
7. 観測結果の返却: アクション実行サーバーは、実行結果を観測結果としてOpenHandsバックエンドに送り返します。
|
||||
|
||||
クライアントの役割:
|
||||
|
||||
- OpenHandsバックエンドとサンドボックス化された環境の間の仲介役を果たします。
|
||||
- コンテナ内で様々なタイプのアクション(シェルコマンド、ファイル操作、Pythonコードなど)を安全に実行します。
|
||||
- 現在の作業ディレクトリやロードされたプラグインなど、サンドボックス化された環境の状態を管理します。
|
||||
- 観測結果をフォーマットしてバックエンドに返し、結果を処理するための一貫したインターフェースを確保します。
|
||||
|
||||
## OpenHandsがOHランタイムイメージをビルドおよび管理する方法
|
||||
|
||||
OpenHandsのランタイムイメージのビルドと管理に対するアプローチは、本番環境と開発環境の両方でDockerイメージを効率的、一貫性のある、柔軟な方法で作成および維持することを保証します。
|
||||
|
||||
詳細に興味がある場合は、[関連コード](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/utils/runtime_build.py)をチェックしてください。
|
||||
|
||||
### イメージタグ付けシステム
|
||||
|
||||
OpenHandsは、再現性と柔軟性のバランスを取るために、ランタイムイメージに3つのタグシステムを使用しています。
|
||||
タグは以下の2つの形式のいずれかになります。
|
||||
|
||||
- **バージョン付きタグ**: `oh_v{openhands_version}_{base_image}` (例: `oh_v0.9.9_nikolaik_s_python-nodejs_t_python3.12-nodejs22`)
|
||||
- **ロックタグ**: `oh_v{openhands_version}_{16_digit_lock_hash}` (例: `oh_v0.9.9_1234567890abcdef`)
|
||||
- **ソースタグ**: `oh_v{openhands_version}_{16_digit_lock_hash}_{16_digit_source_hash}`
|
||||
(例: `oh_v0.9.9_1234567890abcdef_1234567890abcdef`)
|
||||
|
||||
#### ソースタグ - 最も具体的
|
||||
|
||||
これは、ソースディレクトリのディレクトリハッシュのMD5の最初の16桁です。これにより、openhandsソースのみのハッシュが得られます。
|
||||
|
||||
#### ロックタグ
|
||||
|
||||
このハッシュは、以下のMD5の最初の16桁から構築されます。
|
||||
|
||||
- イメージがビルドされたベースイメージの名前(例: `nikolaik/python-nodejs:python3.12-nodejs22`)
|
||||
- イメージに含まれる`pyproject.toml`の内容
|
||||
- イメージに含まれる`poetry.lock`の内容
|
||||
|
||||
これにより、ソースコードとは無関係に、Openhandsの依存関係のハッシュが効果的に得られます。
|
||||
|
||||
#### バージョン付きタグ - 最も一般的
|
||||
|
||||
このタグは、openhandsのバージョンとベースイメージ名(タグ標準に適合するように変換されたもの)を連結したものです。
|
||||
|
||||
#### ビルドプロセス
|
||||
|
||||
イメージを生成する際...
|
||||
|
||||
- **再ビルドなし**: OpenHandsは最初に、同じ**最も具体的なソースタグ**を持つイメージが存在するかどうかをチェックします。そのようなイメージが存在する場合、ビルドは実行されず、既存のイメージが使用されます。
|
||||
- **最速の再ビルド**: 次に、OpenHandsは**一般的なロックタグ**を持つイメージが存在するかどうかをチェックします。そのようなイメージが存在する場合、OpenHandsはそれに基づいて新しいイメージをビルドし、現在のソースコードをコピーする最終操作を除くすべてのインストール手順(`poetry install`や`apt-get`など)をバイパスします。新しいイメージには**ソース**タグのみが付けられます。
|
||||
- **まあまあの再ビルド**: **ソース**タグも**ロック**タグも存在しない場合、**バージョン付き**タグイメージに基づいてイメージがビルドされます。バージョン付きタグイメージでは、ほとんどの依存関係がすでにインストールされているため、時間を節約できます。
|
||||
- **最も遅い再ビルド**: 3つのタグのすべてが存在しない場合、ベースイメージに基づいて新しいイメージがビルドされます(これは遅い操作です)。この新しいイメージには、**ソース**、**ロック**、**バージョン付き**の各タグが付けられます。
|
||||
|
||||
このタグ付けアプローチにより、OpenHandsは開発環境と本番環境の両方を効率的に管理できます。
|
||||
|
||||
1. 同一のソースコードとDockerfileは、常に同じイメージを生成します(ハッシュベースのタグを介して)。
|
||||
2. 小さな変更が発生した場合、システムはイメージを迅速に再ビルドできます(最近の互換性のあるイメージを活用することで)。
|
||||
3. **ロック**タグ(例: `runtime:oh_v0.9.3_1234567890abcdef`)は、特定のベースイメージ、依存関係、およびOpenHandsバージョンの組み合わせに対する最新のビルドを常に指します。
|
||||
|
||||
## ランタイムプラグインシステム
|
||||
|
||||
OpenHandsランタイムは、機能を拡張し、ランタイム環境をカスタマイズできるプラグインシステムをサポートしています。プラグインは、ランタイムクライアントの起動時に初期化されます。
|
||||
|
||||
独自のプラグインを実装したい場合は、[Jupyterプラグインの例](https://github.com/All-Hands-AI/OpenHands/blob/ecf4aed28b0cf7c18d4d8ff554883ba182fc6bdd/openhands/runtime/plugins/jupyter/__init__.py#L21-L55)をチェックしてください。
|
||||
|
||||
*プラグインシステムの詳細はまだ作成中です - 貢献を歓迎します!*
|
||||
|
||||
プラグインシステムの主な側面:
|
||||
|
||||
1. プラグインの定義: プラグインは、基本の`Plugin`クラスを継承するPythonクラスとして定義されます。
|
||||
2. プラグインの登録: 利用可能なプラグインは、`ALL_PLUGINS`辞書に登録されます。
|
||||
3. プラグインの指定: プラグインは、`Agent.sandbox_plugins: list[PluginRequirement]`に関連付けられます。ユーザーは、ランタイムを初期化するときにロードするプラグインを指定できます。
|
||||
4. 初期化: プラグインは、ランタイムクライアントの起動時に非同期で初期化されます。
|
||||
5. 使用: ランタイムクライアントは、初期化されたプラグインを使用して機能を拡張できます(例: IPythonセルを実行するためのJupyterPlugin)。
|
||||
@@ -0,0 +1,381 @@
|
||||
# 設定オプション
|
||||
|
||||
このガイドでは、OpenHandsで利用可能なすべての設定オプションを詳しく説明し、その動作をカスタマイズし、他のサービスと統合するのに役立ちます。
|
||||
|
||||
:::note
|
||||
[GUIモード](https://docs.all-hands.dev/modules/usage/how-to/gui-mode)で実行している場合、設定UIで利用可能な設定が常に優先されます。
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
# 目次
|
||||
|
||||
1. [基本設定](#core-configuration)
|
||||
- [APIキー](#api-keys)
|
||||
- [ワークスペース](#workspace)
|
||||
- [デバッグとロギング](#debugging-and-logging)
|
||||
- [トラジェクトリ](#trajectories)
|
||||
- [ファイルストア](#file-store)
|
||||
- [タスク管理](#task-management)
|
||||
- [サンドボックス設定](#sandbox-configuration)
|
||||
- [その他](#miscellaneous)
|
||||
2. [LLM設定](#llm-configuration)
|
||||
- [AWS認証情報](#aws-credentials)
|
||||
- [API設定](#api-configuration)
|
||||
- [カスタムLLMプロバイダー](#custom-llm-provider)
|
||||
- [埋め込み](#embeddings)
|
||||
- [メッセージ処理](#message-handling)
|
||||
- [モデル選択](#model-selection)
|
||||
- [リトライ](#retrying)
|
||||
- [詳細オプション](#advanced-options)
|
||||
3. [エージェント設定](#agent-configuration)
|
||||
- [メモリ設定](#memory-configuration)
|
||||
- [LLM設定](#llm-configuration-1)
|
||||
- [アクションスペース設定](#actionspace-configuration)
|
||||
- [マイクロエージェントの使用](#microagent-usage)
|
||||
4. [サンドボックス設定](#sandbox-configuration-1)
|
||||
- [実行](#execution)
|
||||
- [コンテナイメージ](#container-image)
|
||||
- [ネットワーキング](#networking)
|
||||
- [リンティングとプラグイン](#linting-and-plugins)
|
||||
- [依存関係と環境](#dependencies-and-environment)
|
||||
- [評価](#evaluation)
|
||||
5. [セキュリティ設定](#security-configuration)
|
||||
- [確認モード](#confirmation-mode)
|
||||
- [セキュリティアナライザー](#security-analyzer)
|
||||
|
||||
---
|
||||
|
||||
## 基本設定
|
||||
|
||||
基本設定オプションは`config.toml`ファイルの`[core]`セクションで定義されます。
|
||||
|
||||
**APIキー**
|
||||
- `e2b_api_key`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: E2BのAPIキー
|
||||
|
||||
- `modal_api_token_id`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: ModalのAPIトークンID
|
||||
|
||||
- `modal_api_token_secret`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: ModalのAPIトークンシークレット
|
||||
|
||||
**ワークスペース**
|
||||
- `workspace_base`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"./workspace"`
|
||||
- 説明: ワークスペースのベースパス
|
||||
|
||||
- `cache_dir`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"/tmp/cache"`
|
||||
- 説明: キャッシュディレクトリのパス
|
||||
|
||||
**デバッグとロギング**
|
||||
- `debug`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: デバッグを有効にする
|
||||
|
||||
- `disable_color`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: ターミナル出力のカラー表示を無効にする
|
||||
|
||||
**トラジェクトリ**
|
||||
- `save_trajectory_path`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"./trajectories"`
|
||||
- 説明: トラジェクトリを保存するパス(フォルダまたはファイル)。フォルダの場合、トラジェクトリはセッションIDと.json拡張子を持つファイルとしてそのフォルダに保存されます。
|
||||
|
||||
**ファイルストア**
|
||||
- `file_store_path`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"/tmp/file_store"`
|
||||
- 説明: ファイルストアのパス
|
||||
|
||||
- `file_store`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"memory"`
|
||||
- 説明: ファイルストアのタイプ
|
||||
|
||||
- `file_uploads_allowed_extensions`
|
||||
- 型: `list of str`
|
||||
- デフォルト値: `[".*"]`
|
||||
- 説明: アップロードを許可するファイル拡張子のリスト
|
||||
|
||||
- `file_uploads_max_file_size_mb`
|
||||
- 型: `int`
|
||||
- デフォルト値: `0`
|
||||
- 説明: アップロードの最大ファイルサイズ(メガバイト)
|
||||
|
||||
- `file_uploads_restrict_file_types`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: ファイルアップロードのファイルタイプを制限する
|
||||
|
||||
**タスク管理**
|
||||
- `max_budget_per_task`
|
||||
- 型: `float`
|
||||
- デフォルト値: `0.0`
|
||||
- 説明: タスクごとの最大予算(0.0は制限なし)
|
||||
|
||||
- `max_iterations`
|
||||
- 型: `int`
|
||||
- デフォルト値: `100`
|
||||
- 説明: 最大イテレーション数
|
||||
|
||||
**サンドボックス設定**
|
||||
- `workspace_mount_path_in_sandbox`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"/workspace"`
|
||||
- 説明: サンドボックス内のワークスペースマウントパス
|
||||
|
||||
- `workspace_mount_path`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: ワークスペースマウントパス
|
||||
|
||||
- `workspace_mount_rewrite`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: ワークスペースマウントパスを書き換えるパス。通常は無視できます。別のコンテナ内での実行の特殊なケースを参照します。
|
||||
|
||||
**その他**
|
||||
- `run_as_openhands`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `true`
|
||||
- 説明: OpenHandsとして実行する
|
||||
|
||||
- `runtime`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"docker"`
|
||||
- 説明: 実行環境
|
||||
|
||||
- `default_agent`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"CodeActAgent"`
|
||||
- 説明: デフォルトのエージェント名
|
||||
|
||||
- `jwt_secret`
|
||||
- 型: `str`
|
||||
- デフォルト値: `uuid.uuid4().hex`
|
||||
- 説明: 認証用のJWTシークレット。独自の値に設定してください。
|
||||
|
||||
## LLM設定
|
||||
|
||||
LLM(大規模言語モデル)設定オプションは`config.toml`ファイルの`[llm]`セクションで定義されます。
|
||||
|
||||
dockerコマンドで使用する場合は、`-e LLM_<option>`として渡します。例:`-e LLM_NUM_RETRIES`
|
||||
|
||||
:::note
|
||||
開発設定では、カスタムLLM設定も定義できます。詳細は[カスタムLLM設定](./llms/custom-llm-configs)を参照してください。
|
||||
:::
|
||||
|
||||
**AWS認証情報**
|
||||
- `aws_access_key_id`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: AWSアクセスキーID
|
||||
|
||||
- `aws_region_name`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: AWSリージョン名
|
||||
|
||||
- `aws_secret_access_key`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: AWSシークレットアクセスキー
|
||||
|
||||
**API設定**
|
||||
- `api_key`
|
||||
- 型: `str`
|
||||
- デフォルト値: `None`
|
||||
- 説明: 使用するAPIキー
|
||||
|
||||
- `base_url`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: APIのベースURL
|
||||
|
||||
- `api_version`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: APIバージョン
|
||||
|
||||
- `input_cost_per_token`
|
||||
- 型: `float`
|
||||
- デフォルト値: `0.0`
|
||||
- 説明: 入力トークンあたりのコスト
|
||||
|
||||
- `output_cost_per_token`
|
||||
- 型: `float`
|
||||
- デフォルト値: `0.0`
|
||||
- 説明: 出力トークンあたりのコスト
|
||||
|
||||
**カスタムLLMプロバイダー**
|
||||
- `custom_llm_provider`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: カスタムLLMプロバイダー
|
||||
|
||||
**埋め込み**
|
||||
- `embedding_base_url`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: 埋め込みAPIのベースURL
|
||||
|
||||
- `embedding_deployment_name`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: 埋め込みデプロイメント名
|
||||
|
||||
- `embedding_model`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"local"`
|
||||
- 説明: 使用する埋め込みモデル
|
||||
|
||||
**メッセージ処理**
|
||||
- `max_message_chars`
|
||||
- 型: `int`
|
||||
- デフォルト値: `30000`
|
||||
- 説明: LLMプロンプトに含まれるイベントコンテンツの最大文字数(概算)。より大きな観察は切り捨てられます。
|
||||
|
||||
- `max_input_tokens`
|
||||
- 型: `int`
|
||||
- デフォルト値: `0`
|
||||
- 説明: 最大入力トークン数
|
||||
|
||||
- `max_output_tokens`
|
||||
- 型: `int`
|
||||
- デフォルト値: `0`
|
||||
- 説明: 最大出力トークン数
|
||||
|
||||
**モデル選択**
|
||||
- `model`
|
||||
- 型: `str`
|
||||
- デフォルト値: `"claude-3-5-sonnet-20241022"`
|
||||
- 説明: 使用するモデル
|
||||
|
||||
**リトライ**
|
||||
- `num_retries`
|
||||
- 型: `int`
|
||||
- デフォルト値: `8`
|
||||
- 説明: リトライ回数
|
||||
|
||||
- `retry_max_wait`
|
||||
- 型: `int`
|
||||
- デフォルト値: `120`
|
||||
- 説明: リトライ間の最大待機時間(秒)
|
||||
|
||||
- `retry_min_wait`
|
||||
- 型: `int`
|
||||
- デフォルト値: `15`
|
||||
- 説明: リトライ間の最小待機時間(秒)
|
||||
|
||||
- `retry_multiplier`
|
||||
- 型: `float`
|
||||
- デフォルト値: `2.0`
|
||||
- 説明: 指数バックオフ計算の乗数
|
||||
|
||||
**詳細オプション**
|
||||
- `drop_params`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: マッピングされていない(サポートされていない)パラメータを例外を発生させずに削除する
|
||||
|
||||
- `caching_prompt`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `true`
|
||||
- 説明: LLMによって提供され、サポートされている場合、プロンプトキャッシュ機能を使用する
|
||||
|
||||
- `ollama_base_url`
|
||||
- 型: `str`
|
||||
- デフォルト値: `""`
|
||||
- 説明: OLLAMA APIのベースURL
|
||||
|
||||
- `temperature`
|
||||
- 型: `float`
|
||||
- デフォルト値: `0.0`
|
||||
- 説明: APIの温度パラメータ
|
||||
|
||||
- `timeout`
|
||||
- 型: `int`
|
||||
- デフォルト値: `0`
|
||||
- 説明: APIのタイムアウト
|
||||
|
||||
- `top_p`
|
||||
- 型: `float`
|
||||
- デフォルト値: `1.0`
|
||||
- 説明: APIのtop_pパラメータ
|
||||
|
||||
- `disable_vision`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `None`
|
||||
- 説明: モデルがビジョン機能を持つ場合、この設定で画像処理を無効にできます(コスト削減に有用)
|
||||
|
||||
## エージェント設定
|
||||
|
||||
エージェント設定オプションは`config.toml`ファイルの`[agent]`および`[agent.<agent_name>]`セクションで定義されます。
|
||||
|
||||
**メモリ設定**
|
||||
- `memory_enabled`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: 長期メモリ(埋め込み)が有効かどうか
|
||||
|
||||
- `memory_max_threads`
|
||||
- 型: `int`
|
||||
- デフォルト値: `3`
|
||||
- 説明: 埋め込みのために同時にインデックスを作成する最大スレッド数
|
||||
|
||||
**LLM設定**
|
||||
- `llm_config`
|
||||
- 型: `str`
|
||||
- デフォルト値: `'your-llm-config-group'`
|
||||
- 説明: 使用するLLM設定の名前
|
||||
|
||||
**アクションスペース設定**
|
||||
- `function_calling`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `true`
|
||||
- 説明: 関数呼び出しが有効かどうか
|
||||
|
||||
- `codeact_enable_browsing`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: アクションスペースでブラウジングデリゲートが有効かどうか(関数呼び出しでのみ機能)
|
||||
|
||||
- `codeact_enable_llm_editor`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `false`
|
||||
- 説明: アクションスペースでLLMエディタが有効かどうか(関数呼び出しでのみ機能)
|
||||
|
||||
**マイクロエージェントの使用**
|
||||
- `enable_prompt_extensions`
|
||||
- 型: `bool`
|
||||
- デフォルト値: `true`
|
||||
- 説明: マイクロエージェントの使用が有効かどうか
|
||||
|
||||
- `disabled_microagents`
|
||||
- 型: `list of str`
|
||||
- デフォルト値: `None`
|
||||
- 説明: 無効にするマイクロエージェントのリスト
|
||||
|
||||
### 実行
|
||||
- `timeout`
|
||||
- 型: `int`
|
||||
- デフォルト値: `120`
|
||||
- 説明: サンドボックスのタイムアウト(秒)
|
||||
|
||||
- `user_id`
|
||||
- 型: `int`
|
||||
- デフォルト値: `1000`
|
||||
- 説明: サンドボックスのユーザーID
|
||||
@@ -0,0 +1,99 @@
|
||||
# 💿 カスタム Docker サポートを作成する方法
|
||||
|
||||
デフォルトの OpenHands サンドボックスは、最小限の ubuntu 構成で提供されています。ユースケースによっては、デフォルトでインストールされているソフトウェアが必要になる場合があります。この記事では、カスタム docker イメージを使用してこれを実現する方法について説明します。
|
||||
|
||||
## セットアップ
|
||||
|
||||
[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) のドキュメントに従って、OpenHands を使用できるようにしてください。
|
||||
|
||||
## カスタム Docker イメージの作成
|
||||
|
||||
次に、debian/ubuntu ベースのカスタム docker イメージを作成する必要があります。たとえば、OpenHands で "node" バイナリにアクセスできるようにしたい場合は、次のような Dockerfile を使用します:
|
||||
|
||||
```bash
|
||||
# 最新の ubuntu イメージから開始
|
||||
FROM ubuntu:latest
|
||||
|
||||
# 必要なアップデートを実行
|
||||
RUN apt-get update && apt-get install
|
||||
|
||||
# nodejs をインストール
|
||||
RUN apt-get install -y nodejs
|
||||
```
|
||||
|
||||
次に、選択した名前でカスタム docker イメージをビルドします。たとえば、"custom_image" とします。そのためには、ディレクトリを作成し、"Dockerfile" という名前のファイルをその中に配置し、ディレクトリ内でこのコマンドを実行します:
|
||||
|
||||
```bash
|
||||
docker build -t custom_image .
|
||||
```
|
||||
|
||||
これにより、```custom_image``` という名前の新しいイメージが作成され、Docker Engine で利用できるようになります。
|
||||
|
||||
> 注: ここで説明する設定では、OpenHands はサンドボックス内で "openhands" ユーザーとして動作するため、Dockerfile 経由でインストールされたパッケージは、root だけでなくシステム上のすべてのユーザーが利用できるようになります。
|
||||
>
|
||||
> 上記の apt-get によるインストールでは、すべてのユーザー向けに nodejs がインストールされます。
|
||||
|
||||
## config.toml ファイルでカスタムイメージを指定
|
||||
|
||||
OpenHands の設定は、トップレベルの ```config.toml``` ファイルを介して行われます。
|
||||
OpenHands ディレクトリに ```config.toml``` ファイルを作成し、次の内容を入力します:
|
||||
|
||||
```toml
|
||||
[core]
|
||||
workspace_base="./workspace"
|
||||
run_as_openhands=true
|
||||
[sandbox]
|
||||
base_container_image="custom_image"
|
||||
```
|
||||
|
||||
> ```base_container_image``` が前述のカスタムイメージ名に設定されていることを確認してください。
|
||||
|
||||
## 実行
|
||||
|
||||
ルートディレクトリで ```make run``` を実行して OpenHands を起動します。
|
||||
|
||||
```localhost:3001``` に移動し、目的の依存関係が利用可能かどうかを確認します。
|
||||
|
||||
上記の例の場合、コンソールで ```node -v``` コマンドを実行すると ```v18.19.1``` が出力されます。
|
||||
|
||||
おめでとうございます!
|
||||
|
||||
## 技術的な説明
|
||||
|
||||
カスタムイメージが初めて使用される場合、イメージが見つからないため、ビルドされます (その後の実行では、ビルドされたイメージが見つかり、返されます)。
|
||||
|
||||
カスタムイメージは [_build_sandbox_image()](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L29) でビルドされます。これは、カスタムイメージをベースとして使用して docker ファイルを作成し、次のように OpenHands の環境を設定します:
|
||||
|
||||
```python
|
||||
dockerfile_content = (
|
||||
f'FROM {base_image}\n'
|
||||
'RUN apt update && apt install -y openssh-server wget sudo\n'
|
||||
'RUN mkdir -p -m0755 /var/run/sshd\n'
|
||||
'RUN mkdir -p /openhands && mkdir -p /openhands/logs && chmod 777 /openhands/logs\n'
|
||||
'RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"\n'
|
||||
'RUN bash Miniforge3-$(uname)-$(uname -m).sh -b -p /openhands/miniforge3\n'
|
||||
'RUN bash -c ". /openhands/miniforge3/etc/profile.d/conda.sh && conda config --set changeps1 False && conda config --append channels conda-forge"\n'
|
||||
'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> ~/.bashrc\n'
|
||||
'RUN echo "export PATH=/openhands/miniforge3/bin:$PATH" >> /openhands/bash.bashrc\n'
|
||||
).strip()
|
||||
```
|
||||
|
||||
> 注: イメージ名は [_get_new_image_name()](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/docker/image_agnostic_util.py#L63) で変更され、この変更された名前が後続の実行時に検索されます。
|
||||
|
||||
## トラブルシューティング / エラー
|
||||
|
||||
### エラー: ```useradd: UID 1000 は一意ではありません```
|
||||
このエラーがコンソール出力に表示される場合、OpenHands がサンドボックス内に UID 1000 で openhands ユーザーを作成しようとしていますが、この UID は (何らかの理由で) イメージ内ですでに使用されているためです。この問題を解決するには、config.toml ファイルの user_id フィールドの値を別の値に変更します:
|
||||
|
||||
```toml
|
||||
[core]
|
||||
workspace_base="./workspace"
|
||||
run_as_openhands=true
|
||||
[sandbox]
|
||||
base_container_image="custom_image"
|
||||
user_id="1001"
|
||||
```
|
||||
|
||||
### ポート使用エラー
|
||||
|
||||
ポートが使用中または利用不可であることを示すエラーメッセージが表示される場合は、実行中のすべての docker コンテナを削除してみてください (`docker ps` を実行し、関連するコンテナに対して `docker rm` を実行します)。その後、```make run``` を再実行します。
|
||||
@@ -0,0 +1,40 @@
|
||||
# ✅ フィードバックの提供
|
||||
|
||||
OpenHandsを使用する際、うまくいく場合もあれば、そうでない場合もあります。開発チームにフィードバックを提供し、おそらくより重要なことですが、コーディングエージェントのトレーニング例のオープンなコーパスを作成するために、OpenHandsを使用する際にフィードバックを提供することをお勧めします -- Share-OpenHands!
|
||||
|
||||
## 📝 フィードバックの提供方法
|
||||
|
||||
フィードバックの提供は簡単です! OpenHandsを使用している際、インタラクションの任意のポイントで親指を上または下に向けるボタンを押すことができます。メールアドレスの入力を求められます (例: フォローアップの質問をしたい場合に連絡できるように)。また、フィードバックを公開するか非公開にするかを選択できます。
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/5rFx-StMVV0?si=svo7xzp6LhGK_GXr" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
|
||||
## 📜 データの使用とプライバシー
|
||||
|
||||
### データ共有設定
|
||||
|
||||
データを送信する際、公開または非公開で送信できます。
|
||||
|
||||
- **公開**データは、OpenHands自体と同様にMITライセンスの下で配布され、コミュニティがモデルのトレーニングとテストに使用できます。明らかに、公開できるフィードバックは、コミュニティ全体にとってより価値があるでしょう。機密情報を扱っていない場合は、このオプションを選択することをお勧めします!
|
||||
- **非公開**データは、OpenHandsの改善を目的としてOpenHandsチームが利用できるようになります。ただし、一意のIDを持つリンクが作成され、他の人と公開で共有できます。
|
||||
|
||||
### データの収集と保存は誰が行うのか?
|
||||
|
||||
データは、OpenHandsのメンテナーによって設立されたOpenHandsのサポートと改善を目的とする企業である[All Hands AI](https://all-hands.dev)によって収集および保存されます。
|
||||
|
||||
### 公開データはどのようにリリースされるのか?
|
||||
|
||||
公開データは、1,000件の公開例、10,000件の公開例などの固定されたマイルストーンに達した時点でリリースされます。
|
||||
その際、以下のリリースプロセスに従います:
|
||||
|
||||
1. 公開フィードバックを提供したすべての人に、データのリリースについて説明し、オプトアウトする機会を与えるメールが送信されます。
|
||||
2. データリリースを担当する人は、データの品質管理を行い、低品質のフィードバックを削除し、
|
||||
提出者のメールアドレスを削除し、機密情報を削除するよう試みます。
|
||||
3. データは、GitHubやHugging Faceなどの一般的に使用されているサイトを通じて、MITライセンスの下で公開されます。
|
||||
|
||||
### データを削除したい場合はどうすればよいですか?
|
||||
|
||||
All Hands AIのサーバー上のデータについては、リクエストに応じて削除いたします:
|
||||
|
||||
**1つのデータ:** 1つのデータを削除したい場合、データ送信時にインターフェイスに表示されるリンクとパスワードを使用してデータを削除するメカニズムを近日中に追加する予定です。
|
||||
|
||||
**すべてのデータ:** すべてのデータを削除したい場合、またはデータ送信時に受け取ったIDとパスワードがない場合は、元のデータ送信時に登録したメールアドレスから`contact@all-hands.dev`までご連絡ください。
|
||||
@@ -0,0 +1,108 @@
|
||||
# OpenHandsを始める
|
||||
|
||||
[OpenHandsをインストール](./installation)し、[LLMを設定](./installation#setup)しました。次は何をしましょうか?
|
||||
|
||||
OpenHandsは、さまざまなエンジニアリングタスクを支援できます。しかし、この技術はまだ新しく、
|
||||
エージェントが支援なしで広範で複雑なエンジニアリングタスクを処理できるようになるまでには時間がかかります。
|
||||
そのため、エージェントが得意とすることと、支援が必要な部分を理解することが重要です。
|
||||
|
||||
## Hello World
|
||||
|
||||
最初に試してみたいのは、シンプルな「hello world」の例かもしれません。
|
||||
これは見た目以上に複雑になる可能性があります!
|
||||
|
||||
エージェントに以下のように依頼してみてください:
|
||||
> "hello world!"と表示するbashスクリプトhello.shを作成してください
|
||||
|
||||
エージェントがスクリプトを作成するだけでなく、適切な権限を設定し、
|
||||
スクリプトを実行して出力を確認することに気付くでしょう。
|
||||
|
||||
エージェントにコードの改良を続けて依頼することもできます。これはエージェントと
|
||||
作業する優れた方法です。シンプルに始めて、反復的に改良していきます。
|
||||
|
||||
> hello.shを修正して、最初の引数として名前を受け取るようにしてください。デフォルトは"world"にしてください
|
||||
|
||||
また、エージェントが環境のセットアップに時間を要する可能性はありますが、
|
||||
必要な任意の言語で作業することができます!
|
||||
|
||||
> hello.shをRubyスクリプトに変換して実行してください
|
||||
|
||||
## ゼロからの構築
|
||||
|
||||
エージェントは、「グリーンフィールド」タスク(既存のコードベースに関する文脈を必要としないタスク)で
|
||||
特に優れた性能を発揮し、ゼロから始めることができます。
|
||||
|
||||
シンプルなタスクから始めて、反復的に改良していくのがベストです。また、
|
||||
要望する内容、使用する技術スタックなどについて、できるだけ具体的に指定することをお勧めします。
|
||||
|
||||
例えば、TODOアプリケーションを構築できます:
|
||||
|
||||
> フロントエンドのみのReactベースの基本的なTODOリストアプリケーションを作成してください。
|
||||
> すべての状態はlocalStorageに保存してください。
|
||||
|
||||
基本的な構造ができたら、アプリケーションの改良を続けることができます:
|
||||
|
||||
> 各タスクにオプションの期限を追加できるようにしてください
|
||||
|
||||
通常の開発と同様に、頻繁にコミットとプッシュを行うことをお勧めします。
|
||||
これにより、エージェントが予期せぬ方向に進んだ場合でも、以前の状態に戻ることができます。
|
||||
エージェントにコミットとプッシュを依頼することもできます:
|
||||
|
||||
> 変更をコミットして、"feature/due-dates"という新しいブランチにプッシュしてください
|
||||
|
||||
## 新しいコードの追加
|
||||
|
||||
OpenHandsは、既存のコードベースに新しいコードを追加する作業も優れています。
|
||||
|
||||
例えば、OpenHandsにコードを分析するGitHubアクションをプロジェクトに追加するよう依頼できます。
|
||||
OpenHandsはコードベースを確認して使用すべき言語を判断し、新しいファイルを
|
||||
`./github/workflows/lint.yml`に作成できます。
|
||||
|
||||
> このリポジトリのコードを分析するGitHubアクションを追加してください
|
||||
|
||||
一部のタスクではより多くの文脈が必要かもしれません。OpenHandsは`ls`や`grep`を使用して
|
||||
コードベースを検索できますが、事前に文脈を提供することで、より速く、より正確に作業を
|
||||
進めることができます。また、トークンの消費も少なくなります!
|
||||
|
||||
> ./backend/api/routes.jsを修正して、すべてのタスクのリストを返す新しいルートを追加してください
|
||||
|
||||
> ./frontend/componentsディレクトリにWidgetのリストを表示する新しいReactコンポーネントを追加してください。
|
||||
> 既存のWidgetコンポーネントを使用する必要があります。
|
||||
|
||||
## リファクタリング
|
||||
|
||||
OpenHandsは、特に小規模な既存コードのリファクタリングに優れています。
|
||||
コードベース全体のアーキテクチャを変更しようとするのは避けた方がよいですが、
|
||||
長いファイルや関数の分割、変数名の変更などは非常にうまく機能する傾向があります。
|
||||
|
||||
> ./app.goの1文字の変数名をすべて変更してください
|
||||
|
||||
> widget.phpの`build_and_deploy_widgets`関数を`build_widgets`と`deploy_widgets`の2つの関数に分割してください
|
||||
|
||||
> ./api/routes.jsを各ルートごとの別々のファイルに分割してください
|
||||
|
||||
## バグ修正
|
||||
|
||||
OpenHandsは、コードのバグの追跡と修正も支援できます。しかし、すべての
|
||||
開発者が知っているように、バグ修正は非常に繊細な作業になる可能性があり、多くの場合OpenHandsはより多くの文脈を
|
||||
必要とします。バグを診断済みで、OpenHandsにロジックを理解してもらいたい場合に特に役立ちます。
|
||||
|
||||
> 現在、`/subscribe`エンドポイントのemailフィールドが.ioドメインを拒否しています。これを修正してください。
|
||||
|
||||
> ./app.pyの`search_widgets`関数が大文字小文字を区別して検索を行っています。大文字小文字を区別しないように修正してください。
|
||||
|
||||
エージェントとバグを修正する際は、テスト駆動開発を行うと便利なことが多いです。
|
||||
エージェントに新しいテストを書かせ、バグが修正されるまで反復することができます:
|
||||
|
||||
> `hello`関数が空文字列でクラッシュします。このバグを再現するテストを書いて、コードを修正してテストが通るようにしてください。
|
||||
|
||||
## その他
|
||||
|
||||
OpenHandsは、ほぼすべてのコーディングタスクを支援できます。しかし、最大限に
|
||||
活用するには練習が必要です。以下の点を忘れないでください:
|
||||
* タスクを小さく保つ
|
||||
* できるだけ具体的に指定する
|
||||
* できるだけ多くの文脈を提供する
|
||||
* 頻繁にコミットとプッシュを行う
|
||||
|
||||
OpenHandsを最大限に活用する方法についての詳細なアドバイスは、[プロンプトのベストプラクティス](./prompting/prompting-best-practices)をご覧ください。
|
||||
@@ -0,0 +1,95 @@
|
||||
# CLI モード
|
||||
|
||||
OpenHands は対話型の CLI モードで実行できます。これにより、ユーザーはコマンドラインから対話型セッションを開始できます。
|
||||
|
||||
このモードは、非対話型でスクリプティングに適した [ヘッドレスモード](headless-mode) とは異なります。
|
||||
|
||||
## Python を使用する場合
|
||||
|
||||
コマンドラインから対話型の OpenHands セッションを開始するには:
|
||||
|
||||
1. [開発セットアップの手順](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) に従っていることを確認してください。
|
||||
2. 以下のコマンドを実行します:
|
||||
|
||||
```bash
|
||||
poetry run python -m openhands.core.cli
|
||||
```
|
||||
|
||||
このコマンドを実行すると、タスクを入力して OpenHands からレスポンスを受け取ることができる対話型セッションが開始されます。
|
||||
|
||||
環境変数 [または `config.toml` ファイル](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) を使用して、モデル、API キー、その他の設定を確実に設定する必要があります。
|
||||
|
||||
## Docker を使用する場合
|
||||
|
||||
Docker で OpenHands を CLI モードで実行するには:
|
||||
|
||||
1. ターミナルで以下の環境変数を設定します:
|
||||
|
||||
- `WORKSPACE_BASE` を OpenHands に編集させたいディレクトリに設定 (例: `export WORKSPACE_BASE=$(pwd)/workspace`)。
|
||||
- `LLM_MODEL` を使用するモデルに設定 (例: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`)。
|
||||
- `LLM_API_KEY` を API キーに設定 (例: `export LLM_API_KEY="sk_test_12345"`)。
|
||||
|
||||
2. 以下の Docker コマンドを実行します:
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.30-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
-e LLM_MODEL=$LLM_MODEL \
|
||||
-v $WORKSPACE_BASE:/opt/workspace_base \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-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.30 \
|
||||
python -m openhands.core.cli
|
||||
```
|
||||
|
||||
このコマンドを実行すると、Docker 内で対話型セッションが開始され、タスクを入力して OpenHands からレスポンスを受け取ることができます。
|
||||
|
||||
## CLI コマンドと期待される出力の例
|
||||
|
||||
CLI コマンドとその期待される出力の例を以下に示します:
|
||||
|
||||
### 例1: シンプルなタスク
|
||||
|
||||
```bash
|
||||
>> "Hello, World!" と出力する Python スクリプトを書いてください
|
||||
```
|
||||
|
||||
期待される出力:
|
||||
|
||||
```bash
|
||||
🤖 はい! "Hello, World!" と出力する Python スクリプトは以下のようになります:
|
||||
|
||||
❯ print("Hello, World!")
|
||||
```
|
||||
|
||||
### 例2: Bash コマンド
|
||||
|
||||
```bash
|
||||
>> "test_dir" という名前のディレクトリを作成してください
|
||||
```
|
||||
|
||||
期待される出力:
|
||||
|
||||
```bash
|
||||
🤖 "test_dir" という名前のディレクトリを作成します:
|
||||
|
||||
❯ mkdir test_dir
|
||||
```
|
||||
|
||||
### 例3: エラー処理
|
||||
|
||||
```bash
|
||||
>> 存在しないファイルを削除してください
|
||||
```
|
||||
|
||||
期待される出力:
|
||||
|
||||
```bash
|
||||
🤖 エラーが発生しました。もう一度お試しください。
|
||||
```
|
||||
@@ -0,0 +1,92 @@
|
||||
# カスタムサンドボックス
|
||||
|
||||
サンドボックスは、エージェントがタスクを実行する場所です。コンピュータ上で直接コマンドを実行する(これはリスクがある可能性があります)代わりに、エージェントはDockerコンテナ内でそれらを実行します。
|
||||
|
||||
デフォルトのOpenHandsサンドボックス([nikolaik/python-nodejs](https://hub.docker.com/r/nikolaik/python-nodejs)の`python-nodejs:python3.12-nodejs22`)にはPythonやNode.jsなどのパッケージがインストールされていますが、デフォルトでインストールする必要のある他のソフトウェアがある場合があります。
|
||||
|
||||
カスタマイズには2つのオプションがあります:
|
||||
|
||||
- 必要なソフトウェアがインストールされている既存のイメージを使用する。
|
||||
- 独自のカスタムDockerイメージを作成する。
|
||||
|
||||
最初のオプションを選択した場合は、`Dockerイメージの作成`セクションをスキップできます。
|
||||
|
||||
## Dockerイメージの作成
|
||||
|
||||
カスタムDockerイメージを作成するには、Debianベースである必要があります。
|
||||
|
||||
たとえば、OpenHandsに`ruby`をインストールしたい場合は、次の内容で`Dockerfile`を作成できます:
|
||||
|
||||
```dockerfile
|
||||
FROM nikolaik/python-nodejs:python3.12-nodejs22
|
||||
|
||||
# 必要なパッケージをインストール
|
||||
RUN apt-get update && apt-get install -y ruby
|
||||
```
|
||||
|
||||
または、Ruby固有のベースイメージを使用することもできます:
|
||||
|
||||
```dockerfile
|
||||
FROM ruby:latest
|
||||
```
|
||||
|
||||
このファイルをフォルダに保存します。次に、ターミナルでフォルダに移動し、次のコマンドを実行して、Dockerイメージ(たとえば、custom-imageという名前)をビルドします:
|
||||
|
||||
```bash
|
||||
docker build -t custom-image .
|
||||
```
|
||||
|
||||
これにより、`custom-image`という新しいイメージが作成され、Dockerで利用できるようになります。
|
||||
|
||||
## Dockerコマンドの使用
|
||||
|
||||
[dockerコマンド](/modules/usage/installation#start-the-app)を使用してOpenHandsを実行する場合は、`-e SANDBOX_RUNTIME_CONTAINER_IMAGE=...`を`-e SANDBOX_BASE_CONTAINER_IMAGE=<カスタムイメージ名>`に置き換えます:
|
||||
|
||||
```commandline
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_BASE_CONTAINER_IMAGE=custom-image \
|
||||
...
|
||||
```
|
||||
|
||||
## 開発ワークフローの使用
|
||||
|
||||
### セットアップ
|
||||
|
||||
まず、[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)の手順に従って、OpenHandsを実行できることを確認してください。
|
||||
|
||||
### ベースサンドボックスイメージの指定
|
||||
|
||||
OpenHandsディレクトリ内の`config.toml`ファイルで、`base_container_image`を使用するイメージに設定します。これは、すでにプルしたイメージまたは構築したイメージにすることができます:
|
||||
|
||||
```bash
|
||||
[core]
|
||||
...
|
||||
[sandbox]
|
||||
base_container_image="custom-image"
|
||||
```
|
||||
|
||||
### その他の設定オプション
|
||||
|
||||
`config.toml`ファイルは、サンドボックスをカスタマイズするためのいくつかの他のオプションをサポートしています:
|
||||
|
||||
```toml
|
||||
[core]
|
||||
# ランタイムのビルド時に追加の依存関係をインストールする
|
||||
# 有効なシェルコマンドを含めることができる
|
||||
# これらのコマンドのいずれかでPythonインタープリターへのパスが必要な場合は、$OH_INTERPRETER_PATH変数を使用できる
|
||||
runtime_extra_deps = """
|
||||
pip install numpy pandas
|
||||
apt-get update && apt-get install -y ffmpeg
|
||||
"""
|
||||
|
||||
# ランタイムの環境変数を設定する
|
||||
# ランタイムで使用可能である必要がある設定に役立つ
|
||||
runtime_startup_env_vars = { DATABASE_URL = "postgresql://user:pass@localhost/db" }
|
||||
|
||||
# マルチアーキテクチャビルドのプラットフォームを指定する(例: "linux/amd64"または"linux/arm64")
|
||||
platform = "linux/amd64"
|
||||
```
|
||||
|
||||
### 実行
|
||||
|
||||
トップレベルのディレクトリで```make run```を実行して、OpenHandsを実行します。
|
||||
@@ -0,0 +1,69 @@
|
||||
以下は、OpenHandsのデバッグに関する入門書です。開発目的で使用してください。
|
||||
|
||||
## サーバー / VSCode
|
||||
|
||||
以下の`launch.json`は、エージェント、コントローラー、サーバー要素のデバッグを可能にしますが、サンドボックス(Dockerの中で動作する)はデバッグできません。`workspace/`ディレクトリ内の変更は無視されます。
|
||||
|
||||
```
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "OpenHands CLI",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "openhands.core.cli",
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
"name": "OpenHands WebApp",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "uvicorn",
|
||||
"args": [
|
||||
"openhands.server.listen:app",
|
||||
"--reload",
|
||||
"--reload-exclude",
|
||||
"${workspaceFolder}/workspace",
|
||||
"--port",
|
||||
"3000"
|
||||
],
|
||||
"justMyCode": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
より具体的なデバッグ設定では、より多くのパラメータを指定できます。
|
||||
|
||||
```
|
||||
...
|
||||
{
|
||||
"name": "Debug CodeAct",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "openhands.core.main",
|
||||
"args": [
|
||||
"-t",
|
||||
"Ask me what your task is.",
|
||||
"-d",
|
||||
"${workspaceFolder}/workspace",
|
||||
"-c",
|
||||
"CodeActAgent",
|
||||
"-l",
|
||||
"llm.o1",
|
||||
"-n",
|
||||
"prompts"
|
||||
],
|
||||
"justMyCode": false
|
||||
}
|
||||
...
|
||||
```
|
||||
|
||||
上記のスニペットの値は、以下のように更新できます。
|
||||
|
||||
* *t*: タスク
|
||||
* *d*: openhandsワークスペースディレクトリ
|
||||
* *c*: エージェント
|
||||
* *l*: LLM設定(config.tomlで事前定義)
|
||||
* *n*: セッション名(例:eventstream名)
|
||||
@@ -0,0 +1,277 @@
|
||||
# 評価
|
||||
|
||||
このガイドでは、独自の評価ベンチマークをOpenHandsフレームワークに統合する方法の概要を説明します。
|
||||
|
||||
## 環境のセットアップとLLMの設定
|
||||
|
||||
ローカル開発環境のセットアップ方法については、[こちら](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)の手順に従ってください。
|
||||
開発モードのOpenHandsは、ほとんどの設定を追跡するために`config.toml`を使用します。
|
||||
|
||||
複数のLLMを定義して使用するために使用できる設定ファイルの例を以下に示します。
|
||||
|
||||
```toml
|
||||
[llm]
|
||||
# 重要: ここにAPIキーを追加し、モデルを評価したいものに設定してください
|
||||
model = "claude-3-5-sonnet-20241022"
|
||||
api_key = "sk-XXX"
|
||||
|
||||
[llm.eval_gpt4_1106_preview_llm]
|
||||
model = "gpt-4-1106-preview"
|
||||
api_key = "XXX"
|
||||
temperature = 0.0
|
||||
|
||||
[llm.eval_some_openai_compatible_model_llm]
|
||||
model = "openai/MODEL_NAME"
|
||||
base_url = "https://OPENAI_COMPATIBLE_URL/v1"
|
||||
api_key = "XXX"
|
||||
temperature = 0.0
|
||||
```
|
||||
|
||||
|
||||
## コマンドラインでOpenHandsを使用する方法
|
||||
|
||||
OpenHandsは、以下の形式でコマンドラインから実行できます。
|
||||
|
||||
```bash
|
||||
poetry run python ./openhands/core/main.py \
|
||||
-i <max_iterations> \
|
||||
-t "<task_description>" \
|
||||
-c <agent_class> \
|
||||
-l <llm_config>
|
||||
```
|
||||
|
||||
例:
|
||||
|
||||
```bash
|
||||
poetry run python ./openhands/core/main.py \
|
||||
-i 10 \
|
||||
-t "Write me a bash script that prints hello world." \
|
||||
-c CodeActAgent \
|
||||
-l llm
|
||||
```
|
||||
|
||||
このコマンドは、以下の設定でOpenHandsを実行します:
|
||||
- 最大10回の反復
|
||||
- 指定されたタスクの説明
|
||||
- CodeActAgentを使用
|
||||
- `config.toml`ファイルの`llm`セクションで定義されたLLM設定
|
||||
|
||||
## OpenHandsの動作原理
|
||||
|
||||
OpenHandsのメインエントリーポイントは`openhands/core/main.py`にあります。簡略化された動作の流れは次のとおりです。
|
||||
|
||||
1. コマンドライン引数を解析し、設定を読み込む
|
||||
2. `create_runtime()`を使用して実行時環境を作成する
|
||||
3. 指定されたエージェントを初期化する
|
||||
4. `run_controller()`を使用してコントローラーを実行する
|
||||
- 実行時環境をエージェントにアタッチする
|
||||
- エージェントのタスクを実行する
|
||||
- 完了時に最終状態を返す
|
||||
|
||||
`run_controller()`関数は、OpenHandsの実行の中核です。エージェント、実行時環境、およびタスク間の相互作用を管理し、ユーザー入力シミュレーションやイベント処理などを処理します。
|
||||
|
||||
|
||||
## 最も簡単な開始方法: 既存のベンチマークの探索
|
||||
|
||||
リポジトリの[`evaluation/benchmarks/`ディレクトリ](https://github.com/All-Hands-AI/OpenHands/blob/main/evaluation/benchmarks)にある様々な評価ベンチマークを確認することをお勧めします。
|
||||
|
||||
独自のベンチマークを統合するには、ニーズに最も近いものから始めることをお勧めします。このアプローチは、既存の構造を基にして特定の要件に適応させることで、統合プロセスを大幅に合理化できます。
|
||||
|
||||
## 評価ワークフローの作成方法
|
||||
|
||||
ベンチマークの評価ワークフローを作成するには、次の手順に従います。
|
||||
|
||||
1. 関連するOpenHandsユーティリティをインポートします:
|
||||
```python
|
||||
import openhands.agenthub
|
||||
from evaluation.utils.shared import (
|
||||
EvalMetadata,
|
||||
EvalOutput,
|
||||
make_metadata,
|
||||
prepare_dataset,
|
||||
reset_logger_for_multiprocessing,
|
||||
run_evaluation,
|
||||
)
|
||||
from openhands.controller.state.state import State
|
||||
from openhands.core.config import (
|
||||
AppConfig,
|
||||
SandboxConfig,
|
||||
get_llm_config_arg,
|
||||
parse_arguments,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.core.main import create_runtime, run_controller
|
||||
from openhands.events.action import CmdRunAction
|
||||
from openhands.events.observation import CmdOutputObservation, ErrorObservation
|
||||
from openhands.runtime.runtime import Runtime
|
||||
```
|
||||
|
||||
2. 設定を作成します:
|
||||
```python
|
||||
def get_config(instance: pd.Series, metadata: EvalMetadata) -> AppConfig:
|
||||
config = AppConfig(
|
||||
default_agent=metadata.agent_class,
|
||||
runtime='docker',
|
||||
max_iterations=metadata.max_iterations,
|
||||
sandbox=SandboxConfig(
|
||||
base_container_image='your_container_image',
|
||||
enable_auto_lint=True,
|
||||
timeout=300,
|
||||
),
|
||||
)
|
||||
config.set_llm_config(metadata.llm_config)
|
||||
return config
|
||||
```
|
||||
|
||||
3. 実行時環境を初期化し、評価環境をセットアップします:
|
||||
```python
|
||||
def initialize_runtime(runtime: Runtime, instance: pd.Series):
|
||||
# ここで評価環境をセットアップします
|
||||
# 例えば、環境変数の設定、ファイルの準備など
|
||||
pass
|
||||
```
|
||||
|
||||
4. 各インスタンスを処理する関数を作成します:
|
||||
```python
|
||||
from openhands.utils.async_utils import call_async_from_sync
|
||||
def process_instance(instance: pd.Series, metadata: EvalMetadata) -> EvalOutput:
|
||||
config = get_config(instance, metadata)
|
||||
runtime = create_runtime(config)
|
||||
call_async_from_sync(runtime.connect)
|
||||
initialize_runtime(runtime, instance)
|
||||
|
||||
instruction = get_instruction(instance, metadata)
|
||||
|
||||
state = run_controller(
|
||||
config=config,
|
||||
task_str=instruction,
|
||||
runtime=runtime,
|
||||
fake_user_response_fn=your_user_response_function,
|
||||
)
|
||||
|
||||
# エージェントのアクションを評価する
|
||||
evaluation_result = await evaluate_agent_actions(runtime, instance)
|
||||
|
||||
return EvalOutput(
|
||||
instance_id=instance.instance_id,
|
||||
instruction=instruction,
|
||||
test_result=evaluation_result,
|
||||
metadata=metadata,
|
||||
history=compatibility_for_eval_history_pairs(state.history),
|
||||
metrics=state.metrics.get() if state.metrics else None,
|
||||
error=state.last_error if state and state.last_error else None,
|
||||
)
|
||||
```
|
||||
|
||||
5. 評価を実行します:
|
||||
```python
|
||||
metadata = make_metadata(llm_config, dataset_name, agent_class, max_iterations, eval_note, eval_output_dir)
|
||||
output_file = os.path.join(metadata.eval_output_dir, 'output.jsonl')
|
||||
instances = prepare_dataset(your_dataset, output_file, eval_n_limit)
|
||||
|
||||
await run_evaluation(
|
||||
instances,
|
||||
metadata,
|
||||
output_file,
|
||||
num_workers,
|
||||
process_instance
|
||||
)
|
||||
```
|
||||
|
||||
このワークフローでは、設定をセットアップし、実行時環境を初期化し、エージェントを実行して各インスタンスのアクションを評価し、結果を`EvalOutput`オブジェクトに収集します。`run_evaluation`関数は、並列化と進捗状況の追跡を処理します。
|
||||
|
||||
`get_instruction`、`your_user_response_function`、および`evaluate_agent_actions`関数は、特定のベンチマークの要件に応じてカスタマイズすることを忘れないでください。
|
||||
|
||||
この構造に従うことで、OpenHandsフレームワーク内で独自のベンチマークの堅牢な評価ワークフローを作成できます。
|
||||
|
||||
|
||||
## `user_response_fn`の理解
|
||||
|
||||
`user_response_fn`は、OpenHandsの評価ワークフローにおいて重要な役割を果たします。これは、評価プロセス中にエージェントとのユーザー対話をシミュレートし、自動化された応答を可能にします。この関数は、エージェントのクエリやアクションに対して一貫性のある事前定義された応答を提供したい場合に特に役立ちます。
|
||||
|
||||
|
||||
### ワークフローと相互作用
|
||||
|
||||
アクションと`user_response_fn`を処理するための正しいワークフローは次のとおりです。
|
||||
|
||||
1. エージェントがタスクを受け取り、処理を開始する
|
||||
2. エージェントがアクションを発行する
|
||||
3. アクションが実行可能な場合(CmdRunAction、IPythonRunCellActionなど):
|
||||
- 実行時環境がアクションを処理する
|
||||
- 実行時環境が観測結果を返す
|
||||
4. アクションが実行不可能な場合(通常はMessageAction):
|
||||
- `user_response_fn`が呼び出される
|
||||
- シミュレートされたユーザー応答を返す
|
||||
5. エージェントは、観測結果またはシミュレートされた応答のいずれかを受け取る
|
||||
6. ステップ2〜5が、タスクが完了するか最大反復回数に達するまで繰り返される
|
||||
|
||||
より正確な視覚的表現は次のとおりです。
|
||||
|
||||
```
|
||||
[Agent]
|
||||
|
|
||||
v
|
||||
[Emit Action]
|
||||
|
|
||||
v
|
||||
[Is Action Executable?]
|
||||
/ \
|
||||
Yes No
|
||||
| |
|
||||
v v
|
||||
[Runtime] [user_response_fn]
|
||||
| |
|
||||
v v
|
||||
[Return Observation] [Simulated Response]
|
||||
\ /
|
||||
\ /
|
||||
v v
|
||||
[Agent receives feedback]
|
||||
|
|
||||
v
|
||||
[Continue or Complete Task]
|
||||
```
|
||||
|
||||
このワークフローでは:
|
||||
|
||||
- 実行可能なアクション(コマンドの実行やコードの実行など)は、実行時環境によって直接処理される
|
||||
- 実行不可能なアクション(通常、エージェントがコミュニケーションを取ったり、明確化を求めたりする場合)は、`user_response_fn`によって処理される
|
||||
- エージェントは、実行時環境からの観測結果または`user_response_fn`からのシミュレートされた応答のいずれかのフィードバックを処理する
|
||||
|
||||
このアプローチにより、具体的なアクションとシミュレートされたユーザー対話の両方を自動的に処理できるため、人的介入を最小限に抑えてエージェントのタスク完了能力をテストしたい評価シナリオに適しています。
|
||||
|
||||
### 実装例
|
||||
|
||||
SWE-Benchの評価で使用される`user_response_fn`の例を以下に示します。
|
||||
|
||||
```python
|
||||
def codeact_user_response(state: State | None) -> str:
|
||||
msg = (
|
||||
'Please continue working on the task on whatever approach you think is suitable.\n'
|
||||
'If you think you have solved the task, please first send your answer to user through message and then <execute_bash> exit </execute_bash>.\n'
|
||||
'IMPORTANT: YOU SHOULD NEVER ASK FOR HUMAN HELP.\n'
|
||||
)
|
||||
|
||||
if state and state.history:
|
||||
# check if the agent has tried to talk to the user 3 times, if so, let the agent know it can give up
|
||||
user_msgs = [
|
||||
event
|
||||
for event in state.history
|
||||
if isinstance(event, MessageAction) and event.source == 'user'
|
||||
]
|
||||
if len(user_msgs) >= 2:
|
||||
# let the agent know that it can give up when it has tried 3 times
|
||||
return (
|
||||
msg
|
||||
+ 'If you want to give up, run: <execute_bash> exit </execute_bash>.\n'
|
||||
)
|
||||
return msg
|
||||
```
|
||||
|
||||
この関数は次のことを行います。
|
||||
|
||||
1. エージェントに作業を続けるよう促す標準メッセージを提供する
|
||||
2. エージェントがユーザーとのコミュニケーションを試みた回数をチェックする
|
||||
3. エージェントが複数回試行した場合、諦めるオプションを提供する
|
||||
|
||||
この関数を使用することで、複数の評価実行全体で一貫した動作を確保し、エージェントが人間の入力を待って停止するのを防ぐことができます。
|
||||
@@ -0,0 +1,50 @@
|
||||
# OpenHands GitHub Actionの使用方法
|
||||
|
||||
このガイドでは、OpenHands自体のリポジトリ内および独自のプロジェクトの両方で、OpenHands GitHub Actionを使用する方法について説明します。
|
||||
|
||||
## OpenHands リポジトリ内でのActionの使用
|
||||
|
||||
リポジトリ内でOpenHands GitHub Actionを使用するには、以下の手順を実行します。
|
||||
|
||||
1. リポジトリ内にissueを作成します。
|
||||
2. issueに`fix-me`ラベルを追加するか、`@openhands-agent`で始まるコメントをissueに残します。
|
||||
|
||||
アクションは自動的にトリガーされ、issueの解決を試みます。
|
||||
|
||||
## 新しいリポジトリへのActionのインストール
|
||||
|
||||
独自のリポジトリにOpenHands GitHub Actionをインストールするには、[OpenHands Resolverの README](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md)に従ってください。
|
||||
|
||||
## 使用のヒント
|
||||
|
||||
### 反復的な解決
|
||||
|
||||
1. リポジトリ内にissueを作成します。
|
||||
2. issueに`fix-me`ラベルを追加するか、`@openhands-agent`で始まるコメントを残します。
|
||||
3. プルリクエストを確認して、issueを解決する試みをレビューします。
|
||||
4. 一般的なコメント、レビューコメント、またはインラインスレッドコメントを通じてフィードバックをフォローアップします。
|
||||
5. プルリクエストに`fix-me`ラベルを追加するか、`@openhands-agent`で始まる特定のコメントに対処します。
|
||||
|
||||
### ラベルとマクロ
|
||||
|
||||
- ラベル(`fix-me`):OpenHandsに**全体の** issueまたはプルリクエストへの対処を要求します。
|
||||
- マクロ(`@openhands-agent`):OpenHandsにissue/プルリクエストの説明と**特定のコメント**のみを考慮するように要求します。
|
||||
|
||||
## 高度な設定
|
||||
|
||||
### カスタムリポジトリ設定の追加
|
||||
|
||||
[resolverのREADME](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/resolver/README.md#providing-custom-instructions)に従って、OpenHandsにカスタムの指示を提供できます。
|
||||
|
||||
### カスタム構成
|
||||
|
||||
GitHub resolverは、自動的に有効な[リポジトリシークレット](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions?tool=webui#creating-secrets-for-a-repository)または[リポジトリ変数](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository)をチェックして、その動作をカスタマイズします。
|
||||
設定可能なカスタマイズオプションは次のとおりです。
|
||||
|
||||
| **属性名** | **タイプ** | **目的** | **例** |
|
||||
| -------------------------------- | -------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
||||
| `LLM_MODEL` | Variable | OpenHandsで使用するLLMを設定 | `LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"` |
|
||||
| `OPENHANDS_MAX_ITER` | Variable | エージェントの反復の最大制限を設定 | `OPENHANDS_MAX_ITER=10` |
|
||||
| `OPENHANDS_MACRO` | Variable | リゾルバを呼び出すためのデフォルトマクロをカスタマイズ | `OPENHANDS_MACRO=@resolveit` |
|
||||
| `OPENHANDS_BASE_CONTAINER_IMAGE` | Variable | カスタムSandbox([詳細](https://docs.all-hands.dev/modules/usage/how-to/custom-sandbox-guide)) | `OPENHANDS_BASE_CONTAINER_IMAGE="custom_image"` |
|
||||
| `TARGET_BRANCH` | Variable | `main`以外のブランチにマージ | `TARGET_BRANCH="dev"` |
|
||||
@@ -0,0 +1,116 @@
|
||||
# GUIモード
|
||||
|
||||
OpenHandsは、AI アシスタントとやり取りするためのグラフィカルユーザーインターフェース(GUI)モードを提供しています。
|
||||
|
||||
## インストールとセットアップ
|
||||
|
||||
1. インストール手順に従って、OpenHandsをインストールします。
|
||||
2. コマンドを実行した後、[http://localhost:3000](http://localhost:3000)でOpenHandsにアクセスします。
|
||||
|
||||
## GUIでのやり取り
|
||||
|
||||
### 初期設定
|
||||
|
||||
1. 初回起動時に、設定ページが表示されます。
|
||||
2. ドロップダウンメニューから`LLM Provider`と`LLM Model`を選択します。必要なモデルがリストにない場合は、`Advanced`オプションを切り替えて、正しいプレフィックスを付けて`Custom Model`テキストボックスに入力します。
|
||||
3. 選択したプロバイダーに対応する`API Key`を入力します。
|
||||
4. `Save Changes`をクリックして設定を適用します。
|
||||
|
||||
### GitHubトークンの設定
|
||||
|
||||
OpenHandsは、利用可能な場合、自動的に`GITHUB_TOKEN`をシェル環境にエクスポートします。これは2つの方法で行われます。
|
||||
|
||||
**ローカルインストール**: ユーザーが直接GitHubトークンを入力します。
|
||||
<details>
|
||||
<summary>GitHubトークンの設定</summary>
|
||||
|
||||
1. **Personal Access Token(PAT)の生成**:
|
||||
- GitHubで、Settings > Developer Settings > Personal Access Tokens > Tokens (classic)に移動します。
|
||||
- **New token (classic)**
|
||||
- 必要なスコープ:
|
||||
- `repo`(プライベートリポジトリの完全な制御)
|
||||
- **Fine-Grained Tokens**
|
||||
- All Repositories(特定のリポジトリを選択できますが、これはリポジトリ検索の結果に影響します)
|
||||
- Minimal Permissions(検索用に**Meta Data = Read-only**を選択し、ブランチ作成用に**Pull Requests = Read and Write**、**Content = Read and Write**を選択します)
|
||||
2. **OpenHandsにトークンを入力**:
|
||||
- 設定ボタン(歯車アイコン)をクリックします。
|
||||
- `GitHub Settings`セクションに移動します。
|
||||
- `GitHub Token`フィールドにトークンを貼り付けます。
|
||||
- `Save Changes`をクリックして変更を適用します。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>組織のトークンポリシー</summary>
|
||||
|
||||
組織のリポジトリを使用する場合は、追加の設定が必要になる場合があります。
|
||||
|
||||
1. **組織の要件を確認**:
|
||||
- 組織の管理者は、特定のトークンポリシーを適用することがあります。
|
||||
- 一部の組織では、SSOを有効にしてトークンを作成する必要があります。
|
||||
- 組織の[トークンポリシー設定](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization)を確認してください。
|
||||
2. **組織へのアクセスを確認**:
|
||||
- GitHubのトークン設定に移動します。
|
||||
- `Organization access`の下で組織を探します。
|
||||
- 必要に応じて、組織の横にある`Enable SSO`をクリックします。
|
||||
- SSOの認証プロセスを完了します。
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>トラブルシューティング</summary>
|
||||
|
||||
一般的な問題と解決策:
|
||||
|
||||
- **トークンが認識されない**:
|
||||
- トークンが設定に正しく保存されていることを確認します。
|
||||
- トークンの有効期限が切れていないことを確認します。
|
||||
- トークンに必要なスコープがあることを確認します。
|
||||
- トークンを再生成してみてください。
|
||||
|
||||
- **組織へのアクセスが拒否された**:
|
||||
- SSOが必要だが有効になっていないかどうかを確認します。
|
||||
- 組織のメンバーシップを確認します。
|
||||
- トークンポリシーがアクセスをブロックしている場合は、組織の管理者に連絡してください。
|
||||
|
||||
- **トークンが機能することを確認**:
|
||||
- トークンが有効な場合、アプリにグリーンのチェックマークが表示されます。
|
||||
- リポジトリにアクセスして、権限を確認してみてください。
|
||||
- ブラウザのコンソールでエラーメッセージを確認してください。
|
||||
</details>
|
||||
|
||||
**OpenHands Cloud**: トークンはGitHub OAuth認証を通じて取得されます。
|
||||
|
||||
<details>
|
||||
<summary>OAuth認証</summary>
|
||||
|
||||
OpenHands Cloudを使用する場合、GitHub OAuthフローは以下の権限を要求します:
|
||||
- リポジトリアクセス(読み取り/書き込み)
|
||||
- ワークフロー管理
|
||||
- 組織の読み取りアクセス
|
||||
|
||||
OpenHandsを認証するには:
|
||||
- プロンプトが表示されたら、`Sign in with GitHub`をクリックします。
|
||||
- 要求された権限を確認します。
|
||||
- OpenHandsがGitHubアカウントにアクセスすることを承認します。
|
||||
- 組織を使用している場合は、プロンプトが表示されたら組織へのアクセスを承認します。
|
||||
</details>
|
||||
|
||||
### 高度な設定
|
||||
|
||||
1. 設定ページ内で、`Advanced`オプションを切り替えて追加の設定にアクセスします。
|
||||
2. `Custom Model`テキストボックスを使用して、リストにないモデルを手動で入力します。
|
||||
3. LLMプロバイダーで必要な場合は、`Base URL`を指定します。
|
||||
|
||||
### AIとのやり取り
|
||||
|
||||
1. 入力ボックスにプロンプトを入力します。
|
||||
2. 送信ボタンをクリックするか、Enterキーを押してメッセージを送信します。
|
||||
3. AIは入力を処理し、チャットウィンドウに応答を提供します。
|
||||
4. フォローアップの質問をしたり、追加情報を提供したりして、会話を続けることができます。
|
||||
|
||||
## 効果的な使用のためのヒント
|
||||
|
||||
- [プロンプトのベストプラクティス](../prompting/prompting-best-practices)で説明されているように、要求を具体的にすることで、最も正確で役立つ応答を得ることができます。
|
||||
- ワークスペースパネルを使用して、プロジェクト構造を探索します。
|
||||
- [LLMsセクション](usage/llms/llms.md)で説明されているように、推奨モデルの1つを使用します。
|
||||
|
||||
OpenHandsのGUIモードは、AIアシスタントとのやり取りをできるだけスムーズで直感的にすることを目的としています。生産性を最大限に高めるために、ぜひその機能を探ってみてください。
|
||||
@@ -0,0 +1,55 @@
|
||||
# ヘッドレスモード
|
||||
|
||||
OpenHandsは、Webアプリケーションを起動せずに、単一のコマンドで実行できます。
|
||||
これにより、OpenHandsを使用してスクリプトを作成したり、タスクを自動化したりするのが簡単になります。
|
||||
|
||||
これは、インタラクティブで、アクティブな開発に適した[CLIモード](cli-mode)とは異なります。
|
||||
|
||||
## Pythonを使用する場合
|
||||
|
||||
PythonでOpenHandsをヘッドレスモードで実行するには:
|
||||
1. [開発セットアップの手順](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)に従っていることを確認してください。
|
||||
2. 以下のコマンドを実行します:
|
||||
```bash
|
||||
poetry run python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
モデル、APIキー、その他の設定は、環境変数[または`config.toml`ファイル](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml)を介して設定する必要があります。
|
||||
|
||||
## Dockerを使用する場合
|
||||
|
||||
DockerでOpenHandsをヘッドレスモードで実行するには:
|
||||
|
||||
1. ターミナルで以下の環境変数を設定します:
|
||||
|
||||
- `WORKSPACE_BASE`をOpenHandsが編集するディレクトリに設定 (例: `export WORKSPACE_BASE=$(pwd)/workspace`)。
|
||||
- `LLM_MODEL`を使用するモデルに設定 (例: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`)。
|
||||
- `LLM_API_KEY`をAPIキーに設定 (例: `export LLM_API_KEY="sk_test_12345"`)。
|
||||
|
||||
2. 以下のDockerコマンドを実行します:
|
||||
|
||||
```bash
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.30-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
|
||||
-e LLM_API_KEY=$LLM_API_KEY \
|
||||
-e LLM_MODEL=$LLM_MODEL \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v $WORKSPACE_BASE:/opt/workspace_base \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-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.30 \
|
||||
python -m openhands.core.main -t "write a bash script that prints hi"
|
||||
```
|
||||
|
||||
## 高度なヘッドレス設定
|
||||
|
||||
ヘッドレスモードで利用可能なすべての設定オプションを表示するには、`--help`フラグを付けてPythonコマンドを実行します。
|
||||
|
||||
### 追加のログ
|
||||
|
||||
ヘッドレスモードでエージェントのすべてのアクションをログに記録するには、ターミナルで`export LOG_ALL_EVENTS=true`を実行します。
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
# Persistance des données de session
|
||||
|
||||
Avec l'installation standard, les données de session sont stockées en mémoire. Actuellement, si le service OpenHands est redémarré,
|
||||
les sessions précédentes deviennent invalides (un nouveau secret est généré) et ne sont donc pas récupérables.
|
||||
|
||||
## Comment persister les données de session
|
||||
|
||||
### Workflow de développement
|
||||
Dans le fichier `config.toml`, spécifiez ce qui suit :
|
||||
```
|
||||
[core]
|
||||
...
|
||||
file_store="local"
|
||||
file_store_path="/absolute/path/to/openhands/cache/directory"
|
||||
jwt_secret="secretpass"
|
||||
```
|
||||
@@ -0,0 +1,55 @@
|
||||
# OpenHandsの実行
|
||||
|
||||
## システム要件
|
||||
|
||||
* Docker バージョン26.0.0+またはDocker Desktop 4.31.0+
|
||||
* LinuxまたはMac OSを使用する必要があります
|
||||
* Windowsを使用している場合は、[WSL](https://learn.microsoft.com/en-us/windows/wsl/install)を使用する必要があります
|
||||
|
||||
## アプリケーションの起動
|
||||
|
||||
OpenHandsを実行する最も簡単な方法は、Dockerを使用することです。
|
||||
|
||||
```bash
|
||||
docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
|
||||
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.29
|
||||
```
|
||||
|
||||
また、[ヘッドレススクリプトモード](https://docs.all-hands.dev/modules/usage/how-to/headless-mode)、[対話型CLI](https://docs.all-hands.dev/modules/usage/how-to/cli-mode)、または[OpenHands GitHub Action](https://docs.all-hands.dev/modules/usage/how-to/github-action)としても実行できます。
|
||||
|
||||
## 設定
|
||||
|
||||
上記のコマンドを実行すると、OpenHandsは[http://localhost:3000](http://localhost:3000)で動作します。
|
||||
|
||||
OpenHandsを起動すると、設定モーダルウィンドウが表示されます。`LLMプロバイダー`と`LLMモデル`を選択し、対応する`APIキー`を入力する**必要があります**。
|
||||
これらの設定は、UIの`設定`ボタン(歯車アイコン)を選択することでいつでも変更できます。
|
||||
|
||||
必要な`LLMモデル`がリストに存在しない場合は、`詳細オプション`を有効にして、
|
||||
`カスタムモデル`テキストボックスに適切なプレフィックスを付けて手動で入力できます。
|
||||
`詳細オプション`では、必要に応じて`ベースURL`も指定できます。
|
||||
|
||||
<div style={{ display: 'flex', justifyContent: 'center', gap: '20px' }}>
|
||||
<img src="/img/settings-screenshot.png" alt="settings-modal" width="340" />
|
||||
<img src="/img/settings-advanced.png" alt="settings-modal" width="335" />
|
||||
</div>
|
||||
|
||||
## バージョン
|
||||
|
||||
上記のコマンドは、OpenHandsの最新の安定版を取得します。他のオプションもあります:
|
||||
- 特定のバージョンを使用する場合は、`docker.all-hands.dev/all-hands-ai/openhands:$VERSION`を使用し、$VERSIONをバージョン番号に置き換えてください。
|
||||
- semverを使用しており、メジャー、マイナー、パッチバージョンのタグを公開しています。したがって、`0.9`は最新の`0.9.x`バージョンを、`0`は最新の`0.x.x`バージョンを指します。
|
||||
- 最新の開発バージョンを使用する場合は、`docker.all-hands.dev/all-hands-ai/openhands:main`を使用できます。このバージョンは不安定で、テストまたは開発目的でのみ推奨されます。
|
||||
|
||||
安定性要件と必要な機能に応じて、最適なタグを選択できます。
|
||||
|
||||
開発ワークフローについては、[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)を参照してください。
|
||||
|
||||
問題がありますか?[トラブルシューティングガイド](https://docs.all-hands.dev/modules/usage/troubleshooting)をご確認ください。
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# 💻 OpenHands
|
||||
|
||||
OpenHandsは、複雑なエンジニアリングタスクを実行し、ソフトウェア開発プロジェクトでユーザーと積極的に協力できる**自律型AIソフトウェアエンジニア**です。
|
||||
このプロジェクトは完全にオープンソースなので、自由に使用・改変することができます。
|
||||
|
||||
:::tip
|
||||
OpenHandsのソースコードを[GitHub](https://github.com/All-Hands-AI/OpenHands)で確認するか、コミュニティに参加してください!
|
||||
|
||||
<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"
|
||||
alt="Contributors"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://github.com/All-Hands-AI/OpenHands/network/members">
|
||||
<img
|
||||
src="https://img.shields.io/github/forks/All-Hands-AI/OpenHands?style=for-the-badge"
|
||||
alt="Forks"
|
||||
/>
|
||||
</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"
|
||||
alt="Stargazers"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://github.com/All-Hands-AI/OpenHands/issues">
|
||||
<img
|
||||
src="https://img.shields.io/github/issues/All-Hands-AI/OpenHands?style=for-the-badge"
|
||||
alt="Issues"
|
||||
/>
|
||||
</a>
|
||||
<br></br>
|
||||
<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"
|
||||
alt="MIT License"
|
||||
/>
|
||||
</a>
|
||||
<br></br>
|
||||
<a href="https://join.slack.com/t/openhands-ai/shared_invite/zt-2ngejmfw6-9gW4APWOC9XUp1n~SiQ6iw">
|
||||
<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>
|
||||
:::
|
||||
|
||||
## 🛠️ はじめに
|
||||
|
||||
OpenHandsを実行する最も簡単な方法は、Dockerコンテナ内で実行することです。最新バージョンのDocker(`26.0.0`)で最もよく動作します。
|
||||
Linux、Mac OS、またはWindows上のWSLを使用する必要があります。
|
||||
|
||||
OpenHandsをDockerコンテナで起動するには、ターミナルで以下のコマンドを実行します:
|
||||
|
||||
:::warning
|
||||
以下のコマンドを実行すると、`./workspace`内のファイルが変更または削除される可能性があります。
|
||||
:::
|
||||
|
||||
```bash
|
||||
WORKSPACE_BASE=$(pwd)/workspace
|
||||
docker run -it \
|
||||
--pull=always \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
|
||||
-v $WORKSPACE_BASE:/opt/workspace_base \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
--name openhands-app-$(date +%Y%m%d%H%M%S) \
|
||||
ghcr.io/all-hands-ai/openhands:main
|
||||
```
|
||||
|
||||
OpenHandsは[http://localhost:3000](http://localhost:3000)で動作し、`./workspace`にアクセスできます。OpenHandsにコードを操作させるには、そのコードを`./workspace`に配置してください。
|
||||
|
||||
OpenHandsはこのワークスペースフォルダにのみアクセスできます。Dockerの安全なサンドボックス内で実行されるため、システムの他の部分には影響を与えません。
|
||||
|
||||
:::tip
|
||||
最新の**(不安定!)**バージョンを使用したい場合は、イメージとして`ghcr.io/all-hands-ai/openhands:main`を使用できます(最後の行)。
|
||||
:::
|
||||
|
||||
開発ワークフローについては、[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)を参照してください。
|
||||
|
||||
問題がありますか?[トラブルシューティングガイド](https://docs.all-hands.dev/modules/usage/troubleshooting)をご確認ください。
|
||||
|
||||
:::warning
|
||||
OpenHandsは現在開発中ですが、アルファ版を実行してエンドツーエンドのシステムを動作させることができます。
|
||||
:::
|
||||
|
||||
[contributors-shield]: https://img.shields.io/github/contributors/All-Hands-AI/OpenHands?style=for-the-badge
|
||||
[contributors-url]: https://github.com/All-Hands-AI/OpenHands/graphs/contributors
|
||||
[forks-shield]: https://img.shields.io/github/forks/All-Hands-AI/OpenHands?style=for-the-badge
|
||||
[forks-url]: https://github.com/All-Hands-AI/OpenHands/network/members
|
||||
[stars-shield]: https://img.shields.io/github/stars/All-Hands-AI/OpenHands?style=for-the-badge
|
||||
[stars-url]: https://github.com/All-Hands-AI/OpenHands/stargazers
|
||||
[issues-shield]: https://img.shields.io/github/issues/All-Hands-AI/OpenHands?style=for-the-badge
|
||||
[issues-url]: https://github.com/All-Hands-AI/OpenHands/issues
|
||||
[license-shield]: https://img.shields.io/github/license/All-Hands-AI/OpenHands?style=for-the-badge
|
||||
[license-url]: https://github.com/All-Hands-AI/OpenHands/blob/main/LICENSE
|
||||
@@ -0,0 +1,72 @@
|
||||
# 主な機能
|
||||
|
||||

|
||||
|
||||
## 1. ワークスペース
|
||||
|
||||
ワークスペース機能は、以下の主要な機能を備えた包括的な開発環境を提供します:
|
||||
|
||||
* ファイルエクスプローラー:プロジェクトのファイルとディレクトリの閲覧、表示、管理
|
||||
* プロジェクト管理:異なるプロジェクトのインポート、作成、ナビゲーション
|
||||
* 統合開発ツール:様々な開発ワークフローとのシームレスな統合
|
||||
* ファイル操作:
|
||||
* ファイル内容の表示
|
||||
* 新規ファイルとフォルダの作成
|
||||
* ファイルのアップロードとダウンロード
|
||||
* 基本的なファイル操作
|
||||
|
||||
## 2. Jupyterノートブック
|
||||
|
||||
Jupyterノートブック機能は、インタラクティブなコーディングとデータ分析環境を提供します:
|
||||
|
||||
* インタラクティブなコードセル:セルベースのインターフェースでPythonコードを実行
|
||||
* 入出力の追跡:コード入力とその出力の履歴を保持
|
||||
* 永続的なセッション:セル間でコード実行コンテキストを保持
|
||||
* 様々なPython操作とデータ分析タスクをサポート
|
||||
* リアルタイムのコード実行と結果の可視化
|
||||
|
||||
## 3. ブラウザ(ベータ)
|
||||
|
||||
ブラウザ機能は、Web操作機能を提供します:
|
||||
|
||||
* Webページナビゲーション:アプリケーション内でウェブサイトを開いて閲覧
|
||||
* スクリーンショット取得:Webページのスクリーンショットを自動生成
|
||||
* インタラクション機能:
|
||||
* 要素のクリック
|
||||
* フォームの入力
|
||||
* ページのスクロール
|
||||
* Web内容のナビゲーション
|
||||
* 15種類のブラウザ操作機能をサポート
|
||||
|
||||
## 4. ターミナル
|
||||
|
||||
ターミナル機能は、アプリケーション内でコマンドラインインターフェースを提供します:
|
||||
|
||||
* シェルコマンドの実行:bashとシステムコマンドを実行
|
||||
* コマンド履歴:過去のコマンドを追跡して呼び出し
|
||||
* 環境との対話:システムのコマンドラインと直接対話
|
||||
* 様々なプログラミングとシステム管理タスクをサポート
|
||||
|
||||
## 5. チャット / AI会話
|
||||
|
||||
チャットインターフェースは、AIを活用した会話体験を提供します:
|
||||
|
||||
* インタラクティブなAIアシスタント:自然言語での会話に参加
|
||||
* コンテキストを理解した応答:開発関連の質問を理解して応答
|
||||
* アクション提案:タスクに対する実行可能な推奨事項を提供
|
||||
* 会話管理:異なる会話スレッドの作成、削除、管理
|
||||
|
||||
## 6. アプリケーション(ベータ)
|
||||
|
||||
メインアプリケーションインターフェースは、これらすべての機能を統合します:
|
||||
|
||||
* 統合ワークスペース:ワークスペース、ブラウザ、ターミナル、AIチャットのシームレスな統合
|
||||
* カスタマイズ可能なレイアウト:異なる機能パネルの配置をカスタマイズ
|
||||
* 状態管理:異なる機能間でコンテキストと状態を維持
|
||||
* セキュリティとプライバシー制御:アプリケーションの設定と権限を管理
|
||||
|
||||
### 追加情報
|
||||
|
||||
* アプリケーションは現在ベータ版で、継続的な改善と機能追加が行われています
|
||||
* 様々な開発ワークフローとAIアシストコーディングをサポート
|
||||
* 統合ツールとAIアシスタンスを通じて開発者の生産性を向上するように設計
|
||||
@@ -0,0 +1,82 @@
|
||||
# 🤖 LLMバックエンド
|
||||
|
||||
OpenHandsは、LiteLLMがサポートするすべてのLLMに接続できます。ただし、機能するには強力なモデルが必要です。
|
||||
|
||||
## モデルの推奨事項
|
||||
|
||||
コーディングタスクに対する言語モデルの評価(SWE-benchデータセットを使用)に基づいて、モデル選択に関するいくつかの推奨事項を提供できます。分析の一部は、[LLMを比較したこのブログ記事](https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed)と[より最近の結果を含むこのブログ記事](https://www.all-hands.dev/blog/openhands-codeact-21-an-open-state-of-the-art-software-development-agent)で確認できます。
|
||||
|
||||
モデルを選択する際は、出力の品質とコストの両方を考慮してください。結果の要約は以下の通りです:
|
||||
|
||||
* Claude 3.5 Sonnetが圧倒的に優れており、OpenHandsのデフォルトエージェントでSWE-Bench Verifiedの53%の解決率を達成しています。
|
||||
* GPT-4oは遅れを取っており、o1-miniは実際にGPT-4oよりもわずかに低いパフォーマンスを示しました。結果を少し分析したところ、o1は時々「考えすぎ」て、タスクを完了できるのに追加の環境設定タスクを実行していたようです。
|
||||
* 最後に、最も強力なオープンモデルはLlama 3.1 405 BとDeepseek-v2.5で、合理的なパフォーマンスを示し、一部のクローズドモデルを上回りました。
|
||||
|
||||
詳細については、[完全な記事](https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed)を参照してください。
|
||||
|
||||
これらの結果とコミュニティからのフィードバックに基づいて、以下のモデルがOpenHandsで合理的に機能することが確認されています:
|
||||
|
||||
* claude-3-5-sonnet(推奨)
|
||||
* gpt-4 / gpt-4o
|
||||
* llama-3.1-405b
|
||||
* deepseek-v2.5
|
||||
|
||||
:::warning prudence
|
||||
OpenHandsは、設定したLLMに多くのプロンプトを送信します。これらのLLMのほとんどは有料なので、支出制限を設定し、使用状況を監視してください。
|
||||
:::
|
||||
|
||||
リストにない特定のLLMでOpenHandsの実行に成功した場合は、検証済みリストに追加してください。また、同じプロバイダーとLLMを使用する他のユーザーを支援するため、設定プロセスを共有するPRを開くことをお勧めします!
|
||||
|
||||
利用可能なプロバイダーとモデルの完全なリストについては、[litellmのドキュメント](https://docs.litellm.ai/docs/providers)を参照してください。
|
||||
|
||||
:::note remarque
|
||||
現在のほとんどのローカルおよびオープンソースモデルは、それほど強力ではありません。このようなモデルを使用する場合、メッセージ間の長い待機時間、品質の低い応答、または不正なJSONに関するエラーが発生する可能性があります。OpenHandsは、それを駆動するモデルと同じくらい強力にしかなりません。ただし、機能するモデルを見つけた場合は、上記の検証済みリストに追加してください。
|
||||
:::
|
||||
|
||||
## LLM設定
|
||||
|
||||
以下の項目は、OpenHandsのUIで設定メニューから設定できます:
|
||||
|
||||
* `LLMプロバイダー`
|
||||
* `LLMモデル`
|
||||
* `APIキー`
|
||||
* `ベースURL`(`詳細設定`から)
|
||||
|
||||
一部のLLM/プロバイダーで必要となる可能性があるが、UIでは設定できないパラメータがあります。これらは代わりに、[docker runコマンド](./installation#start-the-app)に`-e`を使用して環境変数として渡すことができます:
|
||||
|
||||
* `LLM_API_VERSION`
|
||||
* `LLM_EMBEDDING_MODEL`
|
||||
* `LLM_EMBEDDING_DEPLOYMENT_NAME`
|
||||
* `LLM_DROP_PARAMS`
|
||||
* `LLM_DISABLE_VISION`
|
||||
* `LLM_CACHING_PROMPT`
|
||||
|
||||
特定のモデルプロバイダーでOpenHandsを実行するためのガイドがいくつかあります:
|
||||
|
||||
* [Azure](./llms/azure-llms)
|
||||
* [Google](./llms/google-llms)
|
||||
* [Groq](./llms/groq)
|
||||
* [LiteLLM Proxy](./llms/litellm-proxy)
|
||||
* [OpenAI](./llms/openai-llms)
|
||||
* [OpenRouter](./llms/openrouter)
|
||||
|
||||
### APIリトライとレート制限
|
||||
|
||||
LLMプロバイダーは通常、レート制限を持っており、時には非常に低い制限で、リトライが必要になる場合があります。OpenHandsは、レート制限エラー(エラーコード429)、API接続エラー、またはその他の一時的なエラーを受信した場合、自動的にリクエストを再試行します。
|
||||
|
||||
使用しているプロバイダーのニーズに応じて、これらのオプションをカスタマイズできます。プロバイダーのドキュメントを確認し、以下の環境変数を設定してリトライ回数とリトライ間の待機時間を制御してください:
|
||||
|
||||
* `LLM_NUM_RETRIES`(デフォルト8)
|
||||
* `LLM_RETRY_MIN_WAIT`(デフォルト15秒)
|
||||
* `LLM_RETRY_MAX_WAIT`(デフォルト120秒)
|
||||
* `LLM_RETRY_MULTIPLIER`(デフォルト2)
|
||||
|
||||
OpenHandsを開発モードで実行している場合、これらのオプションを`config.toml`ファイルで設定することもできます:
|
||||
|
||||
```toml
|
||||
[llm]
|
||||
num_retries = 8
|
||||
retry_min_wait = 15
|
||||
retry_max_wait = 120
|
||||
retry_multiplier = 2
|
||||
```
|
||||
@@ -0,0 +1,38 @@
|
||||
# Azure
|
||||
|
||||
OpenHands は LiteLLM を使用して Azure のチャットモデルを呼び出します。Azure をプロバイダとして使用する方法については、[こちら](https://docs.litellm.ai/docs/providers/azure)のドキュメントをご覧ください。
|
||||
|
||||
## Azure OpenAI 設定
|
||||
|
||||
OpenHands を実行する際には、以下の環境変数を [docker run コマンド](../installation#running-openhands) で `-e` を使用して設定する必要があります。
|
||||
|
||||
```
|
||||
LLM_API_VERSION="<api-version>" # 例: "2023-05-15"
|
||||
```
|
||||
|
||||
例:
|
||||
```bash
|
||||
docker run -it --pull=always \
|
||||
-e LLM_API_VERSION="2023-05-15"
|
||||
...
|
||||
```
|
||||
|
||||
その後、OpenHands UI の設定で以下を行います。
|
||||
|
||||
:::note
|
||||
Azure の deployments ページで ChatGPT のデプロイメント名を確認する必要があります。以下では <deployment-name> と表記しています。
|
||||
:::
|
||||
|
||||
1. `Advanced` オプションを有効にします。
|
||||
2. 以下を設定します:
|
||||
- `Custom Model` を azure/<deployment-name> に設定
|
||||
- `Base URL` を Azure API の Base URL に設定 (例: `https://example-endpoint.openai.azure.com`)
|
||||
- `API Key` を Azure API キーに設定
|
||||
|
||||
### Azure OpenAI 設定
|
||||
|
||||
OpenHands を実行する際には、以下の環境変数を [docker run コマンド](../installation#running-openhands) で `-e` を使用して設定します。
|
||||
|
||||
```
|
||||
LLM_API_VERSION="<api-version>" # 例: "2024-02-15-preview"
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# Azure OpenAI LLM
|
||||
|
||||
## 補完
|
||||
|
||||
OpenHandsはLiteLLMを使用して補完リクエストを行います。Azureに関するドキュメントは[こちら](https://docs.litellm.ai/docs/providers/azure)にあります。
|
||||
|
||||
### Azure OpenAI の設定
|
||||
|
||||
OpenHands Dockerイメージを実行する際には、以下の環境変数を `-e` を使用して設定する必要があります:
|
||||
|
||||
```
|
||||
LLM_BASE_URL="<azure-api-base-url>" # 例: "https://openai-gpt-4-test-v-1.openai.azure.com/"
|
||||
LLM_API_KEY="<azure-api-key>"
|
||||
LLM_MODEL="azure/<your-gpt-deployment-name>"
|
||||
LLM_API_VERSION = "<api-version>" # 例: "2024-02-15-preview"
|
||||
```
|
||||
|
||||
:::note
|
||||
ChatGPTデプロイメント名は、Azureのデプロイメントページで確認できます。デフォルトまたは初期状態では、チャットモデル名(例えば'GPT4-1106-preview')と同じ場合がありますが、必ずしもそうである必要はありません。OpenHandsを実行し、ブラウザに読み込まれたら、設定に移動し、モデルを次のように設定します:"azure/<your-actual-gpt-deployment-name>"。リストにない場合は、独自のテキストを入力して保存します。
|
||||
:::
|
||||
|
||||
## Embeddings
|
||||
|
||||
OpenHandsはllama-indexを使用してembeddingsを生成します。Azureに関するドキュメントは[こちら](https://docs.llamaindex.ai/en/stable/api_reference/embeddings/azure_openai/)にあります。
|
||||
|
||||
### Azure OpenAI の設定
|
||||
|
||||
Azure OpenAI embeddingsで使用されるモデルは "text-embedding-ada-002" です。
|
||||
Azureアカウントでこのモデルの正しいデプロイメント名が必要です。
|
||||
|
||||
DockerでOpenHandsを実行する際には、以下の環境変数を `-e` を使用して設定してください:
|
||||
|
||||
```
|
||||
LLM_EMBEDDING_MODEL="azureopenai"
|
||||
LLM_EMBEDDING_DEPLOYMENT_NAME = "<your-embedding-deployment-name>" # 例: "TextEmbedding...<etc>"
|
||||
LLM_API_VERSION = "<api-version>" # 例: "2024-02-15-preview"
|
||||
```
|
||||
@@ -0,0 +1,106 @@
|
||||
# カスタムLLM設定
|
||||
|
||||
OpenHandsでは、`config.toml`ファイルで複数の名前付きLLM設定を定義できます。この機能により、高品質な応答が不要なタスクには低コストのモデルを使用したり、特定のエージェントに対して異なるパラメータを持つ異なるモデルを使用したりするなど、異なる用途に応じて異なるLLM設定を使用できます。
|
||||
|
||||
## 仕組み
|
||||
|
||||
名前付きLLM設定は、`config.toml`ファイルで`llm.`で始まるセクションを使用して定義されます。例:
|
||||
|
||||
```toml
|
||||
# デフォルトのLLM設定
|
||||
[llm]
|
||||
model = "gpt-4"
|
||||
api_key = "あなたのAPIキー"
|
||||
temperature = 0.0
|
||||
|
||||
# 低コストモデル用のカスタムLLM設定
|
||||
[llm.gpt3]
|
||||
model = "gpt-3.5-turbo"
|
||||
api_key = "あなたのAPIキー"
|
||||
temperature = 0.2
|
||||
|
||||
# 異なるパラメータを持つ別のカスタム設定
|
||||
[llm.high-creativity]
|
||||
model = "gpt-4"
|
||||
api_key = "あなたのAPIキー"
|
||||
temperature = 0.8
|
||||
top_p = 0.9
|
||||
```
|
||||
|
||||
各名前付き設定は、デフォルトの`[llm]`セクションからすべてのパラメータを継承し、これらのパラメータを上書きできます。必要な数のカスタム設定を定義できます。
|
||||
|
||||
## カスタム設定の使用
|
||||
|
||||
### エージェントでの使用
|
||||
|
||||
エージェントの設定セクションで`llm_config`パラメータを設定することで、エージェントが使用するLLM設定を指定できます:
|
||||
|
||||
```toml
|
||||
[agent.RepoExplorerAgent]
|
||||
# このエージェントには低コストのGPT-3設定を使用
|
||||
llm_config = 'gpt3'
|
||||
|
||||
[agent.CodeWriterAgent]
|
||||
# このエージェントには高創造性の設定を使用
|
||||
llm_config = 'high-creativity'
|
||||
```
|
||||
|
||||
### 設定オプション
|
||||
|
||||
各名前付きLLM設定は、デフォルトのLLM設定と同じすべてのオプションをサポートしています。これらには以下が含まれます:
|
||||
|
||||
- モデルの選択(`model`)
|
||||
- API設定(`api_key`、`base_url`など)
|
||||
- モデルパラメータ(`temperature`、`top_p`など)
|
||||
- リトライパラメータ(`num_retries`、`retry_multiplier`など)
|
||||
- トークン制限(`max_input_tokens`、`max_output_tokens`)
|
||||
- その他すべてのLLM設定オプション
|
||||
|
||||
利用可能なオプションの完全なリストについては、[設定オプション](../configuration-options)のドキュメントのLLM設定セクションを参照してください。
|
||||
|
||||
## ユースケース
|
||||
|
||||
カスタムLLM設定は、以下のようなシナリオで特に有用です:
|
||||
|
||||
- **コスト最適化**:リポジトリの探索やシンプルなファイル操作など、高品質な応答が不要なタスクには低コストのモデルを使用
|
||||
- **タスク固有の調整**:異なるレベルの創造性や決定論的な応答が必要なタスクに対して、異なるtemperatureやtop_p値を設定
|
||||
- **異なるプロバイダー**:異なるタスクに対して異なるLLMプロバイダーやAPIエンドポイントを使用
|
||||
- **テストと開発**:開発とテスト中に異なるモデル設定を簡単に切り替え
|
||||
|
||||
## 例:コスト最適化
|
||||
|
||||
コスト最適化のためのカスタムLLM設定の実践的な例:
|
||||
|
||||
```toml
|
||||
# 高品質な応答用のGPT-4を使用するデフォルト設定
|
||||
[llm]
|
||||
model = "gpt-4"
|
||||
api_key = "あなたのAPIキー"
|
||||
temperature = 0.0
|
||||
|
||||
# リポジトリ探索用の低コスト設定
|
||||
[llm.repo-explorer]
|
||||
model = "gpt-3.5-turbo"
|
||||
temperature = 0.2
|
||||
|
||||
# コード生成用の設定
|
||||
[llm.code-gen]
|
||||
model = "gpt-4"
|
||||
temperature = 0.0
|
||||
max_output_tokens = 2000
|
||||
|
||||
[agent.RepoExplorerAgent]
|
||||
llm_config = 'repo-explorer'
|
||||
|
||||
[agent.CodeWriterAgent]
|
||||
llm_config = 'code-gen'
|
||||
```
|
||||
|
||||
この例では:
|
||||
- リポジトリ探索は主にコードの理解とナビゲーションなので、低コストモデルを使用
|
||||
- コード生成は、より大きなコードブロックを生成するためにGPT-4とより高いトークン制限を使用
|
||||
- デフォルト設定は他のタスクで引き続き利用可能
|
||||
|
||||
:::note
|
||||
カスタムLLM設定は、`main.py`または`cli.py`を介して開発モードでOpenHandsを使用する場合にのみ利用可能です。`docker run`を介して実行する場合は、標準の設定オプションを使用してください。
|
||||
:::
|
||||
@@ -0,0 +1,31 @@
|
||||
以下は、指定されたコンテンツの日本語訳です。
|
||||
|
||||
# Google Gemini/Vertex
|
||||
|
||||
OpenHandsはLiteLLMを使用して、Googleのチャットモデルを呼び出します。Googleをプロバイダとして使用する方法については、以下のドキュメントを参照してください。
|
||||
|
||||
- [Gemini - Google AI Studio](https://docs.litellm.ai/docs/providers/gemini)
|
||||
- [VertexAI - Google Cloud Platform](https://docs.litellm.ai/docs/providers/vertex)
|
||||
|
||||
## Gemini - Google AI Studio の設定
|
||||
|
||||
OpenHandsを実行する際、設定画面で以下を設定する必要があります。
|
||||
- `LLM Provider` を `Gemini` に設定
|
||||
- `LLM Model` を使用するモデルに設定
|
||||
モデルがリストにない場合は、`Advanced` オプションを切り替えて、`Custom Model` に入力します(例: `gemini/gemini-2.0-flash` のように gemini/<model-name>)。
|
||||
- `API Key` を Gemini API キーに設定
|
||||
|
||||
## VertexAI - Google Cloud Platform の設定
|
||||
|
||||
Google Cloud Platform 経由で Vertex AI を使用して OpenHands を実行するには、[docker run コマンド](../installation#running-openhands)で `-e` を使用して以下の環境変数を設定する必要があります。
|
||||
|
||||
```
|
||||
GOOGLE_APPLICATION_CREDENTIALS="<json-dump-of-gcp-service-account-json>"
|
||||
VERTEXAI_PROJECT="<your-gcp-project-id>"
|
||||
VERTEXAI_LOCATION="<your-gcp-location>"
|
||||
```
|
||||
|
||||
その後、設定画面で以下を設定します。
|
||||
- `LLM Provider` を `VertexAI` に設定
|
||||
- `LLM Model` を使用するモデルに設定
|
||||
モデルがリストにない場合は、`Advanced` オプションを切り替えて、`Custom Model` に入力します(例: vertex_ai/<model-name>)。
|
||||
@@ -0,0 +1,28 @@
|
||||
# Google Gemini/Vertex LLM
|
||||
|
||||
## 補完
|
||||
|
||||
OpenHandsはLiteLLMを使用して補完リクエストを行います。以下のリソースは、OpenHandsをGoogleのLLMと一緒に使用する際に関連があります。
|
||||
|
||||
- [Gemini - Google AI Studio](https://docs.litellm.ai/docs/providers/gemini)
|
||||
- [VertexAI - Google Cloud Platform](https://docs.litellm.ai/docs/providers/vertex)
|
||||
|
||||
### Gemini - Google AI Studioの設定
|
||||
|
||||
OpenHandsのDockerイメージを実行する際にGoogle AI Studio経由でGeminiを使用するには、以下の環境変数を`-e`を使って設定する必要があります。
|
||||
|
||||
```
|
||||
GEMINI_API_KEY="<your-google-api-key>"
|
||||
LLM_MODEL="gemini/gemini-1.5-pro"
|
||||
```
|
||||
|
||||
### Vertex AI - Google Cloud Platformの設定
|
||||
|
||||
OpenHandsのDockerイメージを実行する際にGoogle Cloud Platform経由でVertex AIを使用するには、以下の環境変数を`-e`を使って設定する必要があります。
|
||||
|
||||
```
|
||||
GOOGLE_APPLICATION_CREDENTIALS="<gcp-service-account-json-dump>"
|
||||
VERTEXAI_PROJECT="<your-gcp-project-id>"
|
||||
VERTEXAI_LOCATION="<your-gcp-location>"
|
||||
LLM_MODEL="vertex_ai/<desired-llm-model>"
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
# Groq
|
||||
|
||||
OpenHandsは、GroqのチャットモデルへのAPIコールにLiteLLMを使用します。Groqをプロバイダーとして使用する方法については、[こちら](https://docs.litellm.ai/docs/providers/groq)のドキュメントを参照してください。
|
||||
|
||||
## 設定
|
||||
|
||||
OpenHandsを実行する際、OpenHandsのUIで設定メニューから以下の項目を設定する必要があります:
|
||||
|
||||
* `LLMプロバイダー`を`Groq`に設定
|
||||
* `LLMモデル`を使用するモデルに設定。[Groqがホストするモデルのリストはこちら](https://console.groq.com/docs/models)を参照してください。モデルがリストにない場合は、`詳細設定`を有効にし、`カスタムモデル`に入力してください(例:groq/<model-name>として`groq/llama3-70b-8192`)。
|
||||
* `APIキー`をGroq APIキーに設定。Groq APIキーの確認または作成については、[こちら](https://console.groq.com/keys)を参照してください。
|
||||
|
||||
## OpenAI互換エンドポイントとしてのGroqの使用
|
||||
|
||||
Groqのチャット補完エンドポイントは[主にOpenAI互換](https://console.groq.com/docs/openai)です。そのため、他のOpenAI互換エンドポイントと同様の方法でGroqのモデルにアクセスできます。OpenHandsのUIで設定メニューから以下の項目を設定します:
|
||||
|
||||
* `詳細設定`を有効にする
|
||||
* `カスタムモデル`にプレフィックス`openai/`と使用するモデルを設定(例:`openai/llama3-70b-8192`)
|
||||
* `ベースURL`を`https://api.groq.com/openai/v1`に設定
|
||||
* `APIキー`をGroq APIキーに設定
|
||||
@@ -0,0 +1,20 @@
|
||||
# LiteLLM プロキシ
|
||||
|
||||
OpenHandsは、様々なLLMプロバイダーにアクセスするために[LiteLLMプロキシ](https://docs.litellm.ai/docs/proxy/quick_start)の使用をサポートしています。
|
||||
|
||||
## 設定
|
||||
|
||||
OpenHandsでLiteLLMプロキシを使用するには、以下の手順が必要です:
|
||||
|
||||
1. LiteLLMプロキシサーバーを設定する([LiteLLMのドキュメント](https://docs.litellm.ai/docs/proxy/quick_start)を参照)
|
||||
2. OpenHandsを実行する際、OpenHandsのUIで設定メニューから以下の項目を設定する必要があります:
|
||||
* `詳細設定`を有効にする
|
||||
* `カスタムモデル`にプレフィックス`litellm_proxy/`と使用するモデルを設定(例:`litellm_proxy/anthropic.claude-3-5-sonnet-20241022-v2:0`)
|
||||
* `ベースURL`をLiteLLMプロキシのURL(例:`https://your-litellm-proxy.com`)に設定
|
||||
* `APIキー`をLiteLLMプロキシのAPIキーに設定
|
||||
|
||||
## サポートされているモデル
|
||||
|
||||
サポートされているモデルは、LiteLLMプロキシの設定に依存します。OpenHandsは、LiteLLMプロキシが処理するように設定されているすべてのモデルをサポートします。
|
||||
|
||||
利用可能なモデルとその名前のリストについては、LiteLLMプロキシの設定を参照してください。
|
||||
@@ -0,0 +1,82 @@
|
||||
# 🤖 LLMバックエンド
|
||||
|
||||
OpenHandsは、LiteLLMがサポートするすべてのLLMに接続できます。ただし、機能するには強力なモデルが必要です。
|
||||
|
||||
## モデルの推奨事項
|
||||
|
||||
コーディングタスクに対する言語モデルの評価(SWE-benchデータセットを使用)に基づいて、モデル選択に関するいくつかの推奨事項を提供できます。分析の一部は、[LLMを比較したこのブログ記事](https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed)と[より最近の結果を含むこのブログ記事](https://www.all-hands.dev/blog/openhands-codeact-21-an-open-state-of-the-art-software-development-agent)で確認できます。
|
||||
|
||||
モデルを選択する際は、出力の品質とコストの両方を考慮してください。結果の要約は以下の通りです:
|
||||
|
||||
- Claude 3.5 Sonnetが圧倒的に優れており、OpenHandsのデフォルトエージェントでSWE-Bench Verifiedの53%の解決率を達成しています。
|
||||
- GPT-4oは遅れを取っており、o1-miniは実際にGPT-4oよりもわずかに低いパフォーマンスを示しました。結果を少し分析したところ、o1は時々「考えすぎ」て、タスクを完了できるのに追加の環境設定タスクを実行していたようです。
|
||||
- 最後に、最も強力なオープンモデルはLlama 3.1 405 BとDeepseek-v2.5で、合理的なパフォーマンスを示し、一部のクローズドモデルを上回りました。
|
||||
|
||||
詳細については、[完全な記事](https://www.all-hands.dev/blog/evaluation-of-llms-as-coding-agents-on-swe-bench-at-30x-speed)を参照してください。
|
||||
|
||||
これらの結果とコミュニティからのフィードバックに基づいて、以下のモデルがOpenHandsで合理的に機能することが確認されています:
|
||||
|
||||
- claude-3-5-sonnet(推奨)
|
||||
- gpt-4 / gpt-4o
|
||||
- llama-3.1-405b
|
||||
- deepseek-v2.5
|
||||
|
||||
:::warning
|
||||
OpenHandsは、設定したLLMに多くのプロンプトを送信します。これらのLLMのほとんどは有料なので、支出制限を設定し、使用状況を監視してください。
|
||||
:::
|
||||
|
||||
リストにない特定のLLMでOpenHandsの実行に成功した場合は、検証済みリストに追加してください。また、同じプロバイダーとLLMを使用する他のユーザーを支援するため、設定プロセスを共有するPRを開くことをお勧めします!
|
||||
|
||||
利用可能なプロバイダーとモデルの完全なリストについては、[litellmのドキュメント](https://docs.litellm.ai/docs/providers)を参照してください。
|
||||
|
||||
:::note
|
||||
現在のほとんどのローカルおよびオープンソースモデルは、それほど強力ではありません。このようなモデルを使用する場合、メッセージ間の長い待機時間、品質の低い応答、または不正なJSONに関するエラーが発生する可能性があります。OpenHandsは、それを駆動するモデルと同じくらい強力にしかなりません。ただし、機能するモデルを見つけた場合は、上記の検証済みリストに追加してください。
|
||||
:::
|
||||
|
||||
## LLM設定
|
||||
|
||||
以下の項目は、OpenHandsのUIで設定メニューから設定できます:
|
||||
|
||||
- `LLMプロバイダー`
|
||||
- `LLMモデル`
|
||||
- `APIキー`
|
||||
- `ベースURL`(`詳細設定`から)
|
||||
|
||||
一部のLLM/プロバイダーで必要となる可能性があるが、UIでは設定できないパラメータがあります。これらは代わりに、[docker runコマンド](/modules/usage/installation#start-the-app)に`-e`を使用して環境変数として渡すことができます:
|
||||
|
||||
- `LLM_API_VERSION`
|
||||
- `LLM_EMBEDDING_MODEL`
|
||||
- `LLM_EMBEDDING_DEPLOYMENT_NAME`
|
||||
- `LLM_DROP_PARAMS`
|
||||
- `LLM_DISABLE_VISION`
|
||||
- `LLM_CACHING_PROMPT`
|
||||
|
||||
特定のモデルプロバイダーでOpenHandsを実行するためのガイドがいくつかあります:
|
||||
|
||||
- [Azure](llms/azure-llms)
|
||||
- [Google](llms/google-llms)
|
||||
- [Groq](llms/groq)
|
||||
- [LiteLLM Proxy](llms/litellm-proxy)
|
||||
- [OpenAI](llms/openai-llms)
|
||||
- [OpenRouter](llms/openrouter)
|
||||
|
||||
### APIリトライとレート制限
|
||||
|
||||
LLMプロバイダーは通常、レート制限を持っており、時には非常に低い制限で、リトライが必要になる場合があります。OpenHandsは、レート制限エラー(エラーコード429)、API接続エラー、またはその他の一時的なエラーを受信した場合、自動的にリクエストを再試行します。
|
||||
|
||||
使用しているプロバイダーのニーズに応じて、これらのオプションをカスタマイズできます。プロバイダーのドキュメントを確認し、以下の環境変数を設定してリトライ回数とリトライ間の待機時間を制御してください:
|
||||
|
||||
- `LLM_NUM_RETRIES`(デフォルト8)
|
||||
- `LLM_RETRY_MIN_WAIT`(デフォルト15秒)
|
||||
- `LLM_RETRY_MAX_WAIT`(デフォルト120秒)
|
||||
- `LLM_RETRY_MULTIPLIER`(デフォルト2)
|
||||
|
||||
OpenHandsを開発モードで実行している場合、これらのオプションを`config.toml`ファイルで設定することもできます:
|
||||
|
||||
```toml
|
||||
[llm]
|
||||
num_retries = 8
|
||||
retry_min_wait = 15
|
||||
retry_max_wait = 120
|
||||
retry_multiplier = 2
|
||||
```
|
||||
@@ -0,0 +1,190 @@
|
||||
# ローカルLLMとOllama
|
||||
|
||||
:::warning
|
||||
ローカルLLMを使用する場合、OpenHandsの機能が制限される可能性があります。
|
||||
:::
|
||||
|
||||
Ollamaサーバーが起動し、実行中であることを確認してください。
|
||||
詳細な起動手順については、[こちら](https://github.com/ollama/ollama)を参照してください。
|
||||
|
||||
このガイドでは、`ollama serve`でollamaを起動したことを前提としています。ollamaを別の方法で実行している場合(例:dockerの中で)、手順を変更する必要があるかもしれません。WSLを実行している場合、デフォルトのollama設定ではdockerコンテナからのリクエストがブロックされることに注意してください。[こちら](#configuring-ollama-service-wsl-ja)を参照してください。
|
||||
|
||||
## モデルのプル
|
||||
|
||||
Ollamaモデル名は[こちら](https://ollama.com/library)で確認できます。小さな例として、`codellama:7b`モデルを使用できます。一般的に、より大きなモデルの方が性能が良くなります。
|
||||
|
||||
```bash
|
||||
ollama pull codellama:7b
|
||||
```
|
||||
|
||||
ダウンロードしたモデルは以下のように確認できます:
|
||||
|
||||
```bash
|
||||
~$ ollama list
|
||||
NAME ID SIZE MODIFIED
|
||||
codellama:7b 8fdf8f752f6e 3.8 GB 6 weeks ago
|
||||
mistral:7b-instruct-v0.2-q4_K_M eb14864c7427 4.4 GB 2 weeks ago
|
||||
starcoder2:latest f67ae0f64584 1.7 GB 19 hours ago
|
||||
```
|
||||
|
||||
## DockerでOpenHandsを実行
|
||||
|
||||
### OpenHandsの起動
|
||||
[こちら](../getting-started)の手順を使用して、DockerでOpenHandsを起動します。
|
||||
ただし、`docker run`を実行する際に、いくつかの引数を追加する必要があります:
|
||||
|
||||
```bash
|
||||
docker run # ...
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
-e LLM_OLLAMA_BASE_URL="http://host.docker.internal:11434" \
|
||||
# ...
|
||||
```
|
||||
|
||||
LLM_OLLAMA_BASE_URLはオプションです。設定すると、UIでインストール済みの利用可能なモデルを表示するために使用されます。
|
||||
|
||||
|
||||
### Webアプリケーションの設定
|
||||
|
||||
`openhands`を実行する際、OpenHands UIの設定で以下を設定する必要があります:
|
||||
- モデルを"ollama/<model-name>"に
|
||||
- ベースURLを`http://host.docker.internal:11434`に
|
||||
- APIキーはオプションで、`ollama`などの任意の文字列を使用できます。
|
||||
|
||||
|
||||
## 開発モードでOpenHandsを実行
|
||||
|
||||
### ソースからビルド
|
||||
|
||||
[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)の手順を使用して、OpenHandsをビルドします。
|
||||
`make setup-config`を実行して`config.toml`が存在することを確認してください。これにより、設定ファイルが作成されます。`config.toml`に以下を入力します:
|
||||
|
||||
```
|
||||
[core]
|
||||
workspace_base="./workspace"
|
||||
|
||||
[llm]
|
||||
embedding_model="local"
|
||||
ollama_base_url="http://localhost:11434"
|
||||
|
||||
```
|
||||
|
||||
これで完了です!`make run`でOpenHandsを起動できるようになりました。`http://localhost:3000/`に接続できるはずです。
|
||||
|
||||
### Webアプリケーションの設定
|
||||
|
||||
OpenHands UIで、左下の設定ホイールをクリックします。
|
||||
次に、`Model`入力に`ollama/codellama:7b`、または先ほどプルしたモデルの名前を入力します。
|
||||
ドロップダウンに表示されない場合は、`Advanced Settings`を有効にして入力してください。注意:`ollama list`で表示されるモデル名に、接頭辞`ollama/`を付ける必要があります。
|
||||
|
||||
APIキーフィールドには、特定のキーが不要なので、`ollama`または任意の値を入力します。
|
||||
|
||||
ベースURLフィールドには、`http://localhost:11434`を入力します。
|
||||
|
||||
これで準備完了です!
|
||||
|
||||
## ollamaサービスの設定(WSL) {#configuring-ollama-service-wsl-ja}
|
||||
|
||||
WSLのollamaのデフォルト設定では、localhostのみにサービスを提供します。つまり、dockerコンテナからアクセスできません。例えば、OpenHandsでは動作しません。まず、ollamaが正しく実行されていることをテストしましょう。
|
||||
|
||||
```bash
|
||||
ollama list # インストール済みモデルのリストを取得
|
||||
curl http://localhost:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
#例 curl http://localhost:11434/api/generate -d '{"model":"codellama:7b","prompt":"hi"}'
|
||||
#例 curl http://localhost:11434/api/generate -d '{"model":"codellama","prompt":"hi"}' #タグは1つしかない場合はオプション
|
||||
```
|
||||
|
||||
完了したら、dockerコンテナ内からの「外部」リクエストを許可するかテストします。
|
||||
|
||||
```bash
|
||||
docker ps # 実行中のdockerコンテナのリストを取得。最も正確なテストのためにOpenHandsサンドボックスコンテナを選択。
|
||||
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
#例 docker exec cd9cc82f7a11 curl http://host.docker.internal:11434/api/generate -d '{"model":"codellama","prompt":"hi"}'
|
||||
```
|
||||
|
||||
## 修正方法
|
||||
|
||||
それでは、動作するようにしましょう。sudo権限で/etc/systemd/system/ollama.serviceを編集します。(パスはLinuxの種類によって異なる場合があります)
|
||||
|
||||
```bash
|
||||
sudo vi /etc/systemd/system/ollama.service
|
||||
```
|
||||
|
||||
または
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/ollama.service
|
||||
```
|
||||
|
||||
[Service]ブラケットにこれらの行を追加します
|
||||
|
||||
```
|
||||
Environment="OLLAMA_HOST=0.0.0.0:11434"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
そして保存し、設定をリロードしてサービスを再起動します。
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
最後に、コンテナ内からollamaにアクセスできることをテストします
|
||||
|
||||
```bash
|
||||
ollama list # インストール済みモデルのリストを取得
|
||||
docker ps # 実行中のdockerコンテナのリストを取得。最も正確なテストのためにOpenHandsサンドボックスコンテナを選択。
|
||||
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
```
|
||||
|
||||
|
||||
# ローカルLLMとLM Studio
|
||||
|
||||
LM Studioのセットアップ手順:
|
||||
1. LM Studioを開きます
|
||||
2. ローカルサーバータブに移動します。
|
||||
3. 「サーバーを起動」ボタンをクリックします。
|
||||
4. ドロップダウンから使用するモデルを選択します。
|
||||
|
||||
|
||||
以下の設定を行います:
|
||||
```bash
|
||||
LLM_MODEL="openai/lmstudio"
|
||||
LLM_BASE_URL="http://localhost:1234/v1"
|
||||
CUSTOM_LLM_PROVIDER="openai"
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run # ...
|
||||
-e LLM_MODEL="openai/lmstudio" \
|
||||
-e LLM_BASE_URL="http://host.docker.internal:1234/v1" \
|
||||
-e CUSTOM_LLM_PROVIDER="openai" \
|
||||
# ...
|
||||
```
|
||||
|
||||
これで、`http://localhost:3000/`に接続できるはずです。
|
||||
|
||||
開発環境では、`config.toml`ファイルに以下の設定を行うことができます:
|
||||
|
||||
```
|
||||
[core]
|
||||
workspace_base="./workspace"
|
||||
|
||||
[llm]
|
||||
model="openai/lmstudio"
|
||||
base_url="http://localhost:1234/v1"
|
||||
custom_llm_provider="openai"
|
||||
```
|
||||
|
||||
完了です!これで、Dockerなしで`make run`を実行してOpenHandsを起動できます。`http://localhost:3000/`に接続できるはずです。
|
||||
|
||||
# 注意
|
||||
|
||||
WSLの場合、cmdで以下のコマンドを実行して、ネットワークモードをミラーに設定します:
|
||||
|
||||
```
|
||||
python -c "print('[wsl2]\nnetworkingMode=mirrored',file=open(r'%UserProfile%\.wslconfig','w'))"
|
||||
wsl --shutdown
|
||||
```
|
||||
@@ -0,0 +1,140 @@
|
||||
# Ollama を使用したローカル LLM
|
||||
|
||||
Ollama サーバーが実行中であることを確認してください。
|
||||
詳細な起動手順については、[こちら](https://github.com/ollama/ollama)を参照してください。
|
||||
|
||||
このガイドでは、`ollama serve` で ollama を起動していることを前提としています。ollama を別の方法で実行している場合(例えば、docker 内で実行している場合)、手順を変更する必要があるかもしれません。WSL を使用している場合、ollama のデフォルト設定では docker コンテナからのリクエストがブロックされることに注意してください。[こちら](#configuring-ollama-service-ja)を参照してください。
|
||||
|
||||
## モデルのダウンロード
|
||||
|
||||
Ollama のモデル名は[こちら](https://ollama.com/library)で確認できます。小さなサンプルとしては、`codellama:7b` モデルを使用できます。一般的に、より大きなモデルの方がパフォーマンスが良くなります。
|
||||
|
||||
```bash
|
||||
ollama pull codellama:7b
|
||||
```
|
||||
|
||||
ダウンロードしたモデルは以下のように確認できます:
|
||||
|
||||
```bash
|
||||
~$ ollama list
|
||||
NAME ID SIZE MODIFIED
|
||||
codellama:7b 8fdf8f752f6e 3.8 GB 6 weeks ago
|
||||
mistral:7b-instruct-v0.2-q4_K_M eb14864c7427 4.4 GB 2 weeks ago
|
||||
starcoder2:latest f67ae0f64584 1.7 GB 19 hours ago
|
||||
```
|
||||
|
||||
## OpenHands の起動
|
||||
|
||||
### Docker
|
||||
|
||||
[こちら](../intro)の手順を使用して、Docker で OpenHands を起動します。
|
||||
ただし、`docker run` を実行する際に、いくつかの追加引数が必要になります:
|
||||
|
||||
```bash
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
-e LLM_API_KEY="ollama" \
|
||||
-e LLM_BASE_URL="http://host.docker.internal:11434" \
|
||||
```
|
||||
|
||||
例:
|
||||
|
||||
```bash
|
||||
# OpenHands に変更させたいディレクトリ。絶対パスでなければなりません!
|
||||
export WORKSPACE_BASE=$(pwd)/workspace
|
||||
|
||||
docker run \
|
||||
-it \
|
||||
--pull=always \
|
||||
--add-host host.docker.internal:host-gateway \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e LLM_API_KEY="ollama" \
|
||||
-e LLM_BASE_URL="http://host.docker.internal:11434" \
|
||||
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
|
||||
-v $WORKSPACE_BASE:/opt/workspace_base \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-p 3000:3000 \
|
||||
ghcr.io/all-hands-ai/openhands:main
|
||||
```
|
||||
|
||||
これで `http://localhost:3000/` に接続できるはずです。
|
||||
|
||||
### ソースからのビルド
|
||||
|
||||
[Development.md](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md) の手順を使用して、OpenHands をビルドします。
|
||||
`make setup-config` を実行して `config.toml` が存在することを確認してください。これにより、`config.toml` が作成されます。`config.toml` に以下を入力します:
|
||||
|
||||
```
|
||||
LLM_MODEL="ollama/codellama:7b"
|
||||
LLM_API_KEY="ollama"
|
||||
LLM_EMBEDDING_MODEL="local"
|
||||
LLM_BASE_URL="http://localhost:11434"
|
||||
WORKSPACE_BASE="./workspace"
|
||||
WORKSPACE_DIR="$(pwd)/workspace"
|
||||
```
|
||||
|
||||
必要に応じて、`LLM_MODEL` を選択したものに置き換えてください。
|
||||
|
||||
以上で完了です!これで、Docker なしで `make run` を使用して OpenHands を起動できます。`http://localhost:3000/` に接続できるはずです。
|
||||
|
||||
## モデルの選択
|
||||
|
||||
OpenHands のインターフェースで、左下の設定アイコンをクリックします。
|
||||
次に、`Model` の入力欄に `ollama/codellama:7b` または先ほどダウンロードしたモデル名を入力します。
|
||||
ドロップダウンメニューに表示されなくても問題ありません。そのまま入力してください。完了したら、保存をクリックします。
|
||||
|
||||
これで、開始する準備が整いました!
|
||||
|
||||
## ollama サービスの設定 (WSL){#configuring-ollama-service-ja}
|
||||
|
||||
WSL 上の ollama のデフォルト設定では、localhost のみが提供されます。つまり、docker コンテナなどから到達できないため、OpenHands では動作しません。まず、ollama が正しく実行されているかテストしてみましょう。
|
||||
|
||||
```bash
|
||||
ollama list # インストールされているモデルのリストを取得
|
||||
curl http://localhost:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
#例 curl http://localhost:11434/api/generate -d '{"model":"codellama:7b","prompt":"hi"}'
|
||||
#例 curl http://localhost:11434/api/generate -d '{"model":"codellama","prompt":"hi"}' #タグは1つしかない場合はオプション
|
||||
```
|
||||
|
||||
これが完了したら、docker コンテナなどからの「外部」リクエストを受け入れるかどうかをテストします。
|
||||
|
||||
```bash
|
||||
docker ps # 実行中の docker コンテナのリストを取得。最も正確なテストのために OpenHands サンドボックスコンテナを選択。
|
||||
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
#例 docker exec cd9cc82f7a11 curl http://host.docker.internal:11434/api/generate -d '{"model":"codellama","prompt":"hi"}'
|
||||
```
|
||||
|
||||
## 修正
|
||||
|
||||
これで動作するようにしましょう。sudo 権限で /etc/systemd/system/ollama.service を編集します。(パスは Linux ディストリビューションによって異なる場合があります)
|
||||
|
||||
```bash
|
||||
sudo vi /etc/systemd/system/ollama.service
|
||||
```
|
||||
|
||||
または
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/ollama.service
|
||||
```
|
||||
|
||||
[Service] セクションに、以下の行を追加します
|
||||
|
||||
```
|
||||
Environment="OLLAMA_HOST=0.0.0.0:11434"
|
||||
Environment="OLLAMA_ORIGINS=*"
|
||||
```
|
||||
|
||||
次に、保存し、設定をリロードしてサービスを再起動します。
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ollama
|
||||
```
|
||||
|
||||
最後に、コンテナから ollama にアクセスできることをテストします
|
||||
|
||||
```bash
|
||||
ollama list # インストールされているモデルのリストを取得
|
||||
docker ps # 実行中の docker コンテナのリストを取得。最も正確なテストのために OpenHands サンドボックスコンテナを選択。
|
||||
docker exec [CONTAINER ID] curl http://host.docker.internal:11434/api/generate -d '{"model":"[NAME]","prompt":"hi"}'
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
# OpenAI
|
||||
|
||||
OpenHandsは、OpenAIのチャットモデルへのAPIコールにLiteLLMを使用します。OpenAIをプロバイダーとして使用する方法については、[こちら](https://docs.litellm.ai/docs/providers/openai)のドキュメントを参照してください。
|
||||
|
||||
## 設定
|
||||
|
||||
OpenHandsを実行する際、OpenHandsのUIで設定メニューから以下の項目を設定する必要があります:
|
||||
|
||||
* `LLMプロバイダー`を`OpenAI`に設定
|
||||
* `LLMモデル`を使用するモデルに設定。
|
||||
[LiteLLMがサポートするOpenAIモデルの完全なリストはこちら](https://docs.litellm.ai/docs/providers/openai#openai-chat-completion-models)を参照してください。
|
||||
モデルがリストにない場合は、`詳細設定`を有効にし、`カスタムモデル`に入力してください(例:openai/<model-name>として`openai/gpt-4o`)。
|
||||
* `APIキー`をOpenAI APIキーに設定。OpenAIプロジェクトのAPIキーの確認または作成については、[こちら](https://platform.openai.com/api-keys)を参照してください。
|
||||
|
||||
## OpenAI互換エンドポイントの使用
|
||||
|
||||
OpenAIのチャット補完と同様に、OpenAI互換エンドポイントにもLiteLLMを使用します。この件に関する完全なドキュメントは[こちら](https://docs.litellm.ai/docs/providers/openai_compatible)を参照してください。
|
||||
|
||||
## OpenAIプロキシの使用
|
||||
|
||||
OpenAIプロキシを使用する場合、OpenHandsのUIで設定メニューから以下の項目を設定する必要があります:
|
||||
|
||||
* `詳細設定`を有効にする
|
||||
* `カスタムモデル`をopenai/<model-name>に設定(例:`openai/gpt-4o`またはopenai/<proxy-prefix>/<model-name>)
|
||||
* `ベースURL`をOpenAIプロキシのURLに設定
|
||||
* `APIキー`をOpenAI APIキーに設定
|
||||
@@ -0,0 +1,13 @@
|
||||
# OpenRouter
|
||||
|
||||
OpenHandsは、OpenRouterのチャットモデルへのAPIコールにLiteLLMを使用します。OpenRouterをプロバイダーとして使用する方法については、[こちら](https://docs.litellm.ai/docs/providers/openrouter)のドキュメントを参照してください。
|
||||
|
||||
## 設定
|
||||
|
||||
OpenHandsを実行する際、OpenHandsのUIで設定メニューから以下の項目を設定する必要があります:
|
||||
|
||||
* `LLMプロバイダー`を`OpenRouter`に設定
|
||||
* `LLMモデル`を使用するモデルに設定。
|
||||
[OpenRouterのモデルの完全なリストはこちら](https://openrouter.ai/models)を参照してください。
|
||||
モデルがリストにない場合は、`詳細設定`を有効にし、`カスタムモデル`に入力してください(例:openrouter/<model-name>として`openrouter/anthropic/claude-3.5-sonnet`)。
|
||||
* `APIキー`をOpenRouter APIキーに設定。
|
||||
@@ -0,0 +1,41 @@
|
||||
# プロンプトのベストプラクティス
|
||||
|
||||
OpenHands AIソフトウェア開発者と連携する際、明確で効果的なプロンプトを提供することが非常に重要です。このガイドでは、最も正確で有用な応答を生み出すプロンプトを作成するためのベストプラクティスについて説明します。
|
||||
|
||||
## 良いプロンプトの特徴
|
||||
|
||||
良いプロンプトは以下のような特徴があります。
|
||||
|
||||
1. **具体的** : どの機能を追加するか、どのバグを修正する必要があるかを正確に説明します。
|
||||
2. **場所を特定** : 可能な場合は、コードベース内のどの場所を変更する必要があるかを説明します。
|
||||
3. **適切なサイズ** : 1つの機能に対応したサイズで、通常は100行以内のコードに収まります。
|
||||
|
||||
## 例
|
||||
|
||||
### 良いプロンプトの例
|
||||
|
||||
1. "`utils/math_operations.py` に `calculate_average` 関数を追加してください。この関数は数値のリストを入力として受け取り、その平均値を返します。"
|
||||
|
||||
2. "`frontend/src/components/UserProfile.tsx` の42行目で発生している TypeError を修正してください。このエラーは、undefined のプロパティにアクセスしようとしていることを示唆しています。"
|
||||
|
||||
3. "サインアップフォームの email フィールドに入力検証を実装してください。`frontend/src/components/RegistrationForm.tsx` を更新し、送信前にメールアドレスが有効な形式であるかどうかを確認します。"
|
||||
|
||||
### 悪いプロンプトの例
|
||||
|
||||
1. "コードを改善してください。" (あまりにも曖昧で具体性に欠ける)
|
||||
|
||||
2. "バックエンド全体を別のフレームワークを使用するように書き換えてください。" (適切なサイズではない)
|
||||
|
||||
3. "ユーザー認証のどこかにバグがあります。それを見つけて修正できますか?" (具体性と場所情報が不足している)
|
||||
|
||||
## 効果的なプロンプトのヒント
|
||||
|
||||
1. 望ましい結果や解決すべき問題について、できるだけ具体的に説明してください。
|
||||
2. 関連するファイルパスや行番号など、コンテキストを提供してください。
|
||||
3. 大きなタスクは、より小さく管理しやすいプロンプトに分割してください。
|
||||
4. 関連するエラーメッセージやログをすべて含めてください。
|
||||
5. コンテキストから明らかでない場合は、プログラミング言語やフレームワークを指定してください。
|
||||
|
||||
プロンプトが具体的で情報量が多いほど、AIはOpenHandsソフトウェアの開発や修正をより効果的に支援できることを忘れないでください。
|
||||
|
||||
役立つプロンプトの他の例については、[OpenHands入門](./getting-started)を参照してください。
|
||||
@@ -0,0 +1,64 @@
|
||||
# リポジトリ固有の動作のカスタマイズ
|
||||
|
||||
OpenHandsは、リポジトリ固有のコンテキストとガイダンスを提供することで、特定のリポジトリでより効果的に機能するようにカスタマイズできます。このセクションでは、OpenHandsをプロジェクトに最適化する方法について説明します。
|
||||
|
||||
## リポジトリの設定
|
||||
|
||||
リポジトリのルートに`.openhands`ディレクトリを作成することで、OpenHandsの動作をリポジトリ用にカスタマイズできます。最低限、このディレクトリには`.openhands/microagents/repo.md`ファイルが含まれている必要があります。このファイルには、エージェントがこのリポジトリで作業するたびに与えられる指示が含まれています。
|
||||
|
||||
以下の情報を含めることをお勧めします。
|
||||
1. **リポジトリの概要**: プロジェクトの目的とアーキテクチャの簡単な説明
|
||||
2. **ディレクトリ構造**: 主要なディレクトリとその目的
|
||||
3. **開発ガイドライン**: プロジェクト固有のコーディング標準と慣行
|
||||
4. **テスト要件**: テストの実行方法と必要なテストの種類
|
||||
5. **セットアップ手順**: プロジェクトのビルドと実行に必要な手順
|
||||
|
||||
### リポジトリ設定の例
|
||||
`.openhands/microagents/repo.md`ファイルの例:
|
||||
```
|
||||
Repository: MyProject
|
||||
Description: タスク管理用のWebアプリケーション
|
||||
|
||||
ディレクトリ構造:
|
||||
- src/: アプリケーションのメインコード
|
||||
- tests/: テストファイル
|
||||
- docs/: ドキュメンテーション
|
||||
|
||||
セットアップ:
|
||||
- `npm install`を実行して依存関係をインストールします
|
||||
- 開発には`npm run dev`を使用します
|
||||
- テストには`npm test`を実行します
|
||||
|
||||
ガイドライン:
|
||||
- ESLint設定に従ってください
|
||||
- 新機能にはすべてテストを書いてください
|
||||
- 新しいコードにはTypeScriptを使用してください
|
||||
```
|
||||
|
||||
### プロンプトのカスタマイズ
|
||||
|
||||
カスタマイズされたリポジトリで作業する場合:
|
||||
|
||||
1. **プロジェクトの標準を参照する**: プロジェクトで使用されている特定のコーディング標準やパターンに言及する
|
||||
2. **コンテキストを含める**: 関連するドキュメンテーションや既存の実装を参照する
|
||||
3. **テスト要件を指定する**: プロジェクト固有のテスト要件をプロンプトに含める
|
||||
|
||||
カスタムプロンプトの例:
|
||||
```
|
||||
既存のコンポーネントパターンに従って、src/components/TaskList.tsxにタスク完了の新機能を追加してください。
|
||||
tests/components/にユニットテストを含め、docs/features/のドキュメントを更新してください。
|
||||
コンポーネントはsrc/styles/componentsの共有スタイルを使用する必要があります。
|
||||
```
|
||||
|
||||
### リポジトリカスタマイズのベストプラクティス
|
||||
|
||||
1. **指示を最新に保つ**: プロジェクトの進化に合わせて、`.openhands`ディレクトリを定期的に更新する
|
||||
2. **具体的にする**: プロジェクト固有のパス、パターン、要件を含める
|
||||
3. **依存関係を文書化する**: 開発に必要なすべてのツールと依存関係を列挙する
|
||||
4. **例を含める**: プロジェクトからの良いコード例を提供する
|
||||
5. **規約を指定する**: 命名規則、ファイル構成、コードスタイルの好みを文書化する
|
||||
|
||||
OpenHandsをリポジトリ用にカスタマイズすることで、プロジェクトの標準と要件に沿ったより正確で一貫した結果が得られます。
|
||||
|
||||
## その他のマイクロエージェント
|
||||
`.openhands/microagents/`ディレクトリに、`test`、`frontend`、`migration`などの特定のキーワードが見つかった場合にエージェントに送信される追加の指示を作成できます。詳細については、[Microagents](microagents.md)を参照してください。
|
||||
@@ -0,0 +1,33 @@
|
||||
# Microagentsの概要
|
||||
|
||||
Microagentsは、ドメイン固有の知識、リポジトリ固有のコンテキスト、タスク固有のワークフローでOpenHandsを強化する特殊なプロンプトです。専門家のガイダンスを提供し、一般的なタスクを自動化し、プロジェクト全体で一貫したプラクティスを確保するのに役立ちます。
|
||||
|
||||
## Microagentの種類
|
||||
|
||||
現在、OpenHandsは以下の種類のmicroagentsをサポートしています:
|
||||
|
||||
* [リポジトリMicroagents](./microagents-repo): OpenHands用のリポジトリ固有のコンテキストとガイドライン。
|
||||
* [パブリックMicroagents](./microagents-public): すべてのOpenHandsユーザーのためにキーワードによってトリガーされる一般的なガイドライン。
|
||||
|
||||
OpenHandsがリポジトリで動作する際:
|
||||
|
||||
1. リポジトリに`.openhands/microagents/`が存在する場合、そこからリポジトリ固有の指示を読み込みます。
|
||||
2. 会話のキーワードによってトリガーされる一般的なガイドラインを読み込みます。
|
||||
現在の[パブリックMicroagents](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge)を参照してください。
|
||||
|
||||
## Microagentのフォーマット
|
||||
|
||||
すべてのmicroagentsは、YAMLのfrontmatterを持つmarkdownファイルを使用します。これには、OpenHandsがタスクを達成するための特別な指示が含まれています:
|
||||
```
|
||||
---
|
||||
name: <Microagentの名前>
|
||||
type: <MicroAgentのタイプ>
|
||||
version: <MicroAgentのバージョン>
|
||||
agent: <エージェントのタイプ (通常はCodeActAgent)>
|
||||
triggers:
|
||||
- <オプション: microagentをトリガーするキーワード。トリガーを削除すると、常に含まれるようになります>
|
||||
---
|
||||
|
||||
<OpenHandsが従うべき特別なガイドライン、指示、プロンプトを含むMarkdown。
|
||||
ベストプラクティスに関する各microagentの具体的なドキュメントを確認してください。>
|
||||
```
|
||||
@@ -0,0 +1,91 @@
|
||||
# パブリックマイクロエージェント
|
||||
|
||||
## 概要
|
||||
|
||||
パブリックマイクロエージェントは、OpenHandsのすべてのユーザーが利用できる一般的なガイドラインを提供します。これらは、特定のキーワードによってトリガーされ、特定のドメインやタスクに関する専門知識を提供します。
|
||||
|
||||
## 現在のパブリックマイクロエージェント
|
||||
|
||||
### GitHubエージェント
|
||||
|
||||
GitHubエージェントは、GitHubリポジトリとの対話を支援します。主な機能:
|
||||
|
||||
* リポジトリのクローン
|
||||
* ブランチの作成と切り替え
|
||||
* コミットとプッシュ
|
||||
* プルリクエストの作成
|
||||
|
||||
### NPMエージェント
|
||||
|
||||
NPMエージェントは、Node.jsプロジェクトの管理を支援します:
|
||||
|
||||
* パッケージのインストールと更新
|
||||
* 依存関係の管理
|
||||
* スクリプトの実行
|
||||
* バージョン管理
|
||||
|
||||
## パブリックマイクロエージェントの貢献
|
||||
|
||||
### パブリックマイクロエージェントのベストプラクティス
|
||||
|
||||
1. **明確なトリガー**:エージェントをトリガーするキーワードを明確に定義します
|
||||
2. **集中的な範囲**:1つのドメインまたはタスクに焦点を当てます
|
||||
3. **明確なガイドライン**:エージェントの責任と制限を明確に説明します
|
||||
4. **実用的な例**:一般的なユースケースの例を含めます
|
||||
|
||||
### パブリックマイクロエージェントを貢献するステップ
|
||||
|
||||
1. [マイクロエージェントのフォーマット](./microagents-overview#microagent-format)を確認します
|
||||
2. 新しいマイクロエージェントファイルを作成します
|
||||
3. ガイドラインとベストプラクティスに従っていることを確認します
|
||||
4. プルリクエストを作成します
|
||||
|
||||
### パブリックマイクロエージェントの実装例
|
||||
|
||||
```
|
||||
---
|
||||
name: Dockerエージェント
|
||||
type: public
|
||||
version: 1.0
|
||||
agent: CodeActAgent
|
||||
triggers:
|
||||
- docker
|
||||
- container
|
||||
---
|
||||
|
||||
あなたはDockerコンテナの管理とDockerfileの作成を担当します。
|
||||
|
||||
主な責任:
|
||||
1. Dockerfileの作成と修正
|
||||
2. コンテナのライフサイクル管理
|
||||
3. Docker Compose設定の処理
|
||||
|
||||
ガイドライン:
|
||||
- 可能な限り公式ベースイメージを使用
|
||||
- 必要なセキュリティ考慮事項を含める
|
||||
- レイヤー最適化のためのDockerベストプラクティスに従う
|
||||
|
||||
例:
|
||||
1. Dockerfileの作成:
|
||||
FROM node:18-alpine
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
CMD ["npm", "start"]
|
||||
|
||||
2. Docker Composeの使用:
|
||||
version: '3'
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
|
||||
忘れないこと:
|
||||
- Dockerfileの構文を検証
|
||||
- セキュリティ脆弱性をチェック
|
||||
- ビルド時間とイメージサイズを最適化
|
||||
```
|
||||
|
||||
より多くの例については、[現在のパブリックマイクロエージェント](https://github.com/All-Hands-AI/OpenHands/tree/main/microagents/knowledge)をご覧ください。
|
||||
@@ -0,0 +1,67 @@
|
||||
# リポジトリマイクロエージェント
|
||||
|
||||
## 概要
|
||||
|
||||
OpenHandsは、リポジトリ固有のコンテキストとガイドラインを提供することで、特定のリポジトリでより効果的に動作するようにカスタマイズできます。このセクションでは、OpenHandsをプロジェクトに最適化する方法を説明します。
|
||||
|
||||
## リポジトリマイクロエージェントの作成
|
||||
|
||||
リポジトリのルートに`.openhands/microagents/`ディレクトリを作成することで、リポジトリに対するOpenHandsの動作をカスタマイズできます。
|
||||
最低限、このリポジトリで作業する際にエージェントに与えられる指示を含む
|
||||
`.openhands/microagents/repo.md`ファイルが必要です。
|
||||
|
||||
### リポジトリマイクロエージェントのベストプラクティス
|
||||
|
||||
* **指示を最新に保つ**:プロジェクトの進化に合わせて`.openhands/microagents/`ディレクトリを定期的に更新します。
|
||||
* **具体的に**:プロジェクト固有のパス、パターン、要件を含めます。
|
||||
* **依存関係を文書化**:開発に必要なすべてのツールと依存関係をリストアップします。
|
||||
* **例を含める**:プロジェクトの良いコードパターンの例を提供します。
|
||||
* **規約を指定**:命名規則、ファイル構成、コードスタイルの設定を文書化します。
|
||||
|
||||
### リポジトリマイクロエージェントを作成するステップ
|
||||
|
||||
#### 1. リポジトリマイクロエージェントの計画
|
||||
|
||||
リポジトリ固有のマイクロエージェントを作成する際は、以下の情報を含めることを推奨します:
|
||||
|
||||
* **リポジトリの概要**:プロジェクトの目的とアーキテクチャの簡単な説明。
|
||||
* **ディレクトリ構造**:主要なディレクトリとその目的。
|
||||
* **開発ガイドライン**:プロジェクト固有のコーディング標準とプラクティス。
|
||||
* **テスト要件**:テストの実行方法と必要なテストの種類。
|
||||
* **セットアップ手順**:プロジェクトのビルドと実行に必要な手順。
|
||||
|
||||
#### 2. ファイルの作成
|
||||
|
||||
リポジトリの`.openhands/microagents/`ディレクトリにファイルを作成します(例:`.openhands/microagents/repo.md`)
|
||||
|
||||
[必要なフォーマット](./microagents-overview#microagent-format)に従って必要なフロントマターと、リポジトリに必要な特殊なガイドラインでファイルを更新します。
|
||||
|
||||
### リポジトリマイクロエージェントの例
|
||||
|
||||
```
|
||||
---
|
||||
name: repo
|
||||
type: repo
|
||||
agent: CodeActAgent
|
||||
---
|
||||
|
||||
リポジトリ:MyProject
|
||||
説明:タスク管理のためのWebアプリケーション
|
||||
|
||||
ディレクトリ構造:
|
||||
- src/:メインアプリケーションコード
|
||||
- tests/:テストファイル
|
||||
- docs/:ドキュメント
|
||||
|
||||
セットアップ:
|
||||
- `npm install`で依存関係をインストール
|
||||
- 開発には`npm run dev`を使用
|
||||
- テストには`npm test`を実行
|
||||
|
||||
ガイドライン:
|
||||
- ESLint設定に従う
|
||||
- すべての新機能にテストを書く
|
||||
- 新しいコードにはTypeScriptを使用
|
||||
|
||||
src/componentsに新しいコンポーネントを追加する場合は、必ずtests/components/に適切なユニットテストを追加してください。
|
||||
```
|
||||
@@ -0,0 +1,213 @@
|
||||
# マイクロエージェント
|
||||
|
||||
OpenHandsは、特定のタスクやコンテキストを効率的に処理するために、特殊なマイクロエージェントを利用しています。これらのマイクロエージェントは、特定のシナリオに特化した動作と知識を提供する小さな目的指向のコンポーネントです。
|
||||
|
||||
## 概要
|
||||
|
||||
マイクロエージェントは、`openhands/agenthub/codeact_agent/micro/`ディレクトリ下のマークダウンファイルで定義されます。各マイクロエージェントは以下の設定を持ちます:
|
||||
|
||||
- 一意の名前
|
||||
- エージェントのタイプ(通常はCodeActAgent)
|
||||
- エージェントを起動するトリガーキーワード
|
||||
- 特定の指示と能力
|
||||
|
||||
## 利用可能なマイクロエージェント
|
||||
|
||||
### GitHubエージェント
|
||||
**ファイル**: `github.md`
|
||||
**トリガー**: `github`, `git`
|
||||
|
||||
GitHubエージェントは、GitHub APIとのインタラクションとリポジトリ管理に特化しています。これは:
|
||||
- API認証用の`GITHUB_TOKEN`にアクセスできる
|
||||
- リポジトリとのインタラクションに厳密なガイドラインに従う
|
||||
- ブランチとプルリクエストを管理する
|
||||
- Webブラウザでのインタラクションの代わりにGitHub APIを使用する
|
||||
|
||||
主な機能:
|
||||
- ブランチ保護(main/masterへの直接プッシュを防止)
|
||||
- 自動PRの作成
|
||||
- Git設定の管理
|
||||
- GitHub操作のためのAPI中心のアプローチ
|
||||
|
||||
### NPMエージェント
|
||||
**ファイル**: `npm.md`
|
||||
**トリガー**: `npm`
|
||||
|
||||
npmパッケージの管理に特化し、特に以下に焦点を当てています:
|
||||
- 非対話的なシェル操作
|
||||
- Unixの'yes'コマンドを使用した自動確認の管理
|
||||
- パッケージインストールの自動化
|
||||
|
||||
### カスタムマイクロエージェント
|
||||
|
||||
マイクロエージェントディレクトリに新しいマークダウンファイルを追加することで、独自のマイクロエージェントを作成できます。各ファイルは次の構造に従う必要があります:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: エージェント名
|
||||
agent: CodeActAgent
|
||||
triggers:
|
||||
- トリガー1
|
||||
- トリガー2
|
||||
---
|
||||
|
||||
マイクロエージェントの指示と能力...
|
||||
```
|
||||
|
||||
## ベストプラクティス
|
||||
|
||||
マイクロエージェントを使用する際は:
|
||||
|
||||
1. **適切なトリガーを使用する**: コマンドに関連するトリガーキーワードを含めて、正しいマイクロエージェントを起動するようにします
|
||||
2. **エージェントのガイドラインに従う**: 各エージェントには特定の指示と制限があります - 最適な結果を得るためにそれらに従ってください
|
||||
3. **API中心のアプローチ**: 可能な場合は、Webインターフェースではなく、APIエンドポイントを使用します
|
||||
4. **自動化に優しい**: 非対話的な環境でうまく機能するコマンドを設計します
|
||||
|
||||
## 統合
|
||||
|
||||
マイクロエージェントは自動的にOpenHandsのワークフローに統合されます。これらは:
|
||||
- 着信コマンドをモニタリングしてトリガーキーワードを検出する
|
||||
- 関連するトリガーが検出されたときに起動する
|
||||
- 特殊な知識と能力を適用する
|
||||
- 特定のガイドラインと制限に従う
|
||||
|
||||
## 使用例
|
||||
|
||||
```bash
|
||||
# GitHubエージェントの例
|
||||
git checkout -b feature-branch
|
||||
git commit -m "Add new feature"
|
||||
git push origin feature-branch
|
||||
|
||||
# NPMエージェントの例
|
||||
yes | npm install package-name
|
||||
```
|
||||
|
||||
特定のエージェントの詳細については、マイクロエージェントディレクトリ内の個別のドキュメントファイルを参照してください。
|
||||
|
||||
## マイクロエージェントの貢献
|
||||
|
||||
OpenHandsに新しいマイクロエージェントを貢献するには、次のガイドラインに従ってください:
|
||||
|
||||
### 1. マイクロエージェントの計画
|
||||
|
||||
マイクロエージェントを作成する前に、以下を検討してください:
|
||||
- どの特定の問題やユースケースに対処するのか?
|
||||
- どのようなユニークな能力や知識を持つべきか?
|
||||
- どのトリガーキーワードを使用するのが適切か?
|
||||
- どのような制約やガイドラインに従うべきか?
|
||||
|
||||
### 2. ファイル構造
|
||||
|
||||
`openhands/agenthub/codeact_agent/micro/`に新しいマークダウンファイルを作成し、説明的な名前を付けます(例:Dockerに特化したエージェントの場合は`docker.md`)。
|
||||
|
||||
### 3. 必要なコンポーネント
|
||||
|
||||
マイクロエージェントファイルには以下を含める必要があります:
|
||||
|
||||
1. **フロントマター**: ファイルの先頭にYAMLメタデータ:
|
||||
```markdown
|
||||
---
|
||||
name: エージェント名
|
||||
agent: CodeActAgent
|
||||
triggers:
|
||||
- トリガー1
|
||||
- トリガー2
|
||||
---
|
||||
```
|
||||
|
||||
2. **指示**: エージェントの動作に関する明確で具体的な指示:
|
||||
```markdown
|
||||
あなたは[特定のタスク/ドメイン]を担当しています。
|
||||
|
||||
主な責任:
|
||||
1. [責任1]
|
||||
2. [責任2]
|
||||
|
||||
ガイドライン:
|
||||
- [ガイドライン1]
|
||||
- [ガイドライン2]
|
||||
|
||||
使用例:
|
||||
[例1]
|
||||
[例2]
|
||||
```
|
||||
|
||||
### 4. マイクロエージェント開発のベストプラクティス
|
||||
|
||||
1. **明確な範囲**: エージェントを特定のドメインまたはタスクに集中させる
|
||||
2. **明示的な指示**: 明確で曖昧さのない指示を提供する
|
||||
3. **有用な例**: 一般的なユースケースの実用的な例を含める
|
||||
4. **セキュリティ第一**: 必要な警告と制約を含める
|
||||
5. **統合の認識**: エージェントが他のコンポーネントとどのように相互作用するかを考慮する
|
||||
|
||||
### 5. マイクロエージェントのテスト
|
||||
|
||||
提出前に:
|
||||
1. さまざまなプロンプトでエージェントをテストする
|
||||
2. トリガーキーワードがエージェントを正しく起動することを確認する
|
||||
3. 指示が明確で完全であることを確認する
|
||||
4. 既存のエージェントとの潜在的な競合を確認する
|
||||
|
||||
### 6. 実装例
|
||||
|
||||
新しいマイクロエージェントのテンプレートを以下に示します:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: docker
|
||||
agent: CodeActAgent
|
||||
triggers:
|
||||
- docker
|
||||
- コンテナ
|
||||
---
|
||||
|
||||
あなたはDockerコンテナの管理とDockerfileの作成を担当しています。
|
||||
|
||||
主な責任:
|
||||
1. Dockerfileの作成と変更
|
||||
2. コンテナのライフサイクル管理
|
||||
3. Docker Compose設定の管理
|
||||
|
||||
ガイドライン:
|
||||
- 可能な限り公式のベースイメージを使用する
|
||||
- 必要なセキュリティの考慮事項を含める
|
||||
- レイヤー最適化のためのDockerベストプラクティスに従う
|
||||
|
||||
例:
|
||||
1. Dockerfileの作成:
|
||||
```dockerfile
|
||||
FROM node:18-alpine
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
CMD ["npm", "start"]
|
||||
```
|
||||
|
||||
2. Docker Composeの使用:
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
```
|
||||
|
||||
忘れずに:
|
||||
- Dockerfileの構文を検証する
|
||||
- セキュリティの脆弱性を確認する
|
||||
- ビルド時間とイメージサイズを最適化する
|
||||
```
|
||||
|
||||
### 7. 提出プロセス
|
||||
|
||||
1. 適切なディレクトリにマイクロエージェントファイルを作成する
|
||||
2. 徹底的にテストする
|
||||
3. 以下を含むプルリクエストを提出する:
|
||||
- 新しいマイクロエージェントファイル
|
||||
- 必要に応じて更新されたドキュメント
|
||||
- エージェントの目的と能力の説明
|
||||
|
||||
マイクロエージェントは、特定のドメインでOpenHandsの能力を拡張する強力な方法であることを忘れないでください。適切に設計されたエージェントは、特殊なタスクを処理するシステムの能力を大幅に向上させることができます。
|
||||
@@ -0,0 +1,37 @@
|
||||
# プロンプトのベストプラクティス
|
||||
|
||||
OpenHands AIソフトウェア開発者と連携する際、明確で効果的なプロンプトを提供することが重要です。このガイドでは、最も正確で有用な応答を引き出すためのプロンプト作成のベストプラクティスについて説明します。
|
||||
|
||||
## 良いプロンプトの特徴
|
||||
|
||||
良いプロンプトは以下のような特徴があります:
|
||||
|
||||
- **具体的**:どのような機能を追加すべきか、またはどのようなエラーを修正する必要があるかを正確に説明します。
|
||||
- **場所を特定**:可能であれば、コードベース内のどの場所を修正すべきかを説明します。
|
||||
- **適切な範囲**:1つの機能の大きさであるべきで、通常は100行のコードを超えないようにします。
|
||||
|
||||
## 例
|
||||
|
||||
### 良いプロンプトの例
|
||||
|
||||
- "`utils/math_operations.py`に、数値のリストを入力として受け取り、その平均を返す関数`calculate_average`を追加してください。"
|
||||
- "`frontend/src/components/UserProfile.tsx`の42行目で発生しているTypeErrorを修正してください。このエラーは、undefinedのプロパティにアクセスしようとしていることを示唆しています。"
|
||||
- "登録フォームのメールフィールドに入力検証を実装してください。`frontend/src/components/RegistrationForm.tsx`を更新し、送信前にメールが有効な形式であるかどうかを確認するようにしてください。"
|
||||
|
||||
### 悪いプロンプトの例
|
||||
|
||||
- "コードをもっと良くしてください。"(曖昧すぎる、具体性に欠ける)
|
||||
- "バックエンド全体を別のフレームワークを使用するように書き換えてください。"(適切な範囲ではない)
|
||||
- "ユーザー認証のどこかにバグがあります。見つけて修正できますか?"(具体性とロケーション情報に欠ける)
|
||||
|
||||
## 効果的なプロンプトのためのヒント
|
||||
|
||||
- 望ましい結果や解決すべき問題について、できるだけ具体的に説明してください。
|
||||
- 関連するファイルパスや行番号など、コンテキストを提供してください。
|
||||
- 大きなタスクは、より小さく管理しやすいプロンプトに分割してください。
|
||||
- 関連するエラーメッセージやログを含めてください。
|
||||
- コンテキストから明らかでない場合は、プログラミング言語やフレームワークを指定してください。
|
||||
|
||||
プロンプトが正確で情報量が多いほど、AIはOpenHandsソフトウェアの開発や修正においてより良いサポートができることを覚えておいてください。
|
||||
|
||||
役立つプロンプトの他の例については、[OpenHands入門](../getting-started)を参照してください。
|
||||
@@ -0,0 +1,22 @@
|
||||
# ランタイム設定
|
||||
|
||||
ランタイムとは、OpenHands エージェントがファイルを編集したりコマンドを実行したりできる環境のことです。
|
||||
|
||||
デフォルトでは、OpenHands はローカルコンピュータ上で動作する Docker ベースのランタイムを使用します。
|
||||
つまり、使用している LLM の料金のみを支払えばよく、コードが LLM に送信されるだけです。
|
||||
|
||||
また、通常はサードパーティが管理する「リモート」ランタイムもサポートしています。
|
||||
特に多数の OpenHands 会話を並行して実行する場合(例えば評価を行う場合など)、セットアップがより簡単でスケーラブルになります。
|
||||
|
||||
さらに、Docker を使用せずに直接マシン上で実行される「ローカル」ランタイムも提供しており、
|
||||
CI パイプラインのような制御された環境で役立ちます。
|
||||
|
||||
## 利用可能なランタイム
|
||||
|
||||
OpenHands は以下のようなさまざまなランタイム環境をサポートしています。
|
||||
|
||||
- [Docker ランタイム](./runtimes/docker.md) - 分離のために Docker コンテナを使用するデフォルトのランタイム(ほとんどのユーザーにお勧め)
|
||||
- [OpenHands リモートランタイム](./runtimes/remote.md) - 並列実行用のクラウドベースのランタイム(ベータ版)
|
||||
- [Modal ランタイム](./runtimes/modal.md) - パートナーである Modal 社が提供するランタイム
|
||||
- [Daytona ランタイム](./runtimes/daytona.md) - Daytona 社が提供するランタイム
|
||||
- [ローカルランタイム](./runtimes/local.md) - Docker を使用せずにローカルマシン上で直接実行
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
slug: /usage/runtimes
|
||||
title: Runtime Configuration
|
||||
---
|
||||
|
||||
Here is the translation in Japanese, preserving the code block and not translating the code:
|
||||
|
||||
import { Redirect } from '@docusaurus/router';
|
||||
|
||||
<Redirect to="/modules/usage/runtimes-index" />
|
||||
@@ -0,0 +1,32 @@
|
||||
# Daytona ランタイム
|
||||
|
||||
[Daytona](https://www.daytona.io/) をランタイムプロバイダーとして使用できます:
|
||||
|
||||
## ステップ 1: Daytona API キーを取得する
|
||||
1. [Daytona ダッシュボード](https://app.daytona.io/dashboard/keys)にアクセスします。
|
||||
2. **「Create Key」**をクリックします。
|
||||
3. キーの名前を入力し、作成を確認します。
|
||||
4. キーが生成されたら、それをコピーします。
|
||||
|
||||
## ステップ 2: API キーを環境変数として設定する
|
||||
ターミナルで以下のコマンドを実行し、`<your-api-key>` をコピーした実際のキーに置き換えます:
|
||||
```bash
|
||||
export DAYTONA_API_KEY="<your-api-key>"
|
||||
```
|
||||
|
||||
このステップにより、OpenHands が実行されるときに Daytona プラットフォームで認証できるようになります。
|
||||
|
||||
## ステップ 3: Docker を使用してローカルで OpenHands を実行する
|
||||
マシン上で最新バージョンの OpenHands を起動するには、ターミナルで次のコマンドを実行します:
|
||||
```bash
|
||||
bash -i <(curl -sL https://get.daytona.io/openhands)
|
||||
```
|
||||
|
||||
### このコマンドの動作:
|
||||
- 最新の OpenHands リリーススクリプトをダウンロードします。
|
||||
- インタラクティブな Bash セッションでスクリプトを実行します。
|
||||
- Docker を使用して OpenHands コンテナを自動的にプルして実行します。
|
||||
|
||||
実行すると、OpenHands がローカルで実行され、使用準備が整います。
|
||||
|
||||
詳細と手動初期化については、[README.md](https://github.com/All-Hands-AI/OpenHands/blob/main/openhands/runtime/impl/daytona/README.md) 全体を参照してください。
|
||||
@@ -0,0 +1,86 @@
|
||||
# Docker ランタイム
|
||||
|
||||
これは、OpenHands を起動するときに使用されるデフォルトのランタイムです。
|
||||
|
||||
## イメージ
|
||||
nikolaik の `SANDBOX_RUNTIME_CONTAINER_IMAGE` は、ランタイムサーバーと Python および NodeJS の基本的なユーティリティを含む事前ビルドされたランタイムイメージです。
|
||||
[独自のランタイムイメージを構築する](../how-to/custom-sandbox-guide)こともできます。
|
||||
|
||||
## ファイルシステムへの接続
|
||||
ここでの便利な機能の1つは、ローカルファイルシステムに接続する機能です。ファイルシステムをランタイムにマウントするには:
|
||||
1. `WORKSPACE_BASE` を設定します:
|
||||
|
||||
```bash
|
||||
export WORKSPACE_BASE=/path/to/your/code
|
||||
|
||||
# Linux と Mac の例
|
||||
# export WORKSPACE_BASE=$HOME/OpenHands
|
||||
# $WORKSPACE_BASE を /home/<username>/OpenHands に設定します
|
||||
#
|
||||
# Windows の WSL の例
|
||||
# export WORKSPACE_BASE=/mnt/c/dev/OpenHands
|
||||
# $WORKSPACE_BASE を C:\dev\OpenHands に設定します
|
||||
```
|
||||
2. 以下のオプションを `docker run` コマンドに追加します:
|
||||
|
||||
```bash
|
||||
docker run # ...
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.30-nikolaik \
|
||||
-e SANDBOX_USER_ID=$(id -u) \
|
||||
-e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
|
||||
-v $WORKSPACE_BASE:/opt/workspace_base \
|
||||
# ...
|
||||
```
|
||||
|
||||
注意してください!OpenHands エージェントがワークスペースにマウントされたファイルを削除または変更することを妨げるものはありません。
|
||||
|
||||
このセットアップはファイルのアクセス権に関する問題を引き起こす可能性がありますが(そのため `SANDBOX_USER_ID` 変数があります)、ほとんどのシステムでうまく機能します。
|
||||
|
||||
## 強化された Docker インストール
|
||||
|
||||
セキュリティが優先される環境に OpenHands をデプロイする場合は、強化された Docker 構成の実装を検討する必要があります。このセクションでは、デフォルト構成を超えて OpenHands Docker デプロイメントを保護するための推奨事項を提供します。
|
||||
|
||||
### セキュリティに関する考慮事項
|
||||
|
||||
README のデフォルトの Docker 構成は、ローカル開発マシンでの使いやすさを考慮して設計されています。公共ネットワーク(例:空港の WiFi)で実行している場合は、追加のセキュリティ対策を実装する必要があります。
|
||||
|
||||
### ネットワークバインディングのセキュリティ
|
||||
|
||||
デフォルトでは、OpenHands はすべてのネットワークインターフェース(`0.0.0.0`)にバインドされ、ホストが接続しているすべてのネットワークにインスタンスが公開される可能性があります。より安全なセットアップのために:
|
||||
|
||||
1. **ネットワークバインディングの制限**:
|
||||
|
||||
`runtime_binding_address` 構成を使用して、OpenHands がリッスンするネットワークインターフェースを制限します:
|
||||
|
||||
```bash
|
||||
docker run # ...
|
||||
-e SANDBOX_RUNTIME_BINDING_ADDRESS=127.0.0.1 \
|
||||
# ...
|
||||
```
|
||||
|
||||
この構成により、OpenHands はループバックインターフェース(`127.0.0.1`)でのみリッスンし、ローカルマシンからのみアクセス可能になります。
|
||||
|
||||
2. **ポートバインディングの保護**:
|
||||
|
||||
`-p` フラグを変更して、すべてのインターフェースではなくローカルホストにのみバインドします:
|
||||
|
||||
```bash
|
||||
docker run # ... \
|
||||
-p 127.0.0.1:3000:3000 \
|
||||
```
|
||||
|
||||
これにより、OpenHands ウェブインターフェースはローカルマシンからのみアクセス可能になり、ネットワーク上の他のマシンからはアクセスできなくなります。
|
||||
|
||||
### ネットワーク分離
|
||||
|
||||
Docker のネットワーク機能を使用して OpenHands を分離します:
|
||||
|
||||
```bash
|
||||
# 分離されたネットワークを作成
|
||||
docker network create openhands-network
|
||||
|
||||
# 分離されたネットワークで OpenHands を実行
|
||||
docker run # ... \
|
||||
--network openhands-network \
|
||||
docker.all-hands.dev/all-hands-ai/openhands:0.30
|
||||
```
|
||||
@@ -0,0 +1,62 @@
|
||||
# ローカルランタイム
|
||||
|
||||
ローカルランタイムを使用すると、OpenHands エージェントは Docker を使用せずに直接ローカルマシン上でアクションを実行できます。このランタイムは主に、Docker が利用できない CI パイプラインやテストシナリオなどの制御された環境向けです。
|
||||
|
||||
:::caution
|
||||
**セキュリティ警告**: ローカルランタイムはサンドボックス分離なしで実行されます。エージェントはマシン上のファイルに直接アクセスして変更できます。制御された環境でのみ、またはセキュリティへの影響を十分に理解している場合にのみ、このランタイムを使用してください。
|
||||
:::
|
||||
|
||||
## 前提条件
|
||||
|
||||
ローカルランタイムを使用する前に、以下を確認してください:
|
||||
|
||||
1. [開発セットアップ手順](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md)に従っていること。
|
||||
2. tmux がシステムで利用可能であること。
|
||||
|
||||
## 設定
|
||||
|
||||
ローカルランタイムを使用するには、モデル、API キーなどの必要な設定に加えて、OpenHands を起動するときに環境変数または[config.toml ファイル](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml)を介して以下のオプションを設定する必要があります:
|
||||
|
||||
- 環境変数を介して:
|
||||
|
||||
```bash
|
||||
# 必須
|
||||
export RUNTIME=local
|
||||
|
||||
# オプションですが推奨
|
||||
export WORKSPACE_BASE=/path/to/your/workspace
|
||||
```
|
||||
|
||||
- `config.toml` を介して:
|
||||
|
||||
```toml
|
||||
[core]
|
||||
runtime = "local"
|
||||
workspace_base = "/path/to/your/workspace"
|
||||
```
|
||||
|
||||
`WORKSPACE_BASE` が設定されていない場合、ランタイムはエージェントが作業するための一時ディレクトリを作成します。
|
||||
|
||||
## 使用例
|
||||
|
||||
以下は、ヘッドレスモードでローカルランタイムを使用して OpenHands を起動する例です:
|
||||
|
||||
```bash
|
||||
# ランタイムタイプをローカルに設定
|
||||
export RUNTIME=local
|
||||
|
||||
# オプションでワークスペースディレクトリを設定
|
||||
export WORKSPACE_BASE=/path/to/your/project
|
||||
|
||||
# OpenHands を起動
|
||||
poetry run python -m openhands.core.main -t "hi と出力する bash スクリプトを書いてください"
|
||||
```
|
||||
|
||||
## ユースケース
|
||||
|
||||
ローカルランタイムは特に以下の場合に役立ちます:
|
||||
|
||||
- Docker が利用できない CI/CD パイプライン。
|
||||
- OpenHands 自体のテストと開発。
|
||||
- コンテナの使用が制限されている環境。
|
||||
- ファイルシステムへの直接アクセスが必要なシナリオ。
|
||||
@@ -0,0 +1,13 @@
|
||||
# Modal ランタイム
|
||||
|
||||
[Modal](https://modal.com/) のパートナーが OpenHands 用のランタイムを提供しています。
|
||||
|
||||
Modal ランタイムを使用するには、アカウントを作成し、[API キーを作成](https://modal.com/settings)してください。
|
||||
|
||||
その後、OpenHands を起動するときに以下の環境変数を設定する必要があります:
|
||||
```bash
|
||||
docker run # ...
|
||||
-e RUNTIME=modal \
|
||||
-e MODAL_API_TOKEN_ID="your-id" \
|
||||
-e MODAL_API_TOKEN_SECRET="your-secret" \
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
# OpenHands リモートランタイム
|
||||
|
||||
OpenHands リモートランタイムは現在ベータ版です(詳細は[こちら](https://runtime.all-hands.dev/)を参照)。クラウド内で並列にランタイムを起動することができます。
|
||||
試してみたい場合は、[このフォーム](https://docs.google.com/forms/d/e/1FAIpQLSckVz_JFwg2_mOxNZjCtr7aoBFI2Mwdan3f75J_TrdMS1JV2g/viewform)に記入して申し込んでください!
|
||||
|
||||
注意:このランタイムは、[OpenHands 評価ハーネス](https://github.com/All-Hands-AI/OpenHands/tree/main/evaluation)を通じてのエージェント評価目的のみのために特別に設計されています。本番環境の OpenHands アプリケーションの起動には使用しないでください。
|
||||
@@ -0,0 +1,43 @@
|
||||
# 🚧 トラブルシューティング
|
||||
|
||||
:::tip
|
||||
OpenHandsはWSL経由でのみWindowsをサポートしています。必ずWSLターミナル内でコマンドを実行してください。
|
||||
:::
|
||||
|
||||
### Dockerクライアントの起動に失敗
|
||||
|
||||
**説明**
|
||||
|
||||
OpenHandsを実行する際に、以下のようなエラーが表示される:
|
||||
```
|
||||
Launch docker client failed. Please make sure you have installed docker and started docker desktop/daemon.
|
||||
```
|
||||
|
||||
**解決策**
|
||||
|
||||
以下の順番で試してみてください:
|
||||
* システム上で`docker`が実行されていることを確認します。ターミナルで`docker ps`が正常に実行できるはずです。
|
||||
* Docker Desktopを使用している場合は、`Settings > Advanced > Allow the default Docker socket to be used`が有効になっていることを確認してください。
|
||||
* 設定によっては、Docker Desktopで`Settings > Resources > Network > Enable host networking`を有効にする必要があるかもしれません。
|
||||
* Docker Desktopを再インストールしてみてください。
|
||||
---
|
||||
|
||||
# 開発ワークフロー固有の問題
|
||||
### runtimeのDockerイメージのビルドエラー
|
||||
|
||||
**説明**
|
||||
|
||||
新しいセッションの開始に失敗し、ログに以下のようなエラーが表示される:
|
||||
```
|
||||
debian-security bookworm-security
|
||||
InRelease At least one invalid signature was encountered.
|
||||
```
|
||||
|
||||
これは、既存の外部ライブラリのハッシュが変更され、ローカルのDockerインスタンスが以前のバージョンをキャッシュしている場合に発生するようです。これを回避するには、以下を試してみてください:
|
||||
|
||||
* 名前が`openhands-runtime-`で始まるコンテナを停止します:
|
||||
`docker ps --filter name=openhands-runtime- --filter status=running -aq | xargs docker stop`
|
||||
* 名前が`openhands-runtime-`で始まるコンテナを削除します:
|
||||
`docker rmi $(docker images --filter name=openhands-runtime- -q --no-trunc)`
|
||||
* 名前が`openhands-runtime-`で始まるコンテナ/イメージを停止して削除します
|
||||
* コンテナ/イメージをプルーンします: `docker container prune -f && docker image prune -f`
|
||||
@@ -0,0 +1,65 @@
|
||||
# ⬆️ アップグレードガイド
|
||||
|
||||
## 0.8.0 (2024-07-13)
|
||||
|
||||
### 重要な設定変更
|
||||
|
||||
このバージョンでは、バックエンドの設定にいくつかの重要な変更を導入しました。
|
||||
OpenHandsをフロントエンドインターフェース(Webインターフェース)のみで使用していた場合、特に対応は必要ありません。
|
||||
|
||||
以下は、設定の重要な変更点のリストです。これらは`main.py`経由でOpenHands CLIを使用しているユーザーにのみ適用されます。
|
||||
詳細については、[#2756](https://github.com/All-Hands-AI/OpenHands/pull/2756)を参照してください。
|
||||
|
||||
#### main.pyの--model-nameオプションの削除
|
||||
|
||||
`--model-name`オプション(または`-m`)は廃止されました。LLMの設定は`config.toml`または環境変数で行う必要があります。
|
||||
|
||||
#### LLM設定グループは'llm'のサブグループである必要がある
|
||||
|
||||
0.8より前のバージョンでは、`config.toml`内のLLM設定に任意の名前を使用できました。例:
|
||||
|
||||
```toml
|
||||
[gpt-4o]
|
||||
model="gpt-4o"
|
||||
api_key="<your_api_key>"
|
||||
```
|
||||
|
||||
その後、CLI引数の`--llm-config`を使用して、名前で目的のLLM設定グループを指定できました。
|
||||
これは機能しなくなりました。代わりに、設定グループは`llm`グループの下にある必要があります。例:
|
||||
|
||||
```toml
|
||||
[llm.gpt-4o]
|
||||
model="gpt-4o"
|
||||
api_key="<your_api_key>"
|
||||
```
|
||||
|
||||
`llm`という名前の設定グループがある場合は、変更する必要はありません。デフォルトのLLM設定グループとして使用されます。
|
||||
|
||||
#### 'agent'グループには'name'フィールドが含まれなくなった
|
||||
|
||||
0.8より前のバージョンでは、以下のような`agent`という名前の設定グループがあってもなくてもよかったです:
|
||||
|
||||
```toml
|
||||
[agent]
|
||||
name="CodeActAgent"
|
||||
memory_max_threads=2
|
||||
```
|
||||
|
||||
`name`フィールドは削除されたことに注意してください。代わりに、`core`グループの下に`default_agent`フィールドを置く必要があります。例:
|
||||
|
||||
```toml
|
||||
[core]
|
||||
# その他の設定
|
||||
default_agent='CodeActAgent'
|
||||
|
||||
[agent]
|
||||
llm_config='llm'
|
||||
memory_max_threads=2
|
||||
|
||||
[agent.CodeActAgent]
|
||||
llm_config='gpt-4o'
|
||||
```
|
||||
|
||||
`llm`サブグループと同様に、`agent`サブグループも定義できることに注意してください。
|
||||
さらに、エージェントを特定のLLM設定グループに関連付けることができます。
|
||||
詳細については、`config.template.toml`の例を参照してください。
|
||||
34
docs/i18n/ja/docusaurus-theme-classic/navbar.json
Normal file
34
docs/i18n/ja/docusaurus-theme-classic/navbar.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"title": {
|
||||
"message": "OpenHands",
|
||||
"description": "The title in the navbar"
|
||||
},
|
||||
"logo.alt": {
|
||||
"message": "OpenHands",
|
||||
"description": "The alt text of navbar logo"
|
||||
},
|
||||
"item.label.Docs": {
|
||||
"message": "ドキュメント",
|
||||
"description": "Navbar item with label Docs"
|
||||
},
|
||||
"item.label.Codebase": {
|
||||
"message": "コードベース",
|
||||
"description": "Navbar item with label Codebase"
|
||||
},
|
||||
"item.label.FAQ": {
|
||||
"message": "よくある質問",
|
||||
"description": "Navbar item with label FAQ"
|
||||
},
|
||||
"item.label.GitHub": {
|
||||
"message": "GitHub",
|
||||
"description": "Navbar item with label GitHub"
|
||||
},
|
||||
"item.label.User Guides": {
|
||||
"message": "ユーザーガイド",
|
||||
"description": "Navbar item with label User Guides"
|
||||
},
|
||||
"item.label.Company": {
|
||||
"message": "会社情報",
|
||||
"description": "Navbar item with label Company"
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,197 @@
|
||||
"sidebar.apiSidebar.category.Backend": {
|
||||
"message": "Backend",
|
||||
"description": "The label for category Backend in sidebar apiSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.User Guides": {
|
||||
"message": "Guias do Usuário",
|
||||
"description": "The label for category User Guides in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Running OpenHands": {
|
||||
"message": "Executando OpenHands",
|
||||
"description": "The label for category Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Prompting": {
|
||||
"message": "Prompting",
|
||||
"description": "The label for category Prompting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Architecture": {
|
||||
"message": "Arquitetura",
|
||||
"description": "The label for category Architecture in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Running OpenHands": {
|
||||
"message": "Executando OpenHands",
|
||||
"description": "The label for document Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Getting Started": {
|
||||
"message": "Começando",
|
||||
"description": "The label for document Getting Started in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Key Features": {
|
||||
"message": "Recursos Principais",
|
||||
"description": "The label for document Key Features in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Customization": {
|
||||
"message": "Personalização",
|
||||
"description": "The label for category Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Usage Methods": {
|
||||
"message": "Métodos de Uso",
|
||||
"description": "The label for category Usage Methods in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Advanced Configuration": {
|
||||
"message": "Configuração Avançada",
|
||||
"description": "The label for category Advanced Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Troubleshooting": {
|
||||
"message": "Solução de Problemas",
|
||||
"description": "The label for document Troubleshooting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Feedback": {
|
||||
"message": "Feedback",
|
||||
"description": "The label for document Feedback in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.For OpenHands Developers": {
|
||||
"message": "Para Desenvolvedores OpenHands",
|
||||
"description": "The label for category For OpenHands Developers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.About": {
|
||||
"message": "Sobre",
|
||||
"description": "The label for document About in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Best Practices": {
|
||||
"message": "Melhores Práticas",
|
||||
"description": "The label for document Best Practices in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Microagents": {
|
||||
"message": "Microagentes",
|
||||
"description": "The label for category Microagents in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Overview": {
|
||||
"message": "Visão Geral",
|
||||
"description": "The label for document Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository": {
|
||||
"message": "Repositório",
|
||||
"description": "The label for document Repository in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Public": {
|
||||
"message": "Público",
|
||||
"description": "The label for document Public in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository Customization": {
|
||||
"message": "Personalização de Repositório",
|
||||
"description": "The label for document Repository Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.GUI Mode": {
|
||||
"message": "Modo GUI",
|
||||
"description": "The label for document GUI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.CLI Mode": {
|
||||
"message": "Modo CLI",
|
||||
"description": "The label for document CLI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Headless Mode": {
|
||||
"message": "Modo Headless",
|
||||
"description": "The label for document Headless Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Github Action": {
|
||||
"message": "GitHub Action",
|
||||
"description": "The label for document Github Action in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Cloud": {
|
||||
"message": "Nuvem",
|
||||
"description": "The label for category Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Openhands Cloud": {
|
||||
"message": "OpenHands Cloud",
|
||||
"description": "The label for document Openhands Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Cloud GitHub Resolver": {
|
||||
"message": "Resolvedor GitHub Cloud",
|
||||
"description": "The label for document Cloud GitHub Resolver in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.LLM Configuration": {
|
||||
"message": "Configuração LLM",
|
||||
"description": "The label for category LLM Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Providers": {
|
||||
"message": "Provedores",
|
||||
"description": "The label for category Providers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Azure": {
|
||||
"message": "Azure",
|
||||
"description": "The label for document Azure in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Google": {
|
||||
"message": "Google",
|
||||
"description": "The label for document Google in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Groq": {
|
||||
"message": "Groq",
|
||||
"description": "The label for document Groq in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.LiteLLM Proxy": {
|
||||
"message": "Proxy LiteLLM",
|
||||
"description": "The label for document LiteLLM Proxy in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenAI": {
|
||||
"message": "OpenAI",
|
||||
"description": "The label for document OpenAI in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenRouter": {
|
||||
"message": "OpenRouter",
|
||||
"description": "The label for document OpenRouter in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Runtime Configuration": {
|
||||
"message": "Configuração de Runtime",
|
||||
"description": "The label for category Runtime Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Docker Runtime": {
|
||||
"message": "Runtime Docker",
|
||||
"description": "The label for document Docker Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Remote Runtime": {
|
||||
"message": "Runtime Remoto",
|
||||
"description": "The label for document Remote Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Modal Runtime": {
|
||||
"message": "Runtime Modal",
|
||||
"description": "The label for document Modal Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Daytona Runtime": {
|
||||
"message": "Runtime Daytona",
|
||||
"description": "The label for document Daytona Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Local Runtime": {
|
||||
"message": "Runtime Local",
|
||||
"description": "The label for document Local Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Configuration Options": {
|
||||
"message": "Opções de Configuração",
|
||||
"description": "The label for document Configuration Options in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Custom Sandbox": {
|
||||
"message": "Sandbox Personalizado",
|
||||
"description": "The label for document Custom Sandbox in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Development Overview": {
|
||||
"message": "Visão Geral de Desenvolvimento",
|
||||
"description": "The label for document Development Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Backend": {
|
||||
"message": "Backend",
|
||||
"description": "The label for document Backend in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Runtime": {
|
||||
"message": "Runtime",
|
||||
"description": "The label for document Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Debugging": {
|
||||
"message": "Depuração",
|
||||
"description": "The label for document Debugging in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Evaluation": {
|
||||
"message": "Avaliação",
|
||||
"description": "The label for document Evaluation in sidebar docsSidebar"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Executando o OpenHands
|
||||
# Executando OpenHands
|
||||
|
||||
## Requisitos do Sistema
|
||||
|
||||
|
||||
@@ -12,7 +12,199 @@
|
||||
"description": "The label for category 🚧 故障排除 in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.apiSidebar.category.Backend": {
|
||||
"message": "Backend",
|
||||
"message": "后端",
|
||||
"description": "The label for category Backend in sidebar apiSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.User Guides": {
|
||||
"message": "用户指南",
|
||||
"description": "The label for category User Guides in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Running OpenHands": {
|
||||
"message": "运行 OpenHands",
|
||||
"description": "The label for category Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Prompting": {
|
||||
"message": "提示",
|
||||
"description": "The label for category Prompting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Architecture": {
|
||||
"message": "架构",
|
||||
"description": "The label for category Architecture in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Running OpenHands": {
|
||||
"message": "运行 OpenHands",
|
||||
"description": "The label for document Running OpenHands in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Getting Started": {
|
||||
"message": "入门",
|
||||
"description": "The label for document Getting Started in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Key Features": {
|
||||
"message": "主要功能",
|
||||
"description": "The label for document Key Features in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Customization": {
|
||||
"message": "自定义",
|
||||
"description": "The label for category Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Usage Methods": {
|
||||
"message": "使用方法",
|
||||
"description": "The label for category Usage Methods in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Advanced Configuration": {
|
||||
"message": "高级配置",
|
||||
"description": "The label for category Advanced Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Troubleshooting": {
|
||||
"message": "故障排除",
|
||||
"description": "The label for document Troubleshooting in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Feedback": {
|
||||
"message": "反馈",
|
||||
"description": "The label for document Feedback in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.For OpenHands Developers": {
|
||||
"message": "OpenHands 开发者",
|
||||
"description": "The label for category For OpenHands Developers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.About": {
|
||||
"message": "关于",
|
||||
"description": "The label for document About in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Best Practices": {
|
||||
"message": "最佳实践",
|
||||
"description": "The label for document Best Practices in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Microagents": {
|
||||
"message": "微代理",
|
||||
"description": "The label for category Microagents in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Overview": {
|
||||
"message": "概述",
|
||||
"description": "The label for document Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository": {
|
||||
"message": "仓库",
|
||||
"description": "The label for document Repository in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Public": {
|
||||
"message": "公共",
|
||||
"description": "The label for document Public in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Repository Customization": {
|
||||
"message": "仓库自定义",
|
||||
"description": "The label for document Repository Customization in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.GUI Mode": {
|
||||
"message": "GUI 模式",
|
||||
"description": "The label for document GUI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.CLI Mode": {
|
||||
"message": "CLI 模式",
|
||||
"description": "The label for document CLI Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Headless Mode": {
|
||||
"message": "无头模式",
|
||||
"description": "The label for document Headless Mode in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Github Action": {
|
||||
"message": "GitHub Action",
|
||||
"description": "The label for document Github Action in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Cloud": {
|
||||
"message": "云",
|
||||
"description": "The label for category Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Openhands Cloud": {
|
||||
"message": "OpenHands 云",
|
||||
"description": "The label for document Openhands Cloud in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Cloud GitHub Resolver": {
|
||||
"message": "云 GitHub 解析器",
|
||||
"description": "The label for document Cloud GitHub Resolver in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.LLM Configuration": {
|
||||
"message": "LLM 配置",
|
||||
"description": "The label for category LLM Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Providers": {
|
||||
"message": "提供商",
|
||||
"description": "The label for category Providers in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Azure": {
|
||||
"message": "Azure",
|
||||
"description": "The label for document Azure in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Google": {
|
||||
"message": "Google",
|
||||
"description": "The label for document Google in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Groq": {
|
||||
"message": "Groq",
|
||||
"description": "The label for document Groq in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.LiteLLM Proxy": {
|
||||
"message": "LiteLLM 代理",
|
||||
"description": "The label for document LiteLLM Proxy in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenAI": {
|
||||
"message": "OpenAI",
|
||||
"description": "The label for document OpenAI in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.OpenRouter": {
|
||||
"message": "OpenRouter",
|
||||
"description": "The label for document OpenRouter in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.category.Runtime Configuration": {
|
||||
"message": "运行时配置",
|
||||
"description": "The label for category Runtime Configuration in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Docker Runtime": {
|
||||
"message": "Docker 运行时",
|
||||
"description": "The label for document Docker Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Remote Runtime": {
|
||||
"message": "远程运行时",
|
||||
"description": "The label for document Remote Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Modal Runtime": {
|
||||
"message": "Modal 运行时",
|
||||
"description": "The label for document Modal Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Daytona Runtime": {
|
||||
"message": "Daytona 运行时",
|
||||
"description": "The label for document Daytona Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Local Runtime": {
|
||||
"message": "本地运行时",
|
||||
"description": "The label for document Local Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Configuration Options": {
|
||||
"message": "配置选项",
|
||||
"description": "The label for document Configuration Options in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Custom Sandbox": {
|
||||
"message": "自定义沙箱",
|
||||
"description": "The label for document Custom Sandbox in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Development Overview": {
|
||||
"message": "开发概述",
|
||||
"description": "The label for document Development Overview in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Backend": {
|
||||
"message": "后端",
|
||||
"description": "The label for document Backend in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Runtime": {
|
||||
"message": "运行时",
|
||||
"description": "The label for document Runtime in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Debugging": {
|
||||
"message": "调试",
|
||||
"description": "The label for document Debugging in sidebar docsSidebar"
|
||||
},
|
||||
"sidebar.docsSidebar.doc.Evaluation": {
|
||||
"message": "评估",
|
||||
"description": "The label for document Evaluation in sidebar docsSidebar"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 安装
|
||||
# 运行 OpenHands
|
||||
|
||||
## 系统要求
|
||||
|
||||
|
||||
@@ -1,32 +1,14 @@
|
||||
{
|
||||
"docs/modules/python/python.md": "da5d692f477f4a213d77474f02850026",
|
||||
"docs/modules/usage/getting-started.mdx": "a01bc308197184468acf45e105e80651",
|
||||
"docs/modules/usage/agents.md": "9227679a22d810d6aab574a295bd273e",
|
||||
"docs/modules/usage/about.md": "5e7509aadb213a1c1a48e0de1858e55f",
|
||||
"docs/modules/usage/feedback.md": "c2d135cb1368f39a4d34d7ad0e3eeafd",
|
||||
"docs/modules/usage/runtimes.md": "4b5927f2654b328e1f94ab9098ab4441",
|
||||
"docs/modules/usage/installation.mdx": "a552e56d6af1af0893568a1bd396f692",
|
||||
"docs/modules/usage/configuration-options.md": "9907ec2c99dd084cb4e8acb03d6000e5",
|
||||
"docs/modules/usage/prompting/microagents.md": "fb278bcb98f6e049e7deb512b1288ebf",
|
||||
"docs/modules/usage/prompting/customization.md": "935b2cbeef113e043219c312b77803ed",
|
||||
"docs/modules/usage/prompting/prompting-best-practices.md": "2dc7a8130973e246d559e4222ad5f2e7",
|
||||
"docs/modules/usage/troubleshooting/troubleshooting.md": "a882fb995a404d1b4988a5d878d9285f",
|
||||
"docs/modules/usage/how-to/gui-mode.md": "54afe83d5d8e13395add7bf64205d589",
|
||||
"docs/modules/usage/how-to/evaluation-harness.md": "c28a79ecac02933c463197e33c3034e3",
|
||||
"docs/modules/usage/how-to/github-action.md": "a2ba43f6592453925038b1a14038a882",
|
||||
"docs/modules/usage/how-to/headless-mode.md": "27d251e230f2027d64d2be9cfc7e3301",
|
||||
"docs/modules/usage/how-to/custom-sandbox-guide.md": "f8478796084b118e990182204610e1b4",
|
||||
"docs/modules/usage/how-to/debugging.md": "d846a3eb9384ab24f3e1b3e8161b5f1a",
|
||||
"docs/modules/usage/how-to/persist-session-data.md": "5733d67f15ed2eb4212c0e7457d4c253",
|
||||
"docs/modules/usage/how-to/cli-mode.md": "476d62f7c38ae74da8e519769132d077",
|
||||
"docs/modules/usage/architecture/backend.mdx": "3aa3d71833438063a344453e64e7029b",
|
||||
"docs/modules/usage/architecture/runtime.md": "83b213c35bd3b0d284dd236ce0a7c2d2",
|
||||
"docs/modules/usage/llms/llms.md": "5db0a92e832c57ca6e2b70459df40096",
|
||||
"docs/modules/usage/llms/local-llms.md": "63b6966e52ab9f3f6818f0c1108d5061",
|
||||
"docs/modules/usage/llms/groq.md": "b0c6c5fc0955afa46628b1cf3bb8a363",
|
||||
"docs/modules/usage/llms/google-llms.md": "0ff0f62503db41f2a3329db218c86b3f",
|
||||
"docs/modules/usage/llms/openai-llms.md": "46c05cd1f12db498d352e23d7b06beba",
|
||||
"docs/modules/usage/llms/azure-llms.md": "af4b524a90a0c29e1e0981a1a4234fe8",
|
||||
"docs/modules/usage/llms/litellm-proxy.md": "0a3a5f75488d78bfaf9ad299e66c8af3",
|
||||
"docs/modules/usage/llms/openrouter.md": "5027074af745c63491edf7fe3f5a242d"
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ LANGUAGES = {
|
||||
'fr': 'French',
|
||||
'zh-Hans': 'Simplified Chinese',
|
||||
'pt-BR': 'Brazilian Portuguese',
|
||||
'ja': 'Japanese',
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +43,7 @@ def load_file_hashes():
|
||||
def save_file_hashes(hashes):
|
||||
"""Save current file hashes."""
|
||||
with open(CACHE_FILE, 'w') as f:
|
||||
json.dump(hashes, f)
|
||||
json.dump(hashes, f, indent=4)
|
||||
|
||||
|
||||
def get_translation_path(source_path, lang):
|
||||
|
||||
5283
docs/yarn.lock
5283
docs/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -27,8 +27,16 @@ Your primary role is to assist users by executing commands, modifying code, and
|
||||
* When configuring git credentials, use "openhands" as the user.name and "openhands@all-hands.dev" as the user.email by default, unless explicitly instructed otherwise.
|
||||
* Exercise caution with git operations. Do NOT make potentially dangerous changes (e.g., pushing to main, deleting repositories) unless explicitly asked to do so.
|
||||
* When committing changes, use `git status` to see all modified files, and stage all files necessary for the commit. Use `git commit -a` whenever possible.
|
||||
* Do NOT commit files that typically shouldn't go into version control (e.g., node_modules/, .env files, build directories, cache files, large binaries) unless explicitly instructed by the user.
|
||||
* If unsure about committing certain files, check for the presence of .gitignore files or ask the user for clarification.
|
||||
</VERSION_CONTROL>
|
||||
|
||||
<PULL_REQUESTS>
|
||||
* When creating pull requests, create only ONE per session/issue unless explicitly instructed otherwise.
|
||||
* When working with an existing PR, update it with new commits rather than creating additional PRs for the same issue.
|
||||
* When updating a PR, preserve the original PR title and purpose, updating description only when necessary.
|
||||
</PULL_REQUESTS>
|
||||
|
||||
<PROBLEM_SOLVING_WORKFLOW>
|
||||
1. EXPLORATION: Thoroughly explore relevant files and understand the context before proposing solutions
|
||||
2. ANALYSIS: Consider multiple approaches and select the most promising one
|
||||
|
||||
@@ -18,6 +18,11 @@ More than 2-3 actions usually leads to failure or unexpected behavior. Example:
|
||||
fill('a12', 'example with "quotes"')
|
||||
click('a51')
|
||||
click('48', button='middle', modifiers=['Shift'])
|
||||
|
||||
You can also use the browser to view pdf, png, jpg files.
|
||||
You should first check the content of /tmp/oh-server-url to get the server url, and then use it to view the file by `goto("{server_url}/view?path={absolute_file_path}")`.
|
||||
For example: `goto("http://localhost:8000/view?path=/workspace/test_document.pdf")`
|
||||
Note: The file should be downloaded to the local machine first before using the browser to view it.
|
||||
"""
|
||||
|
||||
_BROWSER_TOOL_DESCRIPTION = """
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from litellm import ChatCompletionToolParam, ChatCompletionToolParamFunctionChunk
|
||||
|
||||
_WEB_DESCRIPTION = """Read (convert to markdown) content from a webpage. You should prefer using the `web_read` tool over the `browser` tool, but do use the `browser` tool if you need to interact with a webpage (e.g., click a button, fill out a form, etc.).
|
||||
_WEB_DESCRIPTION = """Read (convert to markdown) content from a webpage. You should prefer using the `web_read` tool over the `browser` tool, but do use the `browser` tool if you need to interact with a webpage (e.g., click a button, fill out a form, etc.) OR read a webpage that contains images.
|
||||
|
||||
You may use the `web_read` tool to read content from a webpage, and even search the webpage content using a Google search query (e.g., url=`https://www.google.com/search?q=YOUR_QUERY`).
|
||||
You may use the `web_read` tool to read text content from a webpage, and even search the webpage content using a Google search query (e.g., url=`https://www.google.com/search?q=YOUR_QUERY`).
|
||||
"""
|
||||
|
||||
WebReadTool = ChatCompletionToolParam(
|
||||
|
||||
@@ -228,7 +228,8 @@ class AgentController:
|
||||
e: Exception,
|
||||
):
|
||||
"""React to an exception by setting the agent state to error and sending a status message."""
|
||||
await self.set_agent_state_to(AgentState.ERROR)
|
||||
error_message = type(e).__name__ + ': ' + str(e)
|
||||
|
||||
if self.status_callback is not None:
|
||||
err_id = ''
|
||||
if isinstance(e, AuthenticationError):
|
||||
@@ -249,7 +250,9 @@ class AgentController:
|
||||
elif isinstance(e, RateLimitError):
|
||||
await self.set_agent_state_to(AgentState.RATE_LIMITED)
|
||||
return
|
||||
self.status_callback('error', err_id, type(e).__name__ + ': ' + str(e))
|
||||
self.status_callback('error', err_id, error_message)
|
||||
|
||||
await self.set_agent_state_to(AgentState.ERROR, reason=error_message)
|
||||
|
||||
def step(self):
|
||||
asyncio.create_task(self._step_with_exception_handling())
|
||||
@@ -524,11 +527,12 @@ class AgentController:
|
||||
self._pending_action = None
|
||||
self.agent.reset()
|
||||
|
||||
async def set_agent_state_to(self, new_state: AgentState) -> None:
|
||||
async def set_agent_state_to(self, new_state: AgentState, reason: str = "") -> None:
|
||||
"""Updates the agent's state and handles side effects. Can emit events to the event stream.
|
||||
|
||||
Args:
|
||||
new_state (AgentState): The new state to set for the agent.
|
||||
reason (str, optional): The reason for the state change, particularly useful for ERROR state.
|
||||
"""
|
||||
self.log(
|
||||
'info',
|
||||
@@ -538,6 +542,10 @@ class AgentController:
|
||||
if new_state == self.state.agent_state:
|
||||
return
|
||||
|
||||
# Store error reason if provided
|
||||
if new_state == AgentState.ERROR and reason:
|
||||
self.state.last_error = reason
|
||||
|
||||
if new_state in (AgentState.STOPPED, AgentState.ERROR):
|
||||
# sync existing metrics BEFORE resetting the agent
|
||||
await self.update_state_after_step()
|
||||
@@ -583,7 +591,7 @@ class AgentController:
|
||||
|
||||
self.state.agent_state = new_state
|
||||
self.event_stream.add_event(
|
||||
AgentStateChangedObservation('', self.state.agent_state),
|
||||
AgentStateChangedObservation('', self.state.agent_state, reason=reason if new_state == AgentState.ERROR else ""),
|
||||
EventSource.ENVIRONMENT,
|
||||
)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class AgentConfig(BaseModel):
|
||||
enable_prompt_extensions: bool = Field(default=True)
|
||||
disabled_microagents: list[str] = Field(default_factory=list)
|
||||
enable_history_truncation: bool = Field(default=True)
|
||||
enable_som_visual_browsing: bool = Field(default=False)
|
||||
enable_som_visual_browsing: bool = Field(default=True)
|
||||
condenser: CondenserConfig = Field(
|
||||
default_factory=lambda: NoOpCondenserConfig(type='noop')
|
||||
)
|
||||
|
||||
@@ -23,8 +23,7 @@ async def run_agent_until_done(
|
||||
if msg_type == 'error':
|
||||
logger.error(msg)
|
||||
if controller:
|
||||
controller.state.last_error = msg
|
||||
asyncio.create_task(controller.set_agent_state_to(AgentState.ERROR))
|
||||
asyncio.create_task(controller.set_agent_state_to(AgentState.ERROR, reason=msg))
|
||||
else:
|
||||
logger.info(msg)
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ async def run_controller(
|
||||
file_path = config.save_trajectory_path
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
histories = controller.get_trajectory(config.save_screenshots_in_trajectory)
|
||||
with open(file_path, 'w') as f:
|
||||
with open(file_path, 'w') as f: # noqa: ASYNC101
|
||||
json.dump(histories, f, indent=4)
|
||||
|
||||
return state
|
||||
|
||||
@@ -10,10 +10,13 @@ class AgentStateChangedObservation(Observation):
|
||||
"""This data class represents the result from delegating to another agent"""
|
||||
|
||||
agent_state: str
|
||||
reason: str = ""
|
||||
observation: str = ObservationType.AGENT_STATE_CHANGED
|
||||
|
||||
@property
|
||||
def message(self) -> str:
|
||||
if self.agent_state == "error" and self.reason:
|
||||
return f"Error: {self.reason}"
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
@@ -347,8 +347,6 @@ class ConversationMemory:
|
||||
text = obs.get_agent_obs_text()
|
||||
if (
|
||||
obs.trigger_by_action == ActionType.BROWSE_INTERACTIVE
|
||||
and obs.set_of_marks is not None
|
||||
and len(obs.set_of_marks) > 0
|
||||
and enable_som_visual_browsing
|
||||
and vision_is_active
|
||||
):
|
||||
@@ -357,14 +355,27 @@ class ConversationMemory:
|
||||
role='user',
|
||||
content=[
|
||||
TextContent(text=text),
|
||||
ImageContent(image_urls=[obs.set_of_marks]),
|
||||
ImageContent(
|
||||
image_urls=[
|
||||
# show set of marks if it exists
|
||||
# otherwise, show raw screenshot when using vision-supported model
|
||||
obs.set_of_marks
|
||||
if obs.set_of_marks is not None
|
||||
and len(obs.set_of_marks) > 0
|
||||
else obs.screenshot
|
||||
]
|
||||
),
|
||||
],
|
||||
)
|
||||
logger.debug(
|
||||
f'Vision enabled for browsing, showing {"set of marks" if obs.set_of_marks and len(obs.set_of_marks) > 0 else "screenshot"}'
|
||||
)
|
||||
else:
|
||||
message = Message(
|
||||
role='user',
|
||||
content=[TextContent(text=text)],
|
||||
)
|
||||
logger.debug('Vision disabled for browsing, showing text')
|
||||
elif isinstance(obs, AgentDelegateObservation):
|
||||
text = truncate_content(
|
||||
obs.outputs['content'] if 'content' in obs.outputs else '',
|
||||
|
||||
@@ -11,7 +11,6 @@ from typing import Any, Awaitable, TextIO
|
||||
from pydantic import SecretStr
|
||||
from tqdm import tqdm
|
||||
|
||||
import openhands
|
||||
from openhands.core.config import LLMConfig
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.resolver.interfaces.issue import Issue
|
||||
@@ -111,7 +110,7 @@ async def resolve_issues(
|
||||
# checkout the repo
|
||||
repo_dir = os.path.join(output_dir, 'repo')
|
||||
if not os.path.exists(repo_dir):
|
||||
checkout_output = subprocess.check_output(
|
||||
checkout_output = subprocess.check_output( # noqa: ASYNC101
|
||||
[
|
||||
'git',
|
||||
'clone',
|
||||
@@ -124,7 +123,7 @@ async def resolve_issues(
|
||||
|
||||
# get the commit id of current repo for reproducibility
|
||||
base_commit = (
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
|
||||
.decode('utf-8')
|
||||
.strip()
|
||||
)
|
||||
@@ -134,7 +133,7 @@ async def resolve_issues(
|
||||
# Check for .openhands_instructions file in the workspace directory
|
||||
openhands_instructions_path = os.path.join(repo_dir, '.openhands_instructions')
|
||||
if os.path.exists(openhands_instructions_path):
|
||||
with open(openhands_instructions_path, 'r') as f:
|
||||
with open(openhands_instructions_path, 'r') as f: # noqa: ASYNC101
|
||||
repo_instruction = f.read()
|
||||
|
||||
# OUTPUT FILE
|
||||
@@ -142,14 +141,14 @@ async def resolve_issues(
|
||||
logger.info(f'Writing output to {output_file}')
|
||||
finished_numbers = set()
|
||||
if os.path.exists(output_file):
|
||||
with open(output_file, 'r') as f:
|
||||
with open(output_file, 'r') as f: # noqa: ASYNC101
|
||||
for line in f:
|
||||
data = ResolverOutput.model_validate_json(line)
|
||||
finished_numbers.add(data.issue.number)
|
||||
logger.warning(
|
||||
f'Output file {output_file} already exists. Loaded {len(finished_numbers)} finished issues.'
|
||||
)
|
||||
output_fp = open(output_file, 'a')
|
||||
output_fp = open(output_file, 'a') # noqa: ASYNC101
|
||||
|
||||
logger.info(
|
||||
f'Resolving issues with model {model_name}, max iterations {max_iterations}.'
|
||||
@@ -182,13 +181,13 @@ async def resolve_issues(
|
||||
f'Checking out to PR branch {issue.head_branch} for issue {issue.number}'
|
||||
)
|
||||
|
||||
subprocess.check_output(
|
||||
subprocess.check_output( # noqa: ASYNC101
|
||||
['git', 'checkout', f'{issue.head_branch}'],
|
||||
cwd=repo_dir,
|
||||
)
|
||||
|
||||
base_commit = (
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
|
||||
.decode('utf-8')
|
||||
.strip()
|
||||
)
|
||||
@@ -329,9 +328,7 @@ def main() -> None:
|
||||
|
||||
runtime_container_image = my_args.runtime_container_image
|
||||
if runtime_container_image is None:
|
||||
runtime_container_image = (
|
||||
f'ghcr.io/all-hands-ai/runtime:{openhands.__version__}-nikolaik'
|
||||
)
|
||||
runtime_container_image = 'ghcr.io/all-hands-ai/runtime:0.30.0-nikolaik'
|
||||
|
||||
owner, repo = my_args.selected_repo.split('/')
|
||||
token = my_args.token or os.getenv('GITHUB_TOKEN') or os.getenv('GITLAB_TOKEN')
|
||||
|
||||
@@ -429,7 +429,7 @@ async def resolve_issue(
|
||||
# checkout the repo
|
||||
repo_dir = os.path.join(output_dir, 'repo')
|
||||
if not os.path.exists(repo_dir):
|
||||
checkout_output = subprocess.check_output(
|
||||
checkout_output = subprocess.check_output( # noqa: ASYNC101
|
||||
[
|
||||
'git',
|
||||
'clone',
|
||||
@@ -442,7 +442,7 @@ async def resolve_issue(
|
||||
|
||||
# get the commit id of current repo for reproducibility
|
||||
base_commit = (
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
|
||||
.decode('utf-8')
|
||||
.strip()
|
||||
)
|
||||
@@ -452,7 +452,7 @@ async def resolve_issue(
|
||||
# Check for .openhands_instructions file in the workspace directory
|
||||
openhands_instructions_path = os.path.join(repo_dir, '.openhands_instructions')
|
||||
if os.path.exists(openhands_instructions_path):
|
||||
with open(openhands_instructions_path, 'r') as f:
|
||||
with open(openhands_instructions_path, 'r') as f: # noqa: ASYNC101
|
||||
repo_instruction = f.read()
|
||||
|
||||
# OUTPUT FILE
|
||||
@@ -461,7 +461,7 @@ async def resolve_issue(
|
||||
|
||||
# Check if this issue was already processed
|
||||
if os.path.exists(output_file):
|
||||
with open(output_file, 'r') as f:
|
||||
with open(output_file, 'r') as f: # noqa: ASYNC101
|
||||
for line in f:
|
||||
data = ResolverOutput.model_validate_json(line)
|
||||
if data.issue.number == issue_number:
|
||||
@@ -470,7 +470,7 @@ async def resolve_issue(
|
||||
)
|
||||
return
|
||||
|
||||
output_fp = open(output_file, 'a')
|
||||
output_fp = open(output_file, 'a') # noqa: ASYNC101
|
||||
|
||||
logger.info(
|
||||
f'Resolving issue {issue_number} with Agent {AGENT_CLASS}, model {model_name}, max iterations {max_iterations}.'
|
||||
@@ -489,20 +489,20 @@ async def resolve_issue(
|
||||
|
||||
# Fetch the branch first to ensure it exists locally
|
||||
fetch_cmd = ['git', 'fetch', 'origin', branch_to_use]
|
||||
subprocess.check_output(
|
||||
subprocess.check_output( # noqa: ASYNC101
|
||||
fetch_cmd,
|
||||
cwd=repo_dir,
|
||||
)
|
||||
|
||||
# Checkout the branch
|
||||
checkout_cmd = ['git', 'checkout', branch_to_use]
|
||||
subprocess.check_output(
|
||||
subprocess.check_output( # noqa: ASYNC101
|
||||
checkout_cmd,
|
||||
cwd=repo_dir,
|
||||
)
|
||||
|
||||
base_commit = (
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir)
|
||||
subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=repo_dir) # noqa: ASYNC101
|
||||
.decode('utf-8')
|
||||
.strip()
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ from zipfile import ZipFile
|
||||
|
||||
from fastapi import Depends, FastAPI, HTTPException, Request, UploadFile
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import FileResponse, JSONResponse
|
||||
from fastapi.responses import FileResponse, HTMLResponse, JSONResponse
|
||||
from fastapi.security import APIKeyHeader
|
||||
from openhands_aci.editor.editor import OHEditor
|
||||
from openhands_aci.editor.exceptions import ToolError
|
||||
@@ -58,6 +58,7 @@ from openhands.runtime.browser import browse
|
||||
from openhands.runtime.browser.browser_env import BrowserEnv
|
||||
from openhands.runtime.plugins import ALL_PLUGINS, JupyterPlugin, Plugin, VSCodePlugin
|
||||
from openhands.runtime.utils.bash import BashSession
|
||||
from openhands.runtime.utils.file_viewer import generate_file_viewer_html
|
||||
from openhands.runtime.utils.files import insert_lines, read_lines
|
||||
from openhands.runtime.utils.memory_monitor import MemoryMonitor
|
||||
from openhands.runtime.utils.runtime_init import init_user_and_working_directory
|
||||
@@ -375,7 +376,7 @@ class ActionExecutor:
|
||||
filepath = self._resolve_path(action.path, working_dir)
|
||||
try:
|
||||
if filepath.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif')):
|
||||
with open(filepath, 'rb') as file:
|
||||
with open(filepath, 'rb') as file: # noqa: ASYNC101
|
||||
image_data = file.read()
|
||||
encoded_image = base64.b64encode(image_data).decode('utf-8')
|
||||
mime_type, _ = mimetypes.guess_type(filepath)
|
||||
@@ -385,13 +386,13 @@ class ActionExecutor:
|
||||
|
||||
return FileReadObservation(path=filepath, content=encoded_image)
|
||||
elif filepath.lower().endswith('.pdf'):
|
||||
with open(filepath, 'rb') as file:
|
||||
with open(filepath, 'rb') as file: # noqa: ASYNC101
|
||||
pdf_data = file.read()
|
||||
encoded_pdf = base64.b64encode(pdf_data).decode('utf-8')
|
||||
encoded_pdf = f'data:application/pdf;base64,{encoded_pdf}'
|
||||
return FileReadObservation(path=filepath, content=encoded_pdf)
|
||||
elif filepath.lower().endswith(('.mp4', '.webm', '.ogg')):
|
||||
with open(filepath, 'rb') as file:
|
||||
with open(filepath, 'rb') as file: # noqa: ASYNC101
|
||||
video_data = file.read()
|
||||
encoded_video = base64.b64encode(video_data).decode('utf-8')
|
||||
mime_type, _ = mimetypes.guess_type(filepath)
|
||||
@@ -401,7 +402,7 @@ class ActionExecutor:
|
||||
|
||||
return FileReadObservation(path=filepath, content=encoded_video)
|
||||
|
||||
with open(filepath, 'r', encoding='utf-8') as file:
|
||||
with open(filepath, 'r', encoding='utf-8') as file: # noqa: ASYNC101
|
||||
lines = read_lines(file.readlines(), action.start, action.end)
|
||||
except FileNotFoundError:
|
||||
return ErrorObservation(
|
||||
@@ -434,7 +435,7 @@ class ActionExecutor:
|
||||
|
||||
mode = 'w' if not file_exists else 'r+'
|
||||
try:
|
||||
with open(filepath, mode, encoding='utf-8') as file:
|
||||
with open(filepath, mode, encoding='utf-8') as file: # noqa: ASYNC101
|
||||
if mode != 'w':
|
||||
all_lines = file.readlines()
|
||||
new_file = insert_lines(insert, all_lines, action.start, action.end)
|
||||
@@ -531,6 +532,11 @@ if __name__ == '__main__':
|
||||
# example: python client.py 8000 --working-dir /workspace --plugins JupyterRequirement
|
||||
args = parser.parse_args()
|
||||
|
||||
port_path = '/tmp/oh-server-url'
|
||||
os.makedirs(os.path.dirname(port_path), exist_ok=True)
|
||||
with open(port_path, 'w') as f:
|
||||
f.write(f'http://127.0.0.1:{args.port}')
|
||||
|
||||
plugins_to_load: list[Plugin] = []
|
||||
if args.plugins:
|
||||
for plugin in args.plugins:
|
||||
@@ -651,7 +657,7 @@ if __name__ == '__main__':
|
||||
)
|
||||
|
||||
zip_path = os.path.join(full_dest_path, file.filename)
|
||||
with open(zip_path, 'wb') as buffer:
|
||||
with open(zip_path, 'wb') as buffer: # noqa: ASYNC101
|
||||
shutil.copyfileobj(file.file, buffer)
|
||||
|
||||
# Extract the zip file
|
||||
@@ -664,7 +670,7 @@ if __name__ == '__main__':
|
||||
else:
|
||||
# For single file uploads
|
||||
file_path = os.path.join(full_dest_path, file.filename)
|
||||
with open(file_path, 'wb') as buffer:
|
||||
with open(file_path, 'wb') as buffer: # noqa: ASYNC101
|
||||
shutil.copyfileobj(file.file, buffer)
|
||||
logger.debug(f'Uploaded file {file.filename} to {destination}')
|
||||
|
||||
@@ -811,5 +817,53 @@ if __name__ == '__main__':
|
||||
logger.error(f'Error listing files: {e}')
|
||||
return []
|
||||
|
||||
@app.get('/view')
|
||||
async def view_file(path: str, request: Request):
|
||||
"""View a file using an embedded viewer.
|
||||
|
||||
Args:
|
||||
path (str): The absolute path of the file to view.
|
||||
request (Request): The FastAPI request object.
|
||||
|
||||
Returns:
|
||||
HTMLResponse: An HTML page with an appropriate viewer for the file.
|
||||
"""
|
||||
# Security check: Only allow requests from localhost
|
||||
client_host = request.client.host if request.client else None
|
||||
if client_host not in ['127.0.0.1', 'localhost', '::1']:
|
||||
logger.warning(f'Unauthorized file view attempt from {client_host}')
|
||||
return HTMLResponse(
|
||||
content='<h1>Access Denied</h1><p>This endpoint is only accessible from localhost</p>',
|
||||
status_code=403,
|
||||
)
|
||||
|
||||
if not os.path.isabs(path):
|
||||
return HTMLResponse(
|
||||
content=f'<h1>Error: Path must be absolute</h1><p>{path}</p>',
|
||||
status_code=400,
|
||||
)
|
||||
|
||||
if not os.path.exists(path):
|
||||
return HTMLResponse(
|
||||
content=f'<h1>Error: File not found</h1><p>{path}</p>', status_code=404
|
||||
)
|
||||
|
||||
if os.path.isdir(path):
|
||||
return HTMLResponse(
|
||||
content=f'<h1>Error: Path is a directory</h1><p>{path}</p>',
|
||||
status_code=400,
|
||||
)
|
||||
|
||||
try:
|
||||
html_content = generate_file_viewer_html(path)
|
||||
return HTMLResponse(content=html_content)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f'Error serving file viewer: {str(e)}')
|
||||
return HTMLResponse(
|
||||
content=f'<h1>Error viewing file</h1><p>{path}</p><p>{str(e)}</p>',
|
||||
status_code=500,
|
||||
)
|
||||
|
||||
logger.debug(f'Starting action execution API on port {args.port}')
|
||||
run(app, host='0.0.0.0', port=args.port)
|
||||
|
||||
146
openhands/runtime/utils/file_viewer.py
Normal file
146
openhands/runtime/utils/file_viewer.py
Normal file
@@ -0,0 +1,146 @@
|
||||
"""
|
||||
Utility module for generating file viewer HTML content.
|
||||
"""
|
||||
|
||||
import base64
|
||||
import mimetypes
|
||||
import os
|
||||
|
||||
|
||||
def generate_file_viewer_html(file_path: str) -> str:
|
||||
"""
|
||||
Generate HTML content for viewing different file types.
|
||||
|
||||
Args:
|
||||
file_path: The absolute path to the file
|
||||
|
||||
Returns:
|
||||
str: HTML content for viewing the file
|
||||
|
||||
Raises:
|
||||
ValueError: If the file extension is not supported
|
||||
"""
|
||||
file_extension = os.path.splitext(file_path)[1].lower()
|
||||
file_name = os.path.basename(file_path)
|
||||
|
||||
# Define supported file extensions
|
||||
supported_extensions = [
|
||||
'.pdf',
|
||||
'.png',
|
||||
'.jpg',
|
||||
'.jpeg',
|
||||
'.gif',
|
||||
]
|
||||
|
||||
# Check if the file extension is supported
|
||||
if file_extension not in supported_extensions:
|
||||
raise ValueError(
|
||||
f"Unsupported file extension: {file_extension}. "
|
||||
f"Supported extensions are: {', '.join(supported_extensions)}"
|
||||
)
|
||||
|
||||
# Check if the file exists
|
||||
if not os.path.exists(file_path):
|
||||
raise ValueError(
|
||||
f'File not found locally: {file_path}. Please download the file to the local machine and try again.'
|
||||
)
|
||||
|
||||
# Read file content directly
|
||||
file_content = None
|
||||
mime_type = mimetypes.guess_type(file_path)[0] or 'application/octet-stream'
|
||||
|
||||
# For binary files (images, PDFs), encode as base64
|
||||
if file_extension in ['.pdf', '.png', '.jpg', '.jpeg', '.gif', '.bmp']:
|
||||
with open(file_path, 'rb') as file:
|
||||
file_content = base64.b64encode(file.read()).decode('utf-8')
|
||||
# For text files, read as text
|
||||
else:
|
||||
with open(file_path, 'r', encoding='utf-8') as file:
|
||||
file_content = file.read()
|
||||
|
||||
return f"""<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>File Viewer - {file_name}</title>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
|
||||
<style>
|
||||
body, html {{ margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: Arial, sans-serif; }}
|
||||
#viewer-container {{ width: 100%; height: 100vh; overflow: auto; }}
|
||||
.page {{ margin: 10px auto; box-shadow: 0 0 10px rgba(0,0,0,0.3); }}
|
||||
.text-content {{ margin: 20px; white-space: pre-wrap; font-family: monospace; line-height: 1.5; }}
|
||||
.error {{ color: red; margin: 20px; }}
|
||||
img {{ max-width: 100%; margin: 20px auto; display: block; }}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="viewer-container"></div>
|
||||
<script>
|
||||
const filePath = "{file_path}";
|
||||
const fileExtension = "{file_extension}";
|
||||
const fileContent = `{file_content if file_extension not in ['.pdf', '.png', '.jpg', '.jpeg', '.gif', '.bmp'] else ''}`;
|
||||
const fileBase64 = "{file_content if file_extension in ['.pdf', '.png', '.jpg', '.jpeg', '.gif', '.bmp'] else ''}";
|
||||
const mimeType = "{mime_type}";
|
||||
const container = document.getElementById('viewer-container');
|
||||
|
||||
async function loadContent() {{
|
||||
try {{
|
||||
if (fileExtension === '.pdf') {{
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js';
|
||||
const binaryString = atob(fileBase64);
|
||||
const bytes = new Uint8Array(binaryString.length);
|
||||
for (let i = 0; i < binaryString.length; i++) {{
|
||||
bytes[i] = binaryString.charCodeAt(i);
|
||||
}}
|
||||
|
||||
const loadingTask = pdfjsLib.getDocument({{data: bytes.buffer}});
|
||||
const pdf = await loadingTask.promise;
|
||||
|
||||
// Get total number of pages
|
||||
const numPages = pdf.numPages;
|
||||
|
||||
// Render each page
|
||||
for (let pageNum = 1; pageNum <= numPages; pageNum++) {{
|
||||
const page = await pdf.getPage(pageNum);
|
||||
|
||||
// Set scale for rendering
|
||||
const viewport = page.getViewport({{ scale: 1.5 }});
|
||||
|
||||
// Create canvas for rendering
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.className = 'page';
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
container.appendChild(canvas);
|
||||
|
||||
// Render PDF page into canvas context
|
||||
const context = canvas.getContext('2d');
|
||||
const renderContext = {{
|
||||
canvasContext: context,
|
||||
viewport: viewport
|
||||
}};
|
||||
|
||||
await page.render(renderContext).promise;
|
||||
}}
|
||||
}} else if (['.png', '.jpg', '.jpeg', '.gif', '.bmp'].includes(fileExtension)) {{
|
||||
const img = document.createElement('img');
|
||||
img.src = `data:${{mimeType}};base64,${{fileBase64}}`;
|
||||
img.alt = filePath.split('/').pop();
|
||||
container.appendChild(img);
|
||||
}} else {{
|
||||
const pre = document.createElement('pre');
|
||||
pre.className = 'text-content';
|
||||
pre.textContent = fileContent;
|
||||
container.appendChild(pre);
|
||||
}}
|
||||
}} catch (error) {{
|
||||
console.error('Error:', error);
|
||||
container.innerHTML = `<div class="error"><h2>Error loading file</h2><p>${{error.message}}</p></div>`;
|
||||
}}
|
||||
}}
|
||||
|
||||
window.onload = loadContent;
|
||||
</script>
|
||||
</body>
|
||||
</html>"""
|
||||
@@ -42,9 +42,7 @@ async def load_settings(request: Request) -> GETSettingsModel | JSONResponse:
|
||||
|
||||
|
||||
@app.post('/unset-settings-tokens', response_model=dict[str, str])
|
||||
async def unset_settings_tokens(
|
||||
request: Request
|
||||
) -> JSONResponse:
|
||||
async def unset_settings_tokens(request: Request) -> JSONResponse:
|
||||
try:
|
||||
settings_store = await SettingsStoreImpl.get_instance(
|
||||
config, get_user_id(request)
|
||||
@@ -52,24 +50,26 @@ async def unset_settings_tokens(
|
||||
|
||||
existing_settings = await settings_store.load()
|
||||
if existing_settings:
|
||||
settings = existing_settings.model_copy(update={'secrets_store': SecretStore()})
|
||||
settings = existing_settings.model_copy(
|
||||
update={'secrets_store': SecretStore()}
|
||||
)
|
||||
await settings_store.store(settings)
|
||||
|
||||
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_200_OK,
|
||||
content={'message': 'Settings stored'},
|
||||
)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
logger.warning(f'Something went wrong unsetting tokens: {e}')
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
content={'error': 'Something went wrong unsetting tokens'},
|
||||
)
|
||||
|
||||
|
||||
@app.post('/reset-settings', response_model=dict[str, str])
|
||||
async def reset_settings(
|
||||
request: Request
|
||||
) -> JSONResponse:
|
||||
async def reset_settings(request: Request) -> JSONResponse:
|
||||
"""
|
||||
Resets user settings.
|
||||
"""
|
||||
@@ -79,11 +79,28 @@ async def reset_settings(
|
||||
)
|
||||
|
||||
existing_settings = await settings_store.load()
|
||||
settings = Settings(user_consents_to_analytics=existing_settings.user_consents_to_analytics if existing_settings else False)
|
||||
settings = Settings(
|
||||
language='en',
|
||||
agent='CodeActAgent',
|
||||
security_analyzer='',
|
||||
confirmation_mode=False,
|
||||
llm_model='anthropic/claude-3-5-sonnet-20241022',
|
||||
llm_api_key='',
|
||||
llm_base_url='',
|
||||
remote_runtime_resource_factor=1,
|
||||
enable_default_condenser=True,
|
||||
enable_sound_notifications=False,
|
||||
user_consents_to_analytics=existing_settings.user_consents_to_analytics
|
||||
if existing_settings
|
||||
else False,
|
||||
)
|
||||
|
||||
server_config_values = server_config.get_config()
|
||||
is_hide_llm_settings_enabled = server_config_values.get("FEATURE_FLAGS", {}).get("HIDE_LLM_SETTINGS", False)
|
||||
is_hide_llm_settings_enabled = server_config_values.get(
|
||||
'FEATURE_FLAGS', {}
|
||||
).get('HIDE_LLM_SETTINGS', False)
|
||||
# We don't want the user to be able to modify these settings in SaaS
|
||||
if (server_config.app_mode == AppMode.SAAS and is_hide_llm_settings_enabled):
|
||||
if server_config.app_mode == AppMode.SAAS and is_hide_llm_settings_enabled:
|
||||
if existing_settings:
|
||||
settings.llm_api_key = existing_settings.llm_api_key
|
||||
settings.llm_base_url = existing_settings.llm_base_url
|
||||
@@ -94,7 +111,7 @@ async def reset_settings(
|
||||
status_code=status.HTTP_200_OK,
|
||||
content={'message': 'Settings stored'},
|
||||
)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
logger.warning(f'Something went wrong resetting settings: {e}')
|
||||
return JSONResponse(
|
||||
@@ -102,6 +119,7 @@ async def reset_settings(
|
||||
content={'error': 'Something went wrong resetting settings'},
|
||||
)
|
||||
|
||||
|
||||
@app.post('/settings', response_model=dict[str, str])
|
||||
async def store_settings(
|
||||
request: Request,
|
||||
@@ -138,15 +156,15 @@ async def store_settings(
|
||||
# Convert to Settings model and merge with existing settings
|
||||
if existing_settings:
|
||||
# Keep existing LLM settings if not provided
|
||||
if not settings.llm_api_key:
|
||||
if settings.llm_api_key is None:
|
||||
settings.llm_api_key = existing_settings.llm_api_key
|
||||
if not settings.llm_model:
|
||||
if settings.llm_model is None:
|
||||
settings.llm_model = existing_settings.llm_model
|
||||
if not settings.llm_base_url:
|
||||
if settings.llm_base_url is None:
|
||||
settings.llm_base_url = existing_settings.llm_base_url
|
||||
|
||||
# Keep existing analytics consent if not provided
|
||||
if not settings.user_consents_to_analytics:
|
||||
if settings.user_consents_to_analytics is None:
|
||||
settings.user_consents_to_analytics = (
|
||||
existing_settings.user_consents_to_analytics
|
||||
)
|
||||
|
||||
@@ -267,7 +267,7 @@ class Session:
|
||||
agent_session = self.agent_session
|
||||
controller = self.agent_session.controller
|
||||
if controller is not None and not agent_session.is_closed():
|
||||
await controller.set_agent_state_to(AgentState.ERROR)
|
||||
await controller.set_agent_state_to(AgentState.ERROR, reason=message)
|
||||
self.logger.info(
|
||||
'Agent status error',
|
||||
extra={'signal': 'agent_status_error'},
|
||||
|
||||
@@ -10,7 +10,6 @@ from pydantic import (
|
||||
)
|
||||
from pydantic.json import pydantic_encoder
|
||||
|
||||
from openhands.core.config.config_utils import OH_MAX_ITERATIONS
|
||||
from openhands.core.config.llm_config import LLMConfig
|
||||
from openhands.core.config.utils import load_app_config
|
||||
from openhands.integrations.provider import SecretStore
|
||||
@@ -21,21 +20,21 @@ class Settings(BaseModel):
|
||||
Persisted settings for OpenHands sessions
|
||||
"""
|
||||
|
||||
language: str = 'en'
|
||||
agent: str = 'CodeActAgent'
|
||||
max_iterations: int = OH_MAX_ITERATIONS
|
||||
security_analyzer: str = ''
|
||||
confirmation_mode: bool = False
|
||||
llm_model: str = 'anthropic/claude-3-5-sonnet-20241022'
|
||||
llm_api_key: SecretStr = SecretStr('')
|
||||
llm_base_url: str = ''
|
||||
remote_runtime_resource_factor: int = 1
|
||||
language: str | None = None
|
||||
agent: str | None = None
|
||||
max_iterations: int | None = None
|
||||
security_analyzer: str | None = None
|
||||
confirmation_mode: bool | None = None
|
||||
llm_model: str | None = None
|
||||
llm_api_key: SecretStr | None = None
|
||||
llm_base_url: str | None = None
|
||||
remote_runtime_resource_factor: int | None = None
|
||||
secrets_store: SecretStore = Field(default_factory=SecretStore, frozen=True)
|
||||
enable_default_condenser: bool = True
|
||||
enable_default_condenser: bool = False
|
||||
enable_sound_notifications: bool = False
|
||||
user_consents_to_analytics: bool = False
|
||||
sandbox_base_container_image: str = ''
|
||||
sandbox_runtime_container_image: str = ''
|
||||
user_consents_to_analytics: bool | None = None
|
||||
sandbox_base_container_image: str | None = None
|
||||
sandbox_runtime_container_image: str | None = None
|
||||
|
||||
model_config = {
|
||||
'validate_assignment': True,
|
||||
|
||||
101
poetry.lock
generated
101
poetry.lock
generated
@@ -496,18 +496,18 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "boto3"
|
||||
version = "1.37.20"
|
||||
version = "1.37.22"
|
||||
description = "The AWS SDK for Python"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "boto3-1.37.20-py3-none-any.whl", hash = "sha256:225dbc75d79816cb9b28cc74a63c9fa0f2d70530d603dacd82634f362f6679c1"},
|
||||
{file = "boto3-1.37.20.tar.gz", hash = "sha256:87d9bd6ad49be754d4ae2724cfb892eb3f9f17bcafd781fb3ce0d98cc539bdd6"},
|
||||
{file = "boto3-1.37.22-py3-none-any.whl", hash = "sha256:a14324d5fa5f4fea00c0e3c69754cbd28100f7fe194693eeecf2dc07446cf4ef"},
|
||||
{file = "boto3-1.37.22.tar.gz", hash = "sha256:78a0ec0aafbf6044104c98ad80b69e6d1c83d8233fda2c2d241029e6c705c510"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
botocore = ">=1.37.20,<1.38.0"
|
||||
botocore = ">=1.37.22,<1.38.0"
|
||||
jmespath = ">=0.7.1,<2.0.0"
|
||||
s3transfer = ">=0.11.0,<0.12.0"
|
||||
|
||||
@@ -516,14 +516,14 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"]
|
||||
|
||||
[[package]]
|
||||
name = "boto3-stubs"
|
||||
version = "1.37.20"
|
||||
description = "Type annotations for boto3 1.37.20 generated with mypy-boto3-builder 8.10.1"
|
||||
version = "1.37.22"
|
||||
description = "Type annotations for boto3 1.37.22 generated with mypy-boto3-builder 8.10.1"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["evaluation"]
|
||||
files = [
|
||||
{file = "boto3_stubs-1.37.20-py3-none-any.whl", hash = "sha256:fff1796431191ec23a7f2d69c9de8c8ff10220cc773cb7c626ef0a34e2f1189a"},
|
||||
{file = "boto3_stubs-1.37.20.tar.gz", hash = "sha256:7e41a293bcdbbea99b21d6a7380822e7c8a31992f6d67d88989aebba6b35cdc2"},
|
||||
{file = "boto3_stubs-1.37.22-py3-none-any.whl", hash = "sha256:7d41213bef29af9bca6cbf481b00ec1a2535c111ee979ed152249d2c1ec02208"},
|
||||
{file = "boto3_stubs-1.37.22.tar.gz", hash = "sha256:ad6c1471bd503da253420294ca5060a4a24d53cdc2672503a579d9b779d0e5ce"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -579,7 +579,7 @@ bedrock-data-automation-runtime = ["mypy-boto3-bedrock-data-automation-runtime (
|
||||
bedrock-runtime = ["mypy-boto3-bedrock-runtime (>=1.37.0,<1.38.0)"]
|
||||
billing = ["mypy-boto3-billing (>=1.37.0,<1.38.0)"]
|
||||
billingconductor = ["mypy-boto3-billingconductor (>=1.37.0,<1.38.0)"]
|
||||
boto3 = ["boto3 (==1.37.20)"]
|
||||
boto3 = ["boto3 (==1.37.22)"]
|
||||
braket = ["mypy-boto3-braket (>=1.37.0,<1.38.0)"]
|
||||
budgets = ["mypy-boto3-budgets (>=1.37.0,<1.38.0)"]
|
||||
ce = ["mypy-boto3-ce (>=1.37.0,<1.38.0)"]
|
||||
@@ -943,14 +943,14 @@ xray = ["mypy-boto3-xray (>=1.37.0,<1.38.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "botocore"
|
||||
version = "1.37.20"
|
||||
version = "1.37.22"
|
||||
description = "Low-level, data-driven core of boto 3."
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "botocore-1.37.20-py3-none-any.whl", hash = "sha256:c34f4f25fda7c4f726adf5a948590bd6bd7892c05278d31e344b5908e7b43301"},
|
||||
{file = "botocore-1.37.20.tar.gz", hash = "sha256:9295385740f9d30f9b679f76ee51f49b80ae73183d84d499c1c3f1d54d820f54"},
|
||||
{file = "botocore-1.37.22-py3-none-any.whl", hash = "sha256:184db7c9314d13002bc827f511a5140574b5da1acda342d51e093dad6317de98"},
|
||||
{file = "botocore-1.37.22.tar.gz", hash = "sha256:b3b26f1a90236bcd17d4092f8c85a256b44e9955a16b633319a2f5678d605e9f"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -1750,14 +1750,14 @@ vision = ["Pillow (>=9.4.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "daytona-api-client"
|
||||
version = "0.14.0"
|
||||
version = "0.15.0"
|
||||
description = "Daytona Workspaces"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "daytona_api_client-0.14.0-py3-none-any.whl", hash = "sha256:33113c61377d602c3e2e0a04b29b159707baf28cf50883b9c382d58a3e493538"},
|
||||
{file = "daytona_api_client-0.14.0.tar.gz", hash = "sha256:c82d7dccd6c307124da35c4e6ebf6870ae7b904b06646aa60ecf61387fce237a"},
|
||||
{file = "daytona_api_client-0.15.0-py3-none-any.whl", hash = "sha256:c60b9aff7f1785555db82c6f3062935511c457d0123229af42f8b35fefba0148"},
|
||||
{file = "daytona_api_client-0.15.0.tar.gz", hash = "sha256:ebb4dcde1edbb00189645304421f97898e63201774d927988c4e7c611cbcb697"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -1768,20 +1768,21 @@ urllib3 = ">=1.25.3,<3.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "daytona-sdk"
|
||||
version = "0.10.5"
|
||||
version = "0.11.2"
|
||||
description = "Python SDK for Daytona"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "daytona_sdk-0.10.5-py3-none-any.whl", hash = "sha256:105569413c1538e2ace1b586f504db146fead915f878e80ff763445aefda740f"},
|
||||
{file = "daytona_sdk-0.10.5.tar.gz", hash = "sha256:0fa33fcf8bff337c3639dccc1b533dd8d00232362922b20c33f93508c76f250f"},
|
||||
{file = "daytona_sdk-0.11.2-py3-none-any.whl", hash = "sha256:f1adc46d2da04872236540b874d9ca1ce8ee5e9320b9241e339a6c53fdcdc0ce"},
|
||||
{file = "daytona_sdk-0.11.2.tar.gz", hash = "sha256:c40c4d0efaa47948f896353cbedf5d34b0d32c4312798f0e5d0227bc0abe8ead"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
daytona_api_client = ">=0.14.0,<1.0.0"
|
||||
daytona_api_client = ">=0.15.0,<1.0.0"
|
||||
Deprecated = ">=1.2.18,<2.0.0"
|
||||
environs = ">=9.5.0,<10.0.0"
|
||||
httpx = ">=0.28.0,<0.29.0"
|
||||
marshmallow = ">=3.19.0,<4.0.0"
|
||||
pydantic = ">=2.4.2,<3.0.0"
|
||||
python-dateutil = ">=2.8.2,<3.0.0"
|
||||
@@ -1960,14 +1961,14 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "e2b"
|
||||
version = "1.3.1"
|
||||
version = "1.3.2"
|
||||
description = "E2B SDK that give agents cloud environments"
|
||||
optional = false
|
||||
python-versions = "<4.0,>=3.9"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "e2b-1.3.1-py3-none-any.whl", hash = "sha256:2c7fa76e7a8614ebbc0df7f0863275284f9cd4afba7dc631e1c1471658809c37"},
|
||||
{file = "e2b-1.3.1.tar.gz", hash = "sha256:d704faa618f0c7b3a4374654443609522a589189ece24d791129e9722f266e75"},
|
||||
{file = "e2b-1.3.2-py3-none-any.whl", hash = "sha256:fd4bf26b4ebcccbe7def81d08d130c5d23e1d065b3180cb39c19acd7909b9ed6"},
|
||||
{file = "e2b-1.3.2.tar.gz", hash = "sha256:9663988589fad20ff552c73fac39329f80df4c07b6446769971a1defaad2bdd5"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -2182,7 +2183,7 @@ version = "7.1.2"
|
||||
description = "the modular source code checker: pep8 pyflakes and co"
|
||||
optional = false
|
||||
python-versions = ">=3.8.1"
|
||||
groups = ["main", "runtime", "test"]
|
||||
groups = ["main", "runtime"]
|
||||
files = [
|
||||
{file = "flake8-7.1.2-py2.py3-none-any.whl", hash = "sha256:1cbc62e65536f65e6d754dfe6f1bada7f5cf392d6f5db3c2b85892466c3e7c1a"},
|
||||
{file = "flake8-7.1.2.tar.gz", hash = "sha256:c586ffd0b41540951ae41af572e6790dbd49fc12b3aa2541685d253d9bd504bd"},
|
||||
@@ -2664,14 +2665,14 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"]
|
||||
|
||||
[[package]]
|
||||
name = "google-api-python-client"
|
||||
version = "2.165.0"
|
||||
version = "2.166.0"
|
||||
description = "Google API Client Library for Python"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "google_api_python_client-2.165.0-py2.py3-none-any.whl", hash = "sha256:4eaab7d4a20be0d3d1dde462fa95e9e0ccc2a3e177a656701bf73fe738ddef7d"},
|
||||
{file = "google_api_python_client-2.165.0.tar.gz", hash = "sha256:0d2aee76727a104705630bebbc43669c864b766924e9329051ef7b7e2468eb72"},
|
||||
{file = "google_api_python_client-2.166.0-py2.py3-none-any.whl", hash = "sha256:dd8cc74d9fc18538ab05cbd2e93cb4f82382f910c5f6945db06c91f1deae6e45"},
|
||||
{file = "google_api_python_client-2.166.0.tar.gz", hash = "sha256:b8cf843bd9d736c134aef76cf1dc7a47c9283a2ef24267b97207b9dd43b30ef7"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -2743,14 +2744,14 @@ tool = ["click (>=6.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "google-cloud-aiplatform"
|
||||
version = "1.85.0"
|
||||
version = "1.86.0"
|
||||
description = "Vertex AI API client library"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "google_cloud_aiplatform-1.85.0-py3-none-any.whl", hash = "sha256:5064519a81aa355bcba708795c0b122b08af90612eec1b2a3b892dbdb98a81b4"},
|
||||
{file = "google_cloud_aiplatform-1.85.0.tar.gz", hash = "sha256:8f4845f02c0fe77903342d250c7522f870333e2f9738ccd197c8e7cc3e95f11d"},
|
||||
{file = "google_cloud_aiplatform-1.86.0-py2.py3-none-any.whl", hash = "sha256:fcd155a0e77fdc12a5c477af92fa0b7e8ea1b1d1fcece35ad07f160008dedc7e"},
|
||||
{file = "google_cloud_aiplatform-1.86.0.tar.gz", hash = "sha256:45fff84c75c6f66105efa1c6caf0ea87fddc85298c834ee38f4163cf793510c4"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -2774,21 +2775,23 @@ agent-engines = ["cloudpickle (>=3.0,<4.0)", "google-cloud-logging (<4)", "googl
|
||||
autologging = ["mlflow (>=1.27.0,<=2.16.0)"]
|
||||
cloud-profiler = ["tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (>=2.4.0,<3.0.0)", "werkzeug (>=2.0.0,<2.1.0)"]
|
||||
datasets = ["pyarrow (>=10.0.1) ; python_version == \"3.11\"", "pyarrow (>=14.0.0) ; python_version >= \"3.12\"", "pyarrow (>=3.0.0,<8.0.0) ; python_version < \"3.11\""]
|
||||
endpoint = ["requests (>=2.28.1)"]
|
||||
endpoint = ["requests (>=2.28.1)", "requests-toolbelt (<=1.0.0)"]
|
||||
evaluation = ["pandas (>=1.0.0)", "scikit-learn (<1.6.0) ; python_version <= \"3.10\"", "scikit-learn ; python_version > \"3.10\"", "tqdm (>=4.23.0)"]
|
||||
full = ["docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.114.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-vizier (>=0.1.6)", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.16.0)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pyarrow (>=10.0.1) ; python_version == \"3.11\"", "pyarrow (>=14.0.0) ; python_version >= \"3.12\"", "pyarrow (>=3.0.0,<8.0.0) ; python_version < \"3.11\"", "pyarrow (>=6.0.1)", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || >=2.33.dev0,<=2.33.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.33.0) ; python_version == \"3.11\"", "requests (>=2.28.1)", "scikit-learn (<1.6.0) ; python_version <= \"3.10\"", "scikit-learn ; python_version > \"3.10\"", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (>=2.3.0,<3.0.0)", "tensorflow (>=2.3.0,<3.0.0) ; python_version <= \"3.11\"", "tensorflow (>=2.4.0,<3.0.0)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0)"]
|
||||
full = ["docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.114.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-vizier (>=0.1.6)", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.16.0)", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pyarrow (>=10.0.1) ; python_version == \"3.11\"", "pyarrow (>=14.0.0) ; python_version >= \"3.12\"", "pyarrow (>=3.0.0,<8.0.0) ; python_version < \"3.11\"", "pyarrow (>=6.0.1)", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || ==2.33.* || >=2.42.dev0,<=2.42.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.42.0) ; python_version == \"3.11\"", "requests (>=2.28.1)", "requests-toolbelt (<=1.0.0)", "scikit-learn (<1.6.0) ; python_version <= \"3.10\"", "scikit-learn ; python_version > \"3.10\"", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (>=2.3.0,<3.0.0)", "tensorflow (>=2.3.0,<3.0.0) ; python_version <= \"3.11\"", "tensorflow (>=2.4.0,<3.0.0)", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0)"]
|
||||
langchain = ["langchain (>=0.3,<0.4)", "langchain-core (>=0.3,<0.4)", "langchain-google-vertexai (>=2,<3)", "langgraph (>=0.2.45,<0.3)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)"]
|
||||
langchain-testing = ["absl-py", "cloudpickle (>=3.0,<4.0)", "google-cloud-trace (<2)", "langchain (>=0.3,<0.4)", "langchain-core (>=0.3,<0.4)", "langchain-google-vertexai (>=2,<3)", "langgraph (>=0.2.45,<0.3)", "openinference-instrumentation-langchain (>=0.1.19,<0.2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "pytest-xdist", "typing-extensions"]
|
||||
lit = ["explainable-ai-sdk (>=1.0.0)", "lit-nlp (==0.4.0)", "pandas (>=1.0.0)", "tensorflow (>=2.3.0,<3.0.0)"]
|
||||
llama-index = ["llama-index", "llama-index-llms-google-genai", "openinference-instrumentation-llama-index (>=3.0,<4.0)"]
|
||||
llama-index-testing = ["absl-py", "cloudpickle (>=3.0,<4.0)", "google-cloud-trace (<2)", "llama-index", "llama-index-llms-google-genai", "openinference-instrumentation-llama-index (>=3.0,<4.0)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "pytest-xdist", "typing-extensions"]
|
||||
metadata = ["numpy (>=1.15.0)", "pandas (>=1.0.0)"]
|
||||
pipelines = ["pyyaml (>=5.3.1,<7)"]
|
||||
prediction = ["docker (>=5.0.3)", "fastapi (>=0.71.0,<=0.114.0)", "httpx (>=0.23.0,<0.25.0)", "starlette (>=0.17.1)", "uvicorn[standard] (>=0.16.0)"]
|
||||
private-endpoints = ["requests (>=2.28.1)", "urllib3 (>=1.21.1,<1.27)"]
|
||||
ray = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0)", "pyarrow (>=6.0.1)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || >=2.33.dev0,<=2.33.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.33.0) ; python_version == \"3.11\"", "setuptools (<70.0.0)"]
|
||||
ray-testing = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0)", "pyarrow (>=6.0.1)", "pytest-xdist", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || >=2.33.dev0,<=2.33.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.33.0) ; python_version == \"3.11\"", "ray[train]", "scikit-learn (<1.6.0)", "setuptools (<70.0.0)", "tensorflow", "torch (>=2.0.0,<2.1.0)", "xgboost", "xgboost-ray"]
|
||||
ray = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0)", "pyarrow (>=6.0.1)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || ==2.33.* || >=2.42.dev0,<=2.42.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.42.0) ; python_version == \"3.11\"", "setuptools (<70.0.0)"]
|
||||
ray-testing = ["google-cloud-bigquery", "google-cloud-bigquery-storage", "immutabledict", "pandas (>=1.0.0)", "pyarrow (>=6.0.1)", "pytest-xdist", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || ==2.33.* || >=2.42.dev0,<=2.42.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.42.0) ; python_version == \"3.11\"", "ray[train]", "scikit-learn (<1.6.0)", "setuptools (<70.0.0)", "tensorflow", "torch (>=2.0.0,<2.1.0)", "xgboost", "xgboost-ray"]
|
||||
reasoningengine = ["cloudpickle (>=3.0,<4.0)", "google-cloud-trace (<2)", "opentelemetry-exporter-gcp-trace (<2)", "opentelemetry-sdk (<2)", "pydantic (>=2.6.3,<3)", "typing-extensions"]
|
||||
tensorboard = ["tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (>=2.3.0,<3.0.0) ; python_version <= \"3.11\"", "tensorflow (>=2.4.0,<3.0.0)", "werkzeug (>=2.0.0,<2.1.0)"]
|
||||
testing = ["aiohttp", "bigframes ; python_version >= \"3.10\"", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.114.0)", "google-api-core (>=2.11,<3.0.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-vizier (>=0.1.6)", "grpcio-testing", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "ipython", "kfp (>=2.6.0,<3.0.0)", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.16.0)", "nltk", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pyarrow (>=10.0.1) ; python_version == \"3.11\"", "pyarrow (>=14.0.0) ; python_version >= \"3.12\"", "pyarrow (>=3.0.0,<8.0.0) ; python_version < \"3.11\"", "pyarrow (>=6.0.1)", "pytest-asyncio", "pytest-xdist", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || >=2.33.dev0,<=2.33.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.33.0) ; python_version == \"3.11\"", "requests (>=2.28.1)", "requests-toolbelt (<1.0.0)", "scikit-learn (<1.6.0) ; python_version <= \"3.10\"", "scikit-learn ; python_version > \"3.10\"", "sentencepiece (>=0.2.0)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (==2.13.0) ; python_version <= \"3.11\"", "tensorflow (==2.16.1) ; python_version > \"3.11\"", "tensorflow (>=2.3.0,<3.0.0)", "tensorflow (>=2.3.0,<3.0.0) ; python_version <= \"3.11\"", "tensorflow (>=2.4.0,<3.0.0)", "torch (>=2.0.0,<2.1.0) ; python_version <= \"3.11\"", "torch (>=2.2.0) ; python_version > \"3.11\"", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0)", "xgboost"]
|
||||
testing = ["aiohttp", "bigframes ; python_version >= \"3.10\"", "docker (>=5.0.3)", "explainable-ai-sdk (>=1.0.0)", "fastapi (>=0.71.0,<=0.114.0)", "google-api-core (>=2.11,<3.0.0)", "google-cloud-bigquery", "google-cloud-bigquery-storage", "google-vizier (>=0.1.6)", "grpcio-testing", "httpx (>=0.23.0,<0.25.0)", "immutabledict", "ipython", "kfp (>=2.6.0,<3.0.0)", "lit-nlp (==0.4.0)", "mlflow (>=1.27.0,<=2.16.0)", "nltk", "numpy (>=1.15.0)", "pandas (>=1.0.0)", "pyarrow (>=10.0.1) ; python_version == \"3.11\"", "pyarrow (>=14.0.0) ; python_version >= \"3.12\"", "pyarrow (>=3.0.0,<8.0.0) ; python_version < \"3.11\"", "pyarrow (>=6.0.1)", "pytest-asyncio", "pytest-xdist", "pyyaml (>=5.3.1,<7)", "ray[default] (>=2.4,<2.5.dev0 || >2.9.0,!=2.9.1,!=2.9.2,<2.10.dev0 || ==2.33.* || >=2.42.dev0,<=2.42.0) ; python_version < \"3.11\"", "ray[default] (>=2.5,<=2.42.0) ; python_version == \"3.11\"", "requests (>=2.28.1)", "requests-toolbelt (<=1.0.0)", "scikit-learn (<1.6.0) ; python_version <= \"3.10\"", "scikit-learn ; python_version > \"3.10\"", "sentencepiece (>=0.2.0)", "setuptools (<70.0.0)", "starlette (>=0.17.1)", "tensorboard-plugin-profile (>=2.4.0,<2.18.0)", "tensorflow (==2.13.0) ; python_version <= \"3.11\"", "tensorflow (==2.16.1) ; python_version > \"3.11\"", "tensorflow (>=2.3.0,<3.0.0)", "tensorflow (>=2.3.0,<3.0.0) ; python_version <= \"3.11\"", "tensorflow (>=2.4.0,<3.0.0)", "torch (>=2.0.0,<2.1.0) ; python_version <= \"3.11\"", "torch (>=2.2.0) ; python_version > \"3.11\"", "tqdm (>=4.23.0)", "urllib3 (>=1.21.1,<1.27)", "uvicorn[standard] (>=0.16.0)", "werkzeug (>=2.0.0,<2.1.0)", "xgboost"]
|
||||
tokenization = ["sentencepiece (>=0.2.0)"]
|
||||
vizier = ["google-vizier (>=0.1.6)"]
|
||||
xai = ["tensorflow (>=2.3.0,<3.0.0)"]
|
||||
@@ -4390,14 +4393,14 @@ types-tqdm = "*"
|
||||
|
||||
[[package]]
|
||||
name = "litellm"
|
||||
version = "1.63.14"
|
||||
version = "1.64.1"
|
||||
description = "Library to easily interface with LLM API providers"
|
||||
optional = false
|
||||
python-versions = "!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8"
|
||||
groups = ["main"]
|
||||
files = [
|
||||
{file = "litellm-1.63.14-py3-none-any.whl", hash = "sha256:d4c469f5990e142cc23dfa06c3fddd627001928e4df43682001f453af6a1fb51"},
|
||||
{file = "litellm-1.63.14.tar.gz", hash = "sha256:9cffe19d8140c33a2f777c5b2e8b8175ffe03979aac341b8538d6e6d143bd640"},
|
||||
{file = "litellm-1.64.1-py3-none-any.whl", hash = "sha256:bd7cb4977dee121551f0322d48b4e51e9a508fc2ac2273e7c5405ca69354e352"},
|
||||
{file = "litellm-1.64.1.tar.gz", hash = "sha256:73bac891b1fbd77ada4d691e967657c53f48c207d9c3ba414ad0ffe3e7ec8f89"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -4414,8 +4417,8 @@ tiktoken = ">=0.7.0"
|
||||
tokenizers = "*"
|
||||
|
||||
[package.extras]
|
||||
extra-proxy = ["azure-identity (>=1.15.0,<2.0.0)", "azure-keyvault-secrets (>=4.8.0,<5.0.0)", "google-cloud-kms (>=2.21.3,<3.0.0)", "prisma (==0.11.0)", "resend (>=0.8.0,<0.9.0)"]
|
||||
proxy = ["PyJWT (>=2.8.0,<3.0.0)", "apscheduler (>=3.10.4,<4.0.0)", "backoff", "boto3 (==1.34.34)", "cryptography (>=43.0.1,<44.0.0)", "fastapi (>=0.115.5,<0.116.0)", "fastapi-sso (>=0.16.0,<0.17.0)", "gunicorn (>=23.0.0,<24.0.0)", "orjson (>=3.9.7,<4.0.0)", "pynacl (>=1.5.0,<2.0.0)", "python-multipart (>=0.0.18,<0.0.19)", "pyyaml (>=6.0.1,<7.0.0)", "rq", "uvicorn (>=0.29.0,<0.30.0)", "uvloop (>=0.21.0,<0.22.0)", "websockets (>=13.1.0,<14.0.0)"]
|
||||
extra-proxy = ["azure-identity (>=1.15.0,<2.0.0)", "azure-keyvault-secrets (>=4.8.0,<5.0.0)", "google-cloud-kms (>=2.21.3,<3.0.0)", "prisma (==0.11.0)", "redisvl (>=0.4.1,<0.5.0) ; python_version >= \"3.9\" and python_version < \"3.14\"", "resend (>=0.8.0,<0.9.0)"]
|
||||
proxy = ["PyJWT (>=2.8.0,<3.0.0)", "apscheduler (>=3.10.4,<4.0.0)", "backoff", "boto3 (==1.34.34)", "cryptography (>=43.0.1,<44.0.0)", "fastapi (>=0.115.5,<0.116.0)", "fastapi-sso (>=0.16.0,<0.17.0)", "gunicorn (>=23.0.0,<24.0.0)", "mcp (==1.5.0) ; python_version >= \"3.10\"", "orjson (>=3.9.7,<4.0.0)", "pynacl (>=1.5.0,<2.0.0)", "python-multipart (>=0.0.18,<0.0.19)", "pyyaml (>=6.0.1,<7.0.0)", "rq", "uvicorn (>=0.29.0,<0.30.0)", "uvloop (>=0.21.0,<0.22.0)", "websockets (>=13.1.0,<14.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "lxml"
|
||||
@@ -4767,7 +4770,7 @@ version = "0.7.0"
|
||||
description = "McCabe checker, plugin for flake8"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
groups = ["main", "runtime", "test"]
|
||||
groups = ["main", "runtime"]
|
||||
files = [
|
||||
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
|
||||
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
|
||||
@@ -4833,14 +4836,14 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "modal"
|
||||
version = "0.73.126"
|
||||
version = "0.73.131"
|
||||
description = "Python client library for Modal"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["main", "evaluation"]
|
||||
files = [
|
||||
{file = "modal-0.73.126-py3-none-any.whl", hash = "sha256:0bb62cd39a75f5675ebd751127860c1134c56f7808470f3eb74690309c8e2b84"},
|
||||
{file = "modal-0.73.126.tar.gz", hash = "sha256:650b8944fcb41b432655e774dde339c56787d2f8ad777a74dbf7208b1a30a88d"},
|
||||
{file = "modal-0.73.131-py3-none-any.whl", hash = "sha256:cece493c196a5c932602fa84ef91c60737078c263ac8859acc8c7e13257a6215"},
|
||||
{file = "modal-0.73.131.tar.gz", hash = "sha256:26809ad9c9bd66d912370454135599b093e7bc2f450d6257d82dd178d00dab62"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -5389,14 +5392,14 @@ signedtoken = ["cryptography (>=3.0.0)", "pyjwt (>=2.0.0,<3)"]
|
||||
|
||||
[[package]]
|
||||
name = "openai"
|
||||
version = "1.68.2"
|
||||
version = "1.69.0"
|
||||
description = "The official Python library for the openai API"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "evaluation", "test"]
|
||||
files = [
|
||||
{file = "openai-1.68.2-py3-none-any.whl", hash = "sha256:24484cb5c9a33b58576fdc5acf0e5f92603024a4e39d0b99793dfa1eb14c2b36"},
|
||||
{file = "openai-1.68.2.tar.gz", hash = "sha256:b720f0a95a1dbe1429c0d9bb62096a0d98057bcda82516f6e8af10284bdd5b19"},
|
||||
{file = "openai-1.69.0-py3-none-any.whl", hash = "sha256:73c4b2ddfd050060f8d93c70367189bd891e70a5adb6d69c04c3571f4fea5627"},
|
||||
{file = "openai-1.69.0.tar.gz", hash = "sha256:7b8a10a8ff77e1ae827e5e4c8480410af2070fb68bc973d6c994cf8218f1f98d"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -6211,7 +6214,7 @@ version = "2.12.1"
|
||||
description = "Python style guide checker"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "runtime", "test"]
|
||||
groups = ["main", "runtime"]
|
||||
files = [
|
||||
{file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"},
|
||||
{file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"},
|
||||
@@ -6449,7 +6452,7 @@ version = "3.2.0"
|
||||
description = "passive checker of Python programs"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["main", "runtime", "test"]
|
||||
groups = ["main", "runtime"]
|
||||
files = [
|
||||
{file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"},
|
||||
{file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"},
|
||||
@@ -9825,4 +9828,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"]
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = "^3.12"
|
||||
content-hash = "1de0df813802e5054a305381deec79fced117ffea1f0eb71135e46708f737cf3"
|
||||
content-hash = "dcc17facf3429a7f9b38f41228e63a5ece541047a8f80052b263a368094cd2af"
|
||||
|
||||
@@ -75,7 +75,7 @@ stripe = "^11.5.0"
|
||||
ipywidgets = "^8.1.5"
|
||||
qtconsole = "^5.6.1"
|
||||
memory-profiler = "^0.61.0"
|
||||
daytona-sdk = "0.10.5"
|
||||
daytona-sdk = "0.11.2"
|
||||
python-json-logger = "^3.2.1"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
@@ -90,7 +90,6 @@ pytest-cov = "*"
|
||||
pytest-asyncio = "*"
|
||||
pytest-forked = "*"
|
||||
pytest-xdist = "*"
|
||||
flake8 = "*"
|
||||
openai = "*"
|
||||
pandas = "*"
|
||||
reportlab = "*"
|
||||
@@ -98,6 +97,7 @@ reportlab = "*"
|
||||
[tool.coverage.run]
|
||||
concurrency = ["gevent"]
|
||||
|
||||
|
||||
[tool.poetry.group.runtime.dependencies]
|
||||
jupyterlab = "*"
|
||||
notebook = "*"
|
||||
@@ -126,6 +126,7 @@ ignore = ["D1"]
|
||||
[tool.ruff.lint.pydocstyle]
|
||||
convention = "google"
|
||||
|
||||
|
||||
[tool.poetry.group.evaluation.dependencies]
|
||||
streamlit = "*"
|
||||
whatthepatch = "*"
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
"""Browsing-related tests for the DockerRuntime, which connects to the ActionExecutor running in the sandbox."""
|
||||
|
||||
import os
|
||||
|
||||
from conftest import _close_test_runtime, _load_runtime
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.events.action import (
|
||||
BrowseInteractiveAction,
|
||||
BrowseURLAction,
|
||||
CmdRunAction,
|
||||
)
|
||||
@@ -60,3 +63,112 @@ def test_simple_browse(temp_dir, runtime_cls, run_as_openhands):
|
||||
assert obs.exit_code == 0
|
||||
|
||||
_close_test_runtime(runtime)
|
||||
|
||||
|
||||
def test_read_pdf_browse(temp_dir, runtime_cls, run_as_openhands):
|
||||
runtime, config = _load_runtime(temp_dir, runtime_cls, run_as_openhands)
|
||||
try:
|
||||
# Create a PDF file using reportlab in the host environment
|
||||
from reportlab.lib.pagesizes import letter
|
||||
from reportlab.pdfgen import canvas
|
||||
|
||||
pdf_path = os.path.join(temp_dir, 'test_document.pdf')
|
||||
pdf_content = 'This is test content for PDF reading test'
|
||||
|
||||
c = canvas.Canvas(pdf_path, pagesize=letter)
|
||||
# Add more content to make the PDF more robust
|
||||
c.drawString(100, 750, pdf_content)
|
||||
c.drawString(100, 700, 'Additional line for PDF structure')
|
||||
c.drawString(100, 650, 'Third line to ensure valid PDF')
|
||||
# Explicitly set PDF version and ensure proper structure
|
||||
c.setPageCompression(0) # Disable compression for simpler structure
|
||||
c.save()
|
||||
|
||||
# Copy the PDF to the sandbox
|
||||
sandbox_dir = config.workspace_mount_path_in_sandbox
|
||||
runtime.copy_to(pdf_path, sandbox_dir)
|
||||
|
||||
# Start HTTP server
|
||||
action_cmd = CmdRunAction(command='ls -alh')
|
||||
logger.info(action_cmd, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_cmd)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
assert isinstance(obs, CmdOutputObservation)
|
||||
assert obs.exit_code == 0
|
||||
assert 'test_document.pdf' in obs.content
|
||||
|
||||
# Get server url
|
||||
action_cmd = CmdRunAction(command='cat /tmp/oh-server-url')
|
||||
logger.info(action_cmd, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_cmd)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
assert obs.exit_code == 0
|
||||
server_url = obs.content.strip()
|
||||
|
||||
# Browse to the PDF file
|
||||
pdf_url = f'{server_url}/view?path=/workspace/test_document.pdf'
|
||||
action_browse = BrowseInteractiveAction(browser_actions=f'goto("{pdf_url}")')
|
||||
logger.info(action_browse, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_browse)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
|
||||
# Verify the browser observation
|
||||
assert isinstance(obs, BrowserOutputObservation)
|
||||
observation_text = str(obs)
|
||||
assert '[Action executed successfully.]' in observation_text
|
||||
assert 'Canvas' in observation_text
|
||||
|
||||
finally:
|
||||
_close_test_runtime(runtime)
|
||||
|
||||
|
||||
def test_read_png_browse(temp_dir, runtime_cls, run_as_openhands):
|
||||
runtime, config = _load_runtime(temp_dir, runtime_cls, run_as_openhands)
|
||||
try:
|
||||
# Create a PNG file using PIL in the host environment
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
png_path = os.path.join(temp_dir, 'test_image.png')
|
||||
# Create a simple image with text
|
||||
img = Image.new('RGB', (400, 200), color=(255, 255, 255))
|
||||
d = ImageDraw.Draw(img)
|
||||
text = 'This is a test PNG image'
|
||||
d.text((20, 80), text, fill=(0, 0, 0))
|
||||
img.save(png_path)
|
||||
|
||||
# Copy the PNG to the sandbox
|
||||
sandbox_dir = config.workspace_mount_path_in_sandbox
|
||||
runtime.copy_to(png_path, sandbox_dir)
|
||||
|
||||
# Verify the file exists in the sandbox
|
||||
action_cmd = CmdRunAction(command='ls -alh')
|
||||
logger.info(action_cmd, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_cmd)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
assert isinstance(obs, CmdOutputObservation)
|
||||
assert obs.exit_code == 0
|
||||
assert 'test_image.png' in obs.content
|
||||
|
||||
# Get server url
|
||||
action_cmd = CmdRunAction(command='cat /tmp/oh-server-url')
|
||||
logger.info(action_cmd, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_cmd)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
assert obs.exit_code == 0
|
||||
server_url = obs.content.strip()
|
||||
|
||||
# Browse to the PNG file
|
||||
png_url = f'{server_url}/view?path=/workspace/test_image.png'
|
||||
action_browse = BrowseInteractiveAction(browser_actions=f'goto("{png_url}")')
|
||||
logger.info(action_browse, extra={'msg_type': 'ACTION'})
|
||||
obs = runtime.run_action(action_browse)
|
||||
logger.info(obs, extra={'msg_type': 'OBSERVATION'})
|
||||
|
||||
# Verify the browser observation
|
||||
assert isinstance(obs, BrowserOutputObservation)
|
||||
observation_text = str(obs)
|
||||
assert '[Action executed successfully.]' in observation_text
|
||||
assert 'File Viewer - test_image.png' in observation_text
|
||||
|
||||
finally:
|
||||
_close_test_runtime(runtime)
|
||||
|
||||
Reference in New Issue
Block a user