connectonion 0.6.2__py3-none-any.whl → 0.6.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- connectonion/__init__.py +46 -9
- connectonion/cli/__init__.py +11 -1
- connectonion/cli/browser_agent/__init__.py +11 -1
- connectonion/cli/browser_agent/browser.py +13 -3
- connectonion/cli/browser_agent/element_finder.py +8 -0
- connectonion/cli/browser_agent/highlight_screenshot.py +9 -1
- connectonion/cli/browser_agent/scroll.py +8 -0
- connectonion/cli/co_ai/__init__.py +6 -0
- connectonion/cli/co_ai/agent.py +87 -0
- connectonion/cli/co_ai/agents/__init__.py +5 -0
- connectonion/cli/co_ai/agents/registry.py +57 -0
- connectonion/cli/co_ai/commands/__init__.py +45 -0
- connectonion/cli/co_ai/commands/compact.py +173 -0
- connectonion/cli/co_ai/commands/cost.py +77 -0
- connectonion/cli/co_ai/commands/export.py +60 -0
- connectonion/cli/co_ai/commands/help.py +80 -0
- connectonion/cli/co_ai/commands/init.py +101 -0
- connectonion/cli/co_ai/commands/sessions.py +55 -0
- connectonion/cli/co_ai/commands/tasks.py +63 -0
- connectonion/cli/co_ai/commands/undo.py +103 -0
- connectonion/cli/co_ai/context.py +127 -0
- connectonion/cli/co_ai/main.py +52 -0
- connectonion/cli/co_ai/plugins/__init__.py +5 -0
- connectonion/cli/co_ai/plugins/system_reminder.py +154 -0
- connectonion/cli/co_ai/prompts/agents/explore.md +79 -0
- connectonion/cli/co_ai/prompts/agents/plan.md +60 -0
- connectonion/cli/co_ai/prompts/assembler.py +303 -0
- connectonion/cli/{docs/co-vibecoding-principles-docs-contexts-all-in-one.md → co_ai/prompts/connectonion/README.md} +26 -0
- connectonion/cli/co_ai/prompts/connectonion/api.md +457 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/README.md +805 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/auth.md +46 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/browser.md +235 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/copy.md +184 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/create.md +335 -0
- connectonion/cli/co_ai/prompts/connectonion/cli/init.md +431 -0
- connectonion/cli/co_ai/prompts/connectonion/co-directory-structure.md +214 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/agent.md +1078 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/events.md +816 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/llm_do.md +256 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/max_iterations.md +362 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/models.md +641 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/plugins.md +100 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/prompts.md +122 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/tools.md +512 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/transcribe.md +156 -0
- connectonion/cli/co_ai/prompts/connectonion/concepts/trust.md +291 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/README.md +18 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/auto_debug.md +1026 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/console.md +129 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/eval-format.md +178 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/eval.md +230 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/exceptions.md +307 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/log.md +117 -0
- connectonion/cli/co_ai/prompts/connectonion/debug/xray.md +215 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/001-choosing-input-method.md +202 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/002-choosing-llm-function-name.md +202 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/003-choosing-trust-keyword.md +141 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/004-cli-create-flow.md +117 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/005-designing-agent-network-protocol.md +503 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/006-agent-address-format.md +305 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/007-authentication-backend-design.md +240 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/008-naming-is-hard.md +228 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/009-why-connect-function.md +167 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/011-global-config-identity-management.md +357 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/012-tool-execution-separation.md +259 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/013-debug-and-logging-design.md +253 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/014-hook-system-design.md +510 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/015-interactive-auto-debug-design.md +837 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/017-session-logging-and-eval-format.md +120 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/018-event-api-naming.md +274 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/019-agent-lifecycle-design.md +655 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/020-trust-system-and-network-architecture.md +503 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/021-task-storage-jsonl-design.md +496 -0
- connectonion/cli/co_ai/prompts/connectonion/design-decisions/022-raw-asgi-implementation.md +273 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/agent_reasoning.md +62 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/atomic_tools.md +24 -0
- connectonion/cli/co_ai/prompts/connectonion/examples/load_guide.md +18 -0
- connectonion/cli/co_ai/prompts/connectonion/examples.md +0 -0
- connectonion/cli/co_ai/prompts/connectonion/hook-system-options.md +364 -0
- connectonion/cli/co_ai/prompts/connectonion/index.md +162 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/README.md +12 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/auth.md +450 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/google.md +431 -0
- connectonion/cli/co_ai/prompts/connectonion/integrations/microsoft.md +370 -0
- connectonion/cli/co_ai/prompts/connectonion/network/README.md +14 -0
- connectonion/cli/co_ai/prompts/connectonion/network/connect.md +543 -0
- connectonion/cli/co_ai/prompts/connectonion/network/connection.md +538 -0
- connectonion/cli/co_ai/prompts/connectonion/network/deploy.md +123 -0
- connectonion/cli/co_ai/prompts/connectonion/network/host.md +1049 -0
- connectonion/cli/co_ai/prompts/connectonion/network/protocol/agent-relay-protocol.md +495 -0
- connectonion/cli/co_ai/prompts/connectonion/network/protocol/announce-message.md +115 -0
- connectonion/cli/co_ai/prompts/connectonion/principles.md +124 -0
- connectonion/cli/co_ai/prompts/connectonion/quickstart.md +261 -0
- connectonion/cli/co_ai/prompts/connectonion/roadmap.md +81 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/README.md +77 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/meta-agent.md +152 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/minimal.md +105 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/playwright.md +130 -0
- connectonion/cli/co_ai/prompts/connectonion/templates/web-research.md +144 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/README.md +95 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/chat.md +181 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/divider.md +63 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/dropdown.md +83 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/footer.md +44 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/fuzzy.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/input.md +84 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/keys.md +77 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/pick.md +71 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/providers.md +89 -0
- connectonion/cli/co_ai/prompts/connectonion/tui/status_bar.md +67 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/README.md +156 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/calendar_plugin.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/eval.md +89 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/gmail_plugin.md +68 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/image_result_formatter.md +74 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/re_act.md +86 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_plugins/shell_approval.md +69 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/README.md +81 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/diff_writer.md +138 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/get_emails.md +499 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/gmail.md +135 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/google_calendar.md +106 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/memory.md +486 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/microsoft_calendar.md +106 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/outlook.md +120 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/send_email.md +403 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/shell.md +95 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/slash_command.md +96 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/terminal.md +97 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/todo_list.md +252 -0
- connectonion/cli/co_ai/prompts/connectonion/useful_tools/web_fetch.md +130 -0
- connectonion/cli/co_ai/prompts/connectonion/vibe-coding-guide.md +97 -0
- connectonion/cli/co_ai/prompts/connectonion/windows-support.md +258 -0
- connectonion/cli/co_ai/prompts/main.md +247 -0
- connectonion/cli/co_ai/prompts/summarization.md +55 -0
- connectonion/cli/co_ai/prompts/system-reminders/agent.md +23 -0
- connectonion/cli/co_ai/prompts/system-reminders/plan_mode.md +13 -0
- connectonion/cli/co_ai/prompts/system-reminders/security.md +14 -0
- connectonion/cli/co_ai/prompts/system-reminders/simplicity.md +14 -0
- connectonion/cli/co_ai/prompts/tools/ask_user.md +61 -0
- connectonion/cli/co_ai/prompts/tools/background.md +57 -0
- connectonion/cli/co_ai/prompts/tools/edit.md +90 -0
- connectonion/cli/co_ai/prompts/tools/glob.md +52 -0
- connectonion/cli/co_ai/prompts/tools/grep.md +55 -0
- connectonion/cli/co_ai/prompts/tools/plan_mode.md +80 -0
- connectonion/cli/co_ai/prompts/tools/read.md +40 -0
- connectonion/cli/co_ai/prompts/tools/shell.md +67 -0
- connectonion/cli/co_ai/prompts/tools/task.md +51 -0
- connectonion/cli/co_ai/prompts/tools/todo.md +139 -0
- connectonion/cli/co_ai/prompts/tools/write.md +47 -0
- connectonion/cli/co_ai/prompts/workflow.md +89 -0
- connectonion/cli/co_ai/sessions.py +110 -0
- connectonion/cli/co_ai/skills/__init__.py +37 -0
- connectonion/cli/co_ai/skills/builtin/commit/SKILL.md +63 -0
- connectonion/cli/co_ai/skills/builtin/review-pr/SKILL.md +76 -0
- connectonion/cli/co_ai/skills/loader.py +166 -0
- connectonion/cli/co_ai/skills/tool.py +46 -0
- connectonion/cli/co_ai/tools/__init__.py +92 -0
- connectonion/cli/co_ai/tools/ask_user.py +35 -0
- connectonion/cli/co_ai/tools/background.py +201 -0
- connectonion/cli/co_ai/tools/diff_writer.py +291 -0
- connectonion/cli/co_ai/tools/edit.py +89 -0
- connectonion/cli/co_ai/tools/glob.py +84 -0
- connectonion/cli/co_ai/tools/grep.py +158 -0
- connectonion/cli/co_ai/tools/load_guide.py +23 -0
- connectonion/cli/co_ai/tools/multi_edit.py +116 -0
- connectonion/cli/co_ai/tools/plan_mode.py +169 -0
- connectonion/cli/co_ai/tools/read.py +61 -0
- connectonion/cli/co_ai/tools/task.py +59 -0
- connectonion/cli/co_ai/tools/todo_list.py +159 -0
- connectonion/cli/co_ai/tools/write.py +126 -0
- connectonion/cli/commands/__init__.py +11 -1
- connectonion/cli/commands/ai_commands.py +34 -0
- connectonion/cli/commands/copy_commands.py +55 -6
- connectonion/cli/commands/create.py +20 -17
- connectonion/cli/commands/init.py +19 -22
- connectonion/cli/commands/project_cmd_lib.py +15 -0
- connectonion/cli/main.py +11 -0
- connectonion/console.py +15 -1
- connectonion/core/__init__.py +10 -1
- connectonion/core/agent.py +37 -16
- connectonion/core/exceptions.py +74 -0
- connectonion/core/llm.py +54 -6
- connectonion/core/tool_executor.py +32 -31
- connectonion/core/tool_factory.py +47 -10
- connectonion/debug/__init__.py +10 -1
- connectonion/debug/debug_explainer/__init__.py +10 -1
- connectonion/debug/execution_analyzer/__init__.py +10 -1
- connectonion/debug/execution_analyzer/execution_analysis.py +5 -2
- connectonion/debug/runtime_inspector/__init__.py +10 -1
- connectonion/docs/.package-ignore +6 -0
- connectonion/docs/README.md +2036 -0
- connectonion/docs/api.md +457 -0
- connectonion/docs/archive/001-ai-agent-is-just-prompt-plus-function.md +249 -0
- connectonion/docs/archive/README.md +53 -0
- connectonion/docs/archive/archive/consolidation-plan.md +72 -0
- connectonion/docs/archive/archive/core-principles-extracted.md +239 -0
- connectonion/docs/archive/archive/master-principles.md +222 -0
- connectonion/docs/archive/archive/principles.md +293 -0
- connectonion/docs/archive/archive/simplicity-principles.md +221 -0
- connectonion/docs/archive/attack-defense-insights.md +410 -0
- connectonion/docs/archive/business-model.md +305 -0
- connectonion/docs/archive/core-principles-unified.md +190 -0
- connectonion/docs/archive/discussion-journey.md +178 -0
- connectonion/docs/archive/economic-analysis.md +323 -0
- connectonion/docs/archive/features/01-share-and-find.md +256 -0
- connectonion/docs/archive/features/02-agent-authentication.md +93 -0
- connectonion/docs/archive/features/03-test-before-trust.md +71 -0
- connectonion/docs/archive/features/06-reliability-and-offline.md +197 -0
- connectonion/docs/archive/features/README.md +46 -0
- connectonion/docs/archive/features-roadmap.md +247 -0
- connectonion/docs/archive/mcp-comparison-insights.md +215 -0
- connectonion/docs/archive/migration-strategy.md +571 -0
- connectonion/docs/archive/mini-whitepaper.md +293 -0
- connectonion/docs/archive/network-protocol.md +394 -0
- connectonion/docs/archive/semantic-revolution.md +367 -0
- connectonion/docs/archive/technical-architecture.md +453 -0
- connectonion/docs/archive/the-semantic-insight.md +207 -0
- connectonion/docs/archive/threat-model.md +164 -0
- connectonion/docs/cli/README.md +805 -0
- connectonion/docs/cli/auth.md +46 -0
- connectonion/docs/cli/browser.md +235 -0
- connectonion/docs/cli/copy.md +232 -0
- connectonion/docs/cli/create.md +335 -0
- connectonion/docs/cli/init.md +431 -0
- connectonion/docs/co-directory-structure.md +214 -0
- connectonion/docs/concepts/agent.md +1078 -0
- connectonion/docs/concepts/events.md +699 -0
- connectonion/docs/concepts/llm_do.md +256 -0
- connectonion/docs/concepts/max_iterations.md +362 -0
- connectonion/docs/concepts/models.md +641 -0
- connectonion/docs/concepts/plugins.md +101 -0
- connectonion/docs/concepts/prompts.md +122 -0
- connectonion/docs/concepts/session.md +428 -0
- connectonion/docs/concepts/tools.md +512 -0
- connectonion/docs/concepts/transcribe.md +156 -0
- connectonion/docs/concepts/trust.md +291 -0
- connectonion/docs/connectonion.md +1256 -0
- connectonion/docs/debug/README.md +18 -0
- connectonion/docs/debug/auto_debug.md +1026 -0
- connectonion/docs/debug/console.md +129 -0
- connectonion/docs/debug/eval-format.md +178 -0
- connectonion/docs/debug/eval.md +230 -0
- connectonion/docs/debug/exceptions.md +307 -0
- connectonion/docs/debug/log.md +117 -0
- connectonion/docs/debug/xray.md +215 -0
- connectonion/docs/design-decisions/001-choosing-input-method.md +202 -0
- connectonion/docs/design-decisions/002-choosing-llm-function-name.md +202 -0
- connectonion/docs/design-decisions/003-choosing-trust-keyword.md +141 -0
- connectonion/docs/design-decisions/004-cli-create-flow.md +117 -0
- connectonion/docs/design-decisions/005-designing-agent-network-protocol.md +503 -0
- connectonion/docs/design-decisions/006-agent-address-format.md +305 -0
- connectonion/docs/design-decisions/007-authentication-backend-design.md +240 -0
- connectonion/docs/design-decisions/008-naming-is-hard.md +228 -0
- connectonion/docs/design-decisions/009-why-connect-function.md +167 -0
- connectonion/docs/design-decisions/010-cli-ux-progressive-disclosure.md +176 -0
- connectonion/docs/design-decisions/011-global-config-identity-management.md +357 -0
- connectonion/docs/design-decisions/012-tool-execution-separation.md +259 -0
- connectonion/docs/design-decisions/013-debug-and-logging-design.md +253 -0
- connectonion/docs/design-decisions/014-hook-system-design.md +510 -0
- connectonion/docs/design-decisions/015-interactive-auto-debug-design.md +837 -0
- connectonion/docs/design-decisions/016-why-no-zero-knowledge-proofs.md +358 -0
- connectonion/docs/design-decisions/017-session-logging-and-eval-format.md +120 -0
- connectonion/docs/design-decisions/018-event-api-naming.md +274 -0
- connectonion/docs/design-decisions/019-agent-lifecycle-design.md +655 -0
- connectonion/docs/design-decisions/020-trust-system-and-network-architecture.md +503 -0
- connectonion/docs/design-decisions/021-task-storage-jsonl-design.md +496 -0
- connectonion/docs/design-decisions/022-raw-asgi-implementation.md +273 -0
- connectonion/docs/examples.md +0 -0
- connectonion/docs/hook-system-options.md +364 -0
- connectonion/docs/integrations/README.md +12 -0
- connectonion/docs/integrations/auth.md +450 -0
- connectonion/docs/integrations/google.md +431 -0
- connectonion/docs/integrations/microsoft.md +370 -0
- connectonion/docs/network/README.md +14 -0
- connectonion/docs/network/connect.md +629 -0
- connectonion/docs/network/deploy.md +124 -0
- connectonion/docs/network/host.md +1087 -0
- connectonion/docs/network/io.md +538 -0
- connectonion/docs/network/protocol/agent-relay-protocol.md +495 -0
- connectonion/docs/network/protocol/announce-message.md +115 -0
- connectonion/docs/principles.md +124 -0
- connectonion/docs/quickstart.md +261 -0
- connectonion/docs/roadmap.md +81 -0
- connectonion/docs/templates/README.md +77 -0
- connectonion/docs/templates/meta-agent.md +152 -0
- connectonion/docs/templates/minimal.md +105 -0
- connectonion/docs/templates/playwright.md +130 -0
- connectonion/docs/templates/web-research.md +144 -0
- connectonion/docs/tui/README.md +95 -0
- connectonion/docs/tui/chat.md +181 -0
- connectonion/docs/tui/divider.md +63 -0
- connectonion/docs/tui/dropdown.md +83 -0
- connectonion/docs/tui/footer.md +44 -0
- connectonion/docs/tui/fuzzy.md +68 -0
- connectonion/docs/tui/input.md +84 -0
- connectonion/docs/tui/keys.md +77 -0
- connectonion/docs/tui/pick.md +71 -0
- connectonion/docs/tui/providers.md +89 -0
- connectonion/docs/tui/status_bar.md +67 -0
- connectonion/docs/useful_plugins/README.md +160 -0
- connectonion/docs/useful_plugins/calendar_plugin.md +68 -0
- connectonion/docs/useful_plugins/eval.md +89 -0
- connectonion/docs/useful_plugins/gmail_plugin.md +68 -0
- connectonion/docs/useful_plugins/image_result_formatter.md +74 -0
- connectonion/docs/useful_plugins/re_act.md +86 -0
- connectonion/docs/useful_plugins/shell_approval.md +69 -0
- connectonion/docs/useful_plugins/system_reminder.md +210 -0
- connectonion/docs/useful_plugins/tool_approval.md +139 -0
- connectonion/docs/useful_prompts/README.md +127 -0
- connectonion/docs/useful_prompts/coding_agent.md +214 -0
- connectonion/docs/useful_tools/README.md +81 -0
- connectonion/docs/useful_tools/ask_user.md +103 -0
- connectonion/docs/useful_tools/diff_writer.md +158 -0
- connectonion/docs/useful_tools/get_emails.md +519 -0
- connectonion/docs/useful_tools/gmail.md +155 -0
- connectonion/docs/useful_tools/google_calendar.md +126 -0
- connectonion/docs/useful_tools/memory.md +506 -0
- connectonion/docs/useful_tools/microsoft_calendar.md +126 -0
- connectonion/docs/useful_tools/outlook.md +140 -0
- connectonion/docs/useful_tools/send_email.md +423 -0
- connectonion/docs/useful_tools/shell.md +115 -0
- connectonion/docs/useful_tools/slash_command.md +116 -0
- connectonion/docs/useful_tools/terminal.md +115 -0
- connectonion/docs/useful_tools/todo_list.md +272 -0
- connectonion/docs/useful_tools/web_fetch.md +150 -0
- connectonion/docs/vibe-coding-guide.md +97 -0
- connectonion/docs/windows-support.md +258 -0
- connectonion/logger.py +3 -3
- connectonion/network/__init__.py +19 -6
- connectonion/network/asgi/__init__.py +81 -0
- connectonion/network/asgi/http.py +205 -0
- connectonion/network/asgi/websocket.py +217 -0
- connectonion/network/connect.py +232 -185
- connectonion/network/host/__init__.py +59 -0
- connectonion/network/host/auth.py +191 -0
- connectonion/network/host/routes.py +135 -0
- connectonion/network/host/server.py +289 -0
- connectonion/network/host/session.py +78 -0
- connectonion/network/io/__init__.py +21 -0
- connectonion/network/{connection.py → io/base.py} +17 -42
- connectonion/network/io/websocket.py +55 -0
- connectonion/network/relay.py +37 -16
- connectonion/network/trust/__init__.py +30 -0
- connectonion/network/trust/factory.py +138 -0
- connectonion/network/{trust_agents.py → trust/prompts.py} +3 -3
- connectonion/network/{trust_functions.py → trust/tools.py} +2 -2
- connectonion/prompt_files/__init__.py +11 -1
- connectonion/prompt_files/react_acknowledge.md +26 -0
- connectonion/prompts.py +10 -1
- connectonion/tui/chat.py +10 -1
- connectonion/tui/divider.py +10 -1
- connectonion/tui/dropdown.py +10 -1
- connectonion/tui/footer.py +8 -0
- connectonion/tui/fuzzy.py +11 -1
- connectonion/tui/input.py +118 -70
- connectonion/tui/keys.py +133 -6
- connectonion/tui/providers.py +11 -1
- connectonion/tui/status_bar.py +10 -1
- connectonion/useful_events_handlers/__init__.py +8 -0
- connectonion/useful_events_handlers/reflect.py +19 -4
- connectonion/useful_plugins/__init__.py +3 -1
- connectonion/useful_plugins/eval.py +2 -2
- connectonion/useful_plugins/gmail_plugin.py +3 -3
- connectonion/useful_plugins/image_result_formatter.py +3 -3
- connectonion/useful_plugins/re_act.py +114 -28
- connectonion/useful_plugins/shell_approval.py +2 -2
- connectonion/useful_plugins/system_reminder.py +103 -0
- connectonion/useful_plugins/tool_approval.py +233 -0
- connectonion/useful_plugins/ui_stream.py +18 -133
- connectonion/useful_prompts/README.md +61 -0
- connectonion/useful_prompts/__init__.py +45 -0
- connectonion/useful_prompts/coding_agent/README.md +106 -0
- connectonion/useful_prompts/coding_agent/assembler.py +123 -0
- connectonion/useful_prompts/coding_agent/prompts/main.md +227 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/ask_user.md +61 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/background.md +57 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/edit.md +90 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/glob.md +52 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/grep.md +55 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/plan_mode.md +80 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/read.md +40 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/shell.md +67 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/task.md +51 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/todo.md +139 -0
- connectonion/useful_prompts/coding_agent/prompts/tools/write.md +48 -0
- connectonion/useful_prompts/system-reminders/security-warning.md +14 -0
- connectonion/useful_prompts/system-reminders/test-reminder.md +11 -0
- connectonion/useful_tools/__init__.py +31 -4
- connectonion/useful_tools/ask_user.py +35 -0
- connectonion/useful_tools/bash.py +69 -0
- connectonion/useful_tools/diff_writer.py +186 -94
- connectonion/useful_tools/edit.py +102 -0
- connectonion/useful_tools/glob_files.py +97 -0
- connectonion/useful_tools/grep_files.py +171 -0
- connectonion/useful_tools/multi_edit.py +116 -0
- connectonion/useful_tools/read_file.py +73 -0
- connectonion/useful_tools/shell.py +50 -45
- connectonion/useful_tools/write_file.py +129 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.4.dist-info}/METADATA +10 -3
- connectonion-0.6.4.dist-info/RECORD +472 -0
- connectonion/network/asgi.py +0 -407
- connectonion/network/host.py +0 -616
- connectonion/network/trust.py +0 -166
- connectonion-0.6.2.dist-info/RECORD +0 -129
- /connectonion/cli/{docs → co_ai/prompts/connectonion}/connectonion.md +0 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.4.dist-info}/WHEEL +0 -0
- {connectonion-0.6.2.dist-info → connectonion-0.6.4.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
# Models
|
|
2
|
+
|
|
3
|
+
ConnectOnion supports the latest models from OpenAI, Google Gemini, and Anthropic Claude. Get started in 60 seconds with managed keys, or bring your own API keys.
|
|
4
|
+
|
|
5
|
+
## Quick Start (60 Seconds)
|
|
6
|
+
|
|
7
|
+
**Easiest Way: Use Managed Keys** - No API key setup required!
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Authenticate once (includes 100K free tokens)
|
|
11
|
+
co auth
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from connectonion import Agent
|
|
16
|
+
|
|
17
|
+
# Add co/ prefix - that's it!
|
|
18
|
+
agent = Agent("assistant", model="co/gpt-5")
|
|
19
|
+
response = agent.input("Hello!")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
⭐ **Bonus**: [Star our repo](https://github.com/openonion/connectonion) for +100K tokens!
|
|
23
|
+
|
|
24
|
+
**Alternative: Bring Your Own Keys**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Set your API key
|
|
28
|
+
export OPENAI_API_KEY="sk-..."
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from connectonion import Agent
|
|
33
|
+
|
|
34
|
+
# Use model names directly
|
|
35
|
+
agent = Agent("assistant", model="gpt-5")
|
|
36
|
+
response = agent.input("Hello!")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Available Models
|
|
40
|
+
|
|
41
|
+
All models below work with both managed keys (`co/` prefix) and your own API keys.
|
|
42
|
+
|
|
43
|
+
### OpenAI Models
|
|
44
|
+
|
|
45
|
+
#### GPT-5 Series
|
|
46
|
+
```python
|
|
47
|
+
# Best model for coding and agentic tasks across domains
|
|
48
|
+
agent = Agent("assistant", model="co/gpt-5") # Managed
|
|
49
|
+
agent = Agent("assistant", model="gpt-5") # Your key
|
|
50
|
+
|
|
51
|
+
# Faster, cost-efficient version for well-defined tasks
|
|
52
|
+
agent = Agent("assistant", model="co/gpt-5-mini") # Managed
|
|
53
|
+
agent = Agent("assistant", model="gpt-5-mini") # Your key
|
|
54
|
+
|
|
55
|
+
# Fastest, most cost-efficient version
|
|
56
|
+
agent = Agent("assistant", model="co/gpt-5-nano") # Managed
|
|
57
|
+
agent = Agent("assistant", model="gpt-5-nano") # Your key
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### GPT-4o Series (Previous Generation)
|
|
61
|
+
```python
|
|
62
|
+
# Multimodal model with vision capabilities
|
|
63
|
+
agent = Agent("assistant", model="co/gpt-4o") # Managed
|
|
64
|
+
agent = Agent("assistant", model="gpt-4o") # Your key
|
|
65
|
+
|
|
66
|
+
# Affordable small model
|
|
67
|
+
agent = Agent("assistant", model="co/gpt-4o-mini") # Managed
|
|
68
|
+
agent = Agent("assistant", model="gpt-4o-mini") # Your key
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### o4-mini Reasoning Model
|
|
72
|
+
```python
|
|
73
|
+
# OpenAI's newest reasoning model
|
|
74
|
+
agent = Agent("assistant", model="co/o4-mini") # Managed
|
|
75
|
+
agent = Agent("assistant", model="o4-mini") # Your key
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Google Gemini Models
|
|
79
|
+
|
|
80
|
+
#### Gemini 3 (Newest - State-of-the-Art Reasoning)
|
|
81
|
+
```python
|
|
82
|
+
# Most intelligent model family with state-of-the-art reasoning
|
|
83
|
+
agent = Agent("assistant", model="co/gemini-3-pro-preview") # Managed
|
|
84
|
+
agent = Agent("assistant", model="gemini-3-pro-preview") # Your key
|
|
85
|
+
|
|
86
|
+
# Fastest Gemini 3 model
|
|
87
|
+
agent = Agent("assistant", model="co/gemini-3-flash-preview") # Managed
|
|
88
|
+
agent = Agent("assistant", model="gemini-3-flash-preview") # Your key
|
|
89
|
+
|
|
90
|
+
# Image generation model with grounded generation
|
|
91
|
+
agent = Agent("assistant", model="co/gemini-3-pro-image-preview") # Managed
|
|
92
|
+
agent = Agent("assistant", model="gemini-3-pro-image-preview") # Your key
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### Gemini 2.5
|
|
96
|
+
```python
|
|
97
|
+
# Enhanced thinking and reasoning, multimodal understanding, advanced coding
|
|
98
|
+
# Supports: Audio, images, videos, text, and PDF
|
|
99
|
+
agent = Agent("assistant", model="co/gemini-2.5-pro") # Managed
|
|
100
|
+
agent = Agent("assistant", model="gemini-2.5-pro") # Your key
|
|
101
|
+
|
|
102
|
+
# Best price-performance ratio
|
|
103
|
+
agent = Agent("assistant", model="co/gemini-2.5-flash") # Managed
|
|
104
|
+
agent = Agent("assistant", model="gemini-2.5-flash") # Your key
|
|
105
|
+
|
|
106
|
+
# Ultra fast, cheapest Gemini option
|
|
107
|
+
agent = Agent("assistant", model="co/gemini-2.5-flash-lite") # Managed
|
|
108
|
+
agent = Agent("assistant", model="gemini-2.5-flash-lite") # Your key
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### Gemini 2.0
|
|
112
|
+
```python
|
|
113
|
+
# Previous gen workhorse
|
|
114
|
+
agent = Agent("assistant", model="co/gemini-2.0-flash") # Managed
|
|
115
|
+
agent = Agent("assistant", model="gemini-2.0-flash") # Your key
|
|
116
|
+
|
|
117
|
+
# Previous gen lite version
|
|
118
|
+
agent = Agent("assistant", model="co/gemini-2.0-flash-lite") # Managed
|
|
119
|
+
agent = Agent("assistant", model="gemini-2.0-flash-lite") # Your key
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Anthropic Claude Models
|
|
123
|
+
|
|
124
|
+
#### Claude 4.5 Series (Latest)
|
|
125
|
+
```python
|
|
126
|
+
# Claude Opus 4.5 - Most capable model
|
|
127
|
+
agent = Agent("assistant", model="co/claude-opus-4-5") # Managed
|
|
128
|
+
agent = Agent("assistant", model="claude-opus-4-5") # Your key
|
|
129
|
+
|
|
130
|
+
# Claude Sonnet 4.5 - Best balance of intelligence and speed
|
|
131
|
+
agent = Agent("assistant", model="co/claude-sonnet-4-5") # Managed
|
|
132
|
+
agent = Agent("assistant", model="claude-sonnet-4-5") # Your key
|
|
133
|
+
|
|
134
|
+
# Claude Haiku 4.5 - Fastest with near-frontier intelligence
|
|
135
|
+
agent = Agent("assistant", model="co/claude-haiku-4-5") # Managed
|
|
136
|
+
agent = Agent("assistant", model="claude-haiku-4-5") # Your key
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### Claude 4 Series (Previous Generation)
|
|
140
|
+
```python
|
|
141
|
+
# Claude Opus 4.1 - Specialized reasoning
|
|
142
|
+
agent = Agent("assistant", model="co/claude-opus-4-1") # Managed
|
|
143
|
+
agent = Agent("assistant", model="claude-opus-4-1") # Your key
|
|
144
|
+
|
|
145
|
+
# Claude Sonnet 4 - Balanced performance
|
|
146
|
+
agent = Agent("assistant", model="co/claude-sonnet-4") # Managed
|
|
147
|
+
agent = Agent("assistant", model="claude-sonnet-4") # Your key
|
|
148
|
+
|
|
149
|
+
# Claude Opus 4 - Legacy version
|
|
150
|
+
agent = Agent("assistant", model="co/claude-opus-4") # Managed
|
|
151
|
+
agent = Agent("assistant", model="claude-opus-4") # Your key
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Model Capabilities Comparison
|
|
155
|
+
|
|
156
|
+
### Latest Flagship Models
|
|
157
|
+
|
|
158
|
+
| Model | Provider | Key Strengths | Multimodal |
|
|
159
|
+
|-------|----------|---------------|------------|
|
|
160
|
+
| gpt-5 | OpenAI | Best for coding and agentic tasks | ✅ |
|
|
161
|
+
| gemini-2.5-pro | Google | Default model, best price-performance for agents | ✅ |
|
|
162
|
+
| gemini-3-pro-preview | Google | State-of-the-art reasoning | ✅ |
|
|
163
|
+
| claude-sonnet-4-5 | Anthropic | Best balance of intelligence and speed | ✅ |
|
|
164
|
+
|
|
165
|
+
### Context Windows
|
|
166
|
+
|
|
167
|
+
| Model | Context Window |
|
|
168
|
+
|-------|---------------|
|
|
169
|
+
| **OpenAI** | |
|
|
170
|
+
| gpt-5 | 200K tokens |
|
|
171
|
+
| gpt-5-mini | 200K tokens |
|
|
172
|
+
| gpt-5-nano | 128K tokens |
|
|
173
|
+
| gpt-4o | 128K tokens |
|
|
174
|
+
| o4-mini | 128K tokens |
|
|
175
|
+
| **Google** | |
|
|
176
|
+
| gemini-3-pro-preview | 1M tokens |
|
|
177
|
+
| gemini-3-flash-preview | 1M tokens |
|
|
178
|
+
| gemini-2.5-pro | 2M tokens |
|
|
179
|
+
| gemini-2.5-flash | 1M tokens |
|
|
180
|
+
| **Anthropic** | |
|
|
181
|
+
| claude-opus-4-5 | 200K tokens |
|
|
182
|
+
| claude-sonnet-4-5 | 200K tokens |
|
|
183
|
+
| claude-haiku-4-5 | 200K tokens |
|
|
184
|
+
|
|
185
|
+
## Pricing (Managed Keys)
|
|
186
|
+
|
|
187
|
+
All prices are **per 1M tokens** and match official provider pricing:
|
|
188
|
+
|
|
189
|
+
### OpenAI Models
|
|
190
|
+
|
|
191
|
+
| Model | Input | Output | Notes |
|
|
192
|
+
|-------|-------|--------|-------|
|
|
193
|
+
| gpt-5 | $1.25 | $10.00 | Best overall |
|
|
194
|
+
| gpt-5-mini | $0.25 | $2.00 | Fast, cost-effective |
|
|
195
|
+
| gpt-5-nano | $0.05 | $0.40 | Cheapest OpenAI |
|
|
196
|
+
| gpt-4o | $2.50 | $10.00 | Previous gen flagship |
|
|
197
|
+
| gpt-4o-mini | $0.15 | $0.60 | Most cost-effective |
|
|
198
|
+
| o4-mini | $3.00 | $12.00 | Reasoning model |
|
|
199
|
+
|
|
200
|
+
### Google Gemini Models
|
|
201
|
+
|
|
202
|
+
| Model | Input | Output | Notes |
|
|
203
|
+
|-------|-------|--------|-------|
|
|
204
|
+
| gemini-3-pro-preview | $2.00 | $12.00 | State-of-the-art reasoning |
|
|
205
|
+
| gemini-3-flash-preview | $0.50 | $3.00 | Fastest Gemini 3 |
|
|
206
|
+
| gemini-3-pro-image-preview | $2.00 | $0.134 | Image generation |
|
|
207
|
+
| gemini-2.5-pro | $1.25 | $10.00 | **Default model** - best for agents |
|
|
208
|
+
| gemini-2.5-flash | $0.30 | $2.50 | Best price-performance |
|
|
209
|
+
| gemini-2.5-flash-lite | $0.10 | $0.40 | Ultra fast, cheapest |
|
|
210
|
+
| gemini-2.0-flash | $0.10 | $0.40 | Previous gen |
|
|
211
|
+
| gemini-2.0-flash-lite | $0.075 | $0.30 | Previous gen lite |
|
|
212
|
+
|
|
213
|
+
### Anthropic Claude Models
|
|
214
|
+
|
|
215
|
+
| Model | Input | Output | Notes |
|
|
216
|
+
|-------|-------|--------|-------|
|
|
217
|
+
| claude-opus-4-5 | $5.00 | $25.00 | Most capable |
|
|
218
|
+
| claude-sonnet-4-5 | $3.00 | $15.00 | Best intelligence/speed balance |
|
|
219
|
+
| claude-haiku-4-5 | $1.00 | $5.00 | Fastest Claude |
|
|
220
|
+
| claude-opus-4-1 | $15.00 | $75.00 | Specialized reasoning |
|
|
221
|
+
| claude-sonnet-4 | $3.00 | $15.00 | Previous gen |
|
|
222
|
+
| claude-opus-4 | $15.00 | $75.00 | Previous gen |
|
|
223
|
+
|
|
224
|
+
### Cost Estimation Examples
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
# Typical conversation (~1000 input, ~500 output tokens)
|
|
228
|
+
# gpt-5: $0.00125 + $0.005 = $0.00625 (~$6.25 per 1000 requests)
|
|
229
|
+
# gemini-2.5-flash: $0.0003 + $0.00125 = $0.00155 (~$1.55 per 1000 requests)
|
|
230
|
+
# claude-sonnet-4-5: $0.003 + $0.0075 = $0.0105 (~$10.50 per 1000 requests)
|
|
231
|
+
|
|
232
|
+
# With 100K free tokens, you can make approximately:
|
|
233
|
+
# - 66 requests with gpt-5 (1500 tokens each)
|
|
234
|
+
# - 66 requests with gemini-2.5-pro
|
|
235
|
+
# - 66 requests with claude-sonnet-4-5
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Structured Output Support
|
|
239
|
+
|
|
240
|
+
Structured outputs (`llm_do` with Pydantic models) work with most models, but with some limitations:
|
|
241
|
+
|
|
242
|
+
| Provider | Models with Structured Output | Notes |
|
|
243
|
+
|----------|------------------------------|-------|
|
|
244
|
+
| **OpenAI** | All models | Full support |
|
|
245
|
+
| **Google Gemini** | All models | Full support via OpenAI-compatible API |
|
|
246
|
+
| **Anthropic Claude** | claude-sonnet-4-5, claude-opus-4-5, claude-opus-4-1, claude-haiku-4-5 | Uses native structured outputs (Dec 2025) |
|
|
247
|
+
|
|
248
|
+
**Note:** Legacy Claude models (claude-sonnet-4, claude-opus-4) do NOT support structured outputs. Use Claude 4.5 or 4.1 series for structured output tasks.
|
|
249
|
+
|
|
250
|
+
```python
|
|
251
|
+
from connectonion import llm_do
|
|
252
|
+
from pydantic import BaseModel
|
|
253
|
+
|
|
254
|
+
class Result(BaseModel):
|
|
255
|
+
answer: int
|
|
256
|
+
explanation: str
|
|
257
|
+
|
|
258
|
+
# Works with all OpenAI and Gemini models
|
|
259
|
+
result = llm_do("What is 2+2?", output=Result, model="co/gpt-4o-mini")
|
|
260
|
+
result = llm_do("What is 2+2?", output=Result, model="co/gemini-2.5-flash")
|
|
261
|
+
|
|
262
|
+
# Works with Claude 4.5/4.1 models only
|
|
263
|
+
result = llm_do("What is 2+2?", output=Result, model="co/claude-sonnet-4-5") # ✅
|
|
264
|
+
result = llm_do("What is 2+2?", output=Result, model="co/claude-haiku-4-5") # ✅
|
|
265
|
+
# result = llm_do("What is 2+2?", output=Result, model="co/claude-sonnet-4") # ❌ Not supported
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Tool Use Support
|
|
269
|
+
|
|
270
|
+
All models support function calling / tool use:
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
def search(query: str) -> str:
|
|
274
|
+
"""Search for information."""
|
|
275
|
+
return f"Results for {query}"
|
|
276
|
+
|
|
277
|
+
def calculate(expression: str) -> float:
|
|
278
|
+
"""Calculate mathematical expressions."""
|
|
279
|
+
return eval(expression)
|
|
280
|
+
|
|
281
|
+
# Same tools work with all providers
|
|
282
|
+
tools = [search, calculate]
|
|
283
|
+
|
|
284
|
+
agent_openai = Agent("assistant", model="gpt-5", tools=tools)
|
|
285
|
+
agent_google = Agent("assistant", model="gemini-2.5-pro", tools=tools)
|
|
286
|
+
agent_claude = Agent("assistant", model="claude-sonnet-4-5", tools=tools)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Two Ways to Use Models
|
|
290
|
+
|
|
291
|
+
### Option 1: Managed Keys (Recommended for Getting Started)
|
|
292
|
+
|
|
293
|
+
No API key setup required - authenticate once and start using all models:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# One-time authentication
|
|
297
|
+
co auth
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
```python
|
|
301
|
+
from connectonion import Agent
|
|
302
|
+
|
|
303
|
+
# Use any model with co/ prefix
|
|
304
|
+
agent = Agent("assistant", model="co/gpt-5")
|
|
305
|
+
agent = Agent("assistant", model="co/gemini-2.5-pro")
|
|
306
|
+
agent = Agent("assistant", model="co/claude-sonnet-4-5")
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Includes:**
|
|
310
|
+
- 100K free tokens to start
|
|
311
|
+
- Access to all providers (OpenAI, Google, Anthropic)
|
|
312
|
+
- No API key management needed
|
|
313
|
+
- ⭐ Bonus: [Star our repo](https://github.com/openonion/connectonion) for +100K tokens
|
|
314
|
+
|
|
315
|
+
**When to use:**
|
|
316
|
+
- Getting started with ConnectOnion
|
|
317
|
+
- Prototyping and testing different models
|
|
318
|
+
- Learning AI agent development
|
|
319
|
+
- Small projects and experiments
|
|
320
|
+
|
|
321
|
+
See [Authentication docs](../integrations/auth.md) for more details.
|
|
322
|
+
|
|
323
|
+
### Option 2: Bring Your Own API Keys
|
|
324
|
+
|
|
325
|
+
For production use or high-volume applications, use your own API keys for direct billing:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# OpenAI
|
|
329
|
+
export OPENAI_API_KEY="sk-..."
|
|
330
|
+
|
|
331
|
+
# Google Gemini (recommended - matches Google's official SDK)
|
|
332
|
+
export GEMINI_API_KEY="AIza..."
|
|
333
|
+
# Note: GOOGLE_API_KEY also works but GEMINI_API_KEY is preferred
|
|
334
|
+
|
|
335
|
+
# Anthropic
|
|
336
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
from connectonion import Agent
|
|
341
|
+
|
|
342
|
+
# Use models without co/ prefix
|
|
343
|
+
agent = Agent("assistant", model="gpt-5")
|
|
344
|
+
agent = Agent("assistant", model="gemini-2.5-pro")
|
|
345
|
+
agent = Agent("assistant", model="claude-opus-4.1")
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Important:** For Gemini models, use `GEMINI_API_KEY` as recommended by [Google's official documentation](https://ai.google.dev/gemini-api/docs/api-key). While `GOOGLE_API_KEY` is supported for backward compatibility, `GEMINI_API_KEY` is the standard used by Google's Python SDK and most tools in the ecosystem.
|
|
349
|
+
|
|
350
|
+
**When to use:**
|
|
351
|
+
- Production deployments
|
|
352
|
+
- High-volume usage
|
|
353
|
+
- Direct billing relationships with providers
|
|
354
|
+
- Existing API key infrastructure
|
|
355
|
+
|
|
356
|
+
## Model Selection Guide
|
|
357
|
+
|
|
358
|
+
### By Use Case
|
|
359
|
+
|
|
360
|
+
**Best Overall Performance**
|
|
361
|
+
```python
|
|
362
|
+
# Top tier models from each provider
|
|
363
|
+
agent = Agent("assistant", model="gpt-5") # OpenAI flagship
|
|
364
|
+
agent = Agent("assistant", model="gemini-2.5-pro") # Google flagship
|
|
365
|
+
agent = Agent("assistant", model="claude-sonnet-4-5") # Anthropic flagship
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
**Code Generation**
|
|
369
|
+
```python
|
|
370
|
+
# GPT-5 excels at coding and agentic tasks
|
|
371
|
+
agent = Agent("coder", model="gpt-5")
|
|
372
|
+
|
|
373
|
+
# Alternative: Claude Sonnet 4.5
|
|
374
|
+
agent = Agent("coder", model="claude-sonnet-4-5")
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Fast Responses**
|
|
378
|
+
```python
|
|
379
|
+
# Fastest options from each provider
|
|
380
|
+
agent = Agent("quick", model="gpt-5-nano") # OpenAI fastest
|
|
381
|
+
agent = Agent("quick", model="gemini-1.5-flash") # Google fast
|
|
382
|
+
agent = Agent("quick", model="claude-haiku-4-5") # Anthropic fast
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
**Cost-Optimized**
|
|
386
|
+
```python
|
|
387
|
+
# Most cost-efficient options
|
|
388
|
+
agent = Agent("budget", model="gpt-5-nano") # OpenAI cheapest
|
|
389
|
+
agent = Agent("budget", model="gemini-1.5-flash-8b") # Google cheapest
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Long Context (>200K tokens)**
|
|
393
|
+
```python
|
|
394
|
+
# Models with longest context windows
|
|
395
|
+
agent = Agent("reader", model="gemini-2.5-pro") # 2M tokens
|
|
396
|
+
agent = Agent("reader", model="gemini-1.5-pro") # 2M tokens
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
**Multimodal (Images, Audio, Video)**
|
|
400
|
+
```python
|
|
401
|
+
# Gemini 2.5 Pro supports the most modalities
|
|
402
|
+
agent = Agent("multimodal", model="gemini-2.5-pro") # Audio, video, images, PDF
|
|
403
|
+
|
|
404
|
+
# Alternatives
|
|
405
|
+
agent = Agent("multimodal", model="gpt-5") # Images, text
|
|
406
|
+
agent = Agent("multimodal", model="claude-opus-4.1") # Images, text
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
## Usage Examples
|
|
410
|
+
|
|
411
|
+
### Basic Usage
|
|
412
|
+
|
|
413
|
+
```python
|
|
414
|
+
from connectonion import Agent
|
|
415
|
+
|
|
416
|
+
# With managed keys (easiest)
|
|
417
|
+
agent_openai = Agent("assistant", model="co/gpt-5")
|
|
418
|
+
agent_google = Agent("assistant", model="co/gemini-2.5-pro")
|
|
419
|
+
agent_claude = Agent("assistant", model="co/claude-opus-4.1")
|
|
420
|
+
|
|
421
|
+
# OR with your own API keys
|
|
422
|
+
agent_openai = Agent("assistant", model="gpt-5")
|
|
423
|
+
agent_google = Agent("assistant", model="gemini-2.5-pro")
|
|
424
|
+
agent_claude = Agent("assistant", model="claude-opus-4.1")
|
|
425
|
+
|
|
426
|
+
# Same interface for all
|
|
427
|
+
response = agent_openai.input("Explain quantum computing")
|
|
428
|
+
response = agent_google.input("Explain quantum computing")
|
|
429
|
+
response = agent_claude.input("Explain quantum computing")
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Model Comparison
|
|
433
|
+
|
|
434
|
+
```python
|
|
435
|
+
# Compare responses from top models (using managed keys)
|
|
436
|
+
models = ["co/gpt-5", "co/gemini-2.5-pro", "co/claude-sonnet-4-5"]
|
|
437
|
+
prompt = "Write a Python implementation of binary search"
|
|
438
|
+
|
|
439
|
+
for model in models:
|
|
440
|
+
agent = Agent(f"compare_{model}", model=model)
|
|
441
|
+
print(f"\n{model}:")
|
|
442
|
+
print(agent.input(prompt))
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Smart Model Selection
|
|
446
|
+
|
|
447
|
+
```python
|
|
448
|
+
def select_model(task_type: str, speed_priority: bool = False) -> str:
|
|
449
|
+
"""Select optimal model based on requirements."""
|
|
450
|
+
|
|
451
|
+
if speed_priority:
|
|
452
|
+
# Fast models
|
|
453
|
+
return {
|
|
454
|
+
"code": "gpt-5-mini",
|
|
455
|
+
"chat": "gpt-5-nano",
|
|
456
|
+
"analysis": "gemini-1.5-flash",
|
|
457
|
+
"creative": "claude-3-5-haiku"
|
|
458
|
+
}.get(task_type, "gpt-5-nano")
|
|
459
|
+
else:
|
|
460
|
+
# Best quality models
|
|
461
|
+
return {
|
|
462
|
+
"code": "gpt-5",
|
|
463
|
+
"reasoning": "gemini-2.5-pro",
|
|
464
|
+
"analysis": "claude-opus-4.1",
|
|
465
|
+
"multimodal": "gemini-2.5-pro"
|
|
466
|
+
}.get(task_type, "gpt-5")
|
|
467
|
+
|
|
468
|
+
# Use appropriate model
|
|
469
|
+
model = select_model("code", speed_priority=False)
|
|
470
|
+
agent = Agent("coder", model=model)
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Fallback Chain
|
|
474
|
+
|
|
475
|
+
```python
|
|
476
|
+
import os
|
|
477
|
+
|
|
478
|
+
def create_agent_with_fallback(name: str):
|
|
479
|
+
"""Try multiple models if one fails."""
|
|
480
|
+
|
|
481
|
+
# Priority order
|
|
482
|
+
model_chain = [
|
|
483
|
+
"gpt-5", # Best overall
|
|
484
|
+
"claude-sonnet-4-5", # Strong alternative
|
|
485
|
+
"gemini-2.5-pro", # Multimodal option
|
|
486
|
+
"gpt-5-mini", # Faster fallback
|
|
487
|
+
"gpt-4o" # Legacy fallback
|
|
488
|
+
]
|
|
489
|
+
|
|
490
|
+
for model in model_chain:
|
|
491
|
+
try:
|
|
492
|
+
# Check if API key exists for provider
|
|
493
|
+
if model.startswith("gpt") and not os.getenv("OPENAI_API_KEY"):
|
|
494
|
+
continue
|
|
495
|
+
if model.startswith("claude") and not os.getenv("ANTHROPIC_API_KEY"):
|
|
496
|
+
continue
|
|
497
|
+
if model.startswith("gemini") and not os.getenv("GEMINI_API_KEY"):
|
|
498
|
+
continue
|
|
499
|
+
|
|
500
|
+
return Agent(name, model=model)
|
|
501
|
+
except Exception as e:
|
|
502
|
+
print(f"Failed with {model}: {e}")
|
|
503
|
+
continue
|
|
504
|
+
|
|
505
|
+
raise Exception("No models available. Please set at least one API key.")
|
|
506
|
+
|
|
507
|
+
# Will use best available model
|
|
508
|
+
agent = create_agent_with_fallback("assistant")
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Using with Tools
|
|
512
|
+
|
|
513
|
+
```python
|
|
514
|
+
def analyze_data(data: str) -> str:
|
|
515
|
+
"""Analyze provided data."""
|
|
516
|
+
return f"Analysis of: {data}"
|
|
517
|
+
|
|
518
|
+
def generate_report(analysis: str) -> str:
|
|
519
|
+
"""Generate a report from analysis."""
|
|
520
|
+
return f"Report: {analysis}"
|
|
521
|
+
|
|
522
|
+
# Tools work identically across all models
|
|
523
|
+
tools = [analyze_data, generate_report]
|
|
524
|
+
|
|
525
|
+
# High-performance agent
|
|
526
|
+
agent_performance = Agent("analyst",
|
|
527
|
+
model="gpt-5",
|
|
528
|
+
tools=tools)
|
|
529
|
+
|
|
530
|
+
# Cost-optimized agent
|
|
531
|
+
agent_budget = Agent("analyst_budget",
|
|
532
|
+
model="gpt-5-nano",
|
|
533
|
+
tools=tools)
|
|
534
|
+
|
|
535
|
+
# Both can use the same tools
|
|
536
|
+
result1 = agent_performance.input("Analyze sales data and generate report")
|
|
537
|
+
result2 = agent_budget.input("Analyze sales data and generate report")
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
## Error Handling
|
|
541
|
+
|
|
542
|
+
```python
|
|
543
|
+
from connectonion import Agent
|
|
544
|
+
import time
|
|
545
|
+
|
|
546
|
+
def create_robust_agent(name: str, model: str, max_retries: int = 3):
|
|
547
|
+
"""Create agent with automatic error handling."""
|
|
548
|
+
|
|
549
|
+
for attempt in range(max_retries):
|
|
550
|
+
try:
|
|
551
|
+
agent = Agent(name, model=model)
|
|
552
|
+
# Test the agent works
|
|
553
|
+
agent.input("test")
|
|
554
|
+
return agent
|
|
555
|
+
|
|
556
|
+
except Exception as e:
|
|
557
|
+
error = str(e).lower()
|
|
558
|
+
|
|
559
|
+
if "api key" in error:
|
|
560
|
+
raise ValueError(f"Missing API key for {model}. "
|
|
561
|
+
f"Please set the appropriate environment variable.")
|
|
562
|
+
|
|
563
|
+
if "rate limit" in error:
|
|
564
|
+
wait = 2 ** attempt
|
|
565
|
+
print(f"Rate limited. Waiting {wait}s...")
|
|
566
|
+
time.sleep(wait)
|
|
567
|
+
continue
|
|
568
|
+
|
|
569
|
+
if "model not found" in error:
|
|
570
|
+
# Try alternative model
|
|
571
|
+
alternatives = {
|
|
572
|
+
"gpt-5": "gpt-5-mini",
|
|
573
|
+
"gemini-2.5-pro": "gemini-1.5-pro",
|
|
574
|
+
"claude-sonnet-4-5": "claude-sonnet-4"
|
|
575
|
+
}
|
|
576
|
+
alt_model = alternatives.get(model)
|
|
577
|
+
if alt_model and attempt == 0:
|
|
578
|
+
print(f"Model {model} not available, trying {alt_model}")
|
|
579
|
+
model = alt_model
|
|
580
|
+
continue
|
|
581
|
+
|
|
582
|
+
if attempt < max_retries - 1:
|
|
583
|
+
print(f"Attempt {attempt + 1} failed: {e}")
|
|
584
|
+
continue
|
|
585
|
+
else:
|
|
586
|
+
raise
|
|
587
|
+
|
|
588
|
+
raise Exception(f"Failed to create agent with {model}")
|
|
589
|
+
|
|
590
|
+
# Usage
|
|
591
|
+
agent = create_robust_agent("assistant", "gpt-5")
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
## Migration Guide
|
|
595
|
+
|
|
596
|
+
### From Single Model to Multi-Model
|
|
597
|
+
|
|
598
|
+
**Before (ConnectOnion 0.0.1)**
|
|
599
|
+
```python
|
|
600
|
+
# Only OpenAI GPT models supported
|
|
601
|
+
agent = Agent("assistant", model="gpt-4o-mini")
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
**After (ConnectOnion 0.0.2)**
|
|
605
|
+
```python
|
|
606
|
+
# Any provider, any model
|
|
607
|
+
agent = Agent("assistant", model="gpt-5")
|
|
608
|
+
agent = Agent("assistant", model="gemini-2.5-pro")
|
|
609
|
+
agent = Agent("assistant", model="claude-sonnet-4-5")
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### From Direct SDK Usage
|
|
613
|
+
|
|
614
|
+
**Before (Using provider SDKs)**
|
|
615
|
+
```python
|
|
616
|
+
# Different code for each provider
|
|
617
|
+
import openai
|
|
618
|
+
client = openai.OpenAI()
|
|
619
|
+
response = client.chat.completions.create(model="gpt-4", ...)
|
|
620
|
+
|
|
621
|
+
import anthropic
|
|
622
|
+
client = anthropic.Anthropic()
|
|
623
|
+
response = client.messages.create(model="claude-3", ...)
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
**After (Unified with ConnectOnion)**
|
|
627
|
+
```python
|
|
628
|
+
# Same interface for all providers
|
|
629
|
+
agent = Agent("assistant", model="gpt-5")
|
|
630
|
+
response = agent.input(prompt)
|
|
631
|
+
|
|
632
|
+
agent = Agent("assistant", model="claude-sonnet-4-5")
|
|
633
|
+
response = agent.input(prompt)
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
## See Also
|
|
638
|
+
|
|
639
|
+
- [Getting Started](../quickstart.md) - Get started with ConnectOnion
|
|
640
|
+
- [Authentication](../integrations/auth.md) - Using managed keys
|
|
641
|
+
- [Tools](tools.md) - Using tools with models
|