Skip to content

Opus 4.5, effort parameter and web_search tool filter#7

Open
nahoj wants to merge 8 commits intochristian-taillon:mainfrom
nahoj:opus-4.5
Open

Opus 4.5, effort parameter and web_search tool filter#7
nahoj wants to merge 8 commits intochristian-taillon:mainfrom
nahoj:opus-4.5

Conversation

@nahoj
Copy link

@nahoj nahoj commented Dec 3, 2025

In the pipeline:

  • Add Haiku and Opus 4.5, fix max_tokens/thinking.budget_tokens conflict
  • Add effort parameter support

I also added a filter to use Anthropic's server-side web search, inspired by https://github.com/owndev/Open-WebUI-Functions/blob/main/filters/google_search_tool.py. It can be taken out of the PR if you don't want it.

christian-taillon and others added 8 commits November 1, 2025 21:05
…andling

**Phase 0: OpenWebUI Compliance** ✅
- Added __user__ parameter to pipe() method for user tracking/audit trails
- Properly typed __event_emitter__ as Optional[Any]
- Updated return type to AsyncGenerator[str, None] for precision
- Updated _stream_response() signature to accept __event_emitter__
- Enhanced all Valves with comprehensive Field descriptions
- Added REQUEST_TIMEOUT valve (configurable, env: ANTHROPIC_REQUEST_TIMEOUT)
- Added MODEL_CACHE_TTL valve (configurable, env: ANTHROPIC_MODEL_CACHE_TTL)
- Added _models_cache_time tracking for future TTL implementation
- Updated docstring with all environment variables

**Phase 1: Type Safety & Validation** ✅
- Added complete type hints to all methods
- Comprehensive input validation in pipe() method
- Enhanced _process_content_item() validation with detailed checks
- Added try-except blocks around content processing

**Phase 2: Error Handling & Reliability** ✅
- Created _format_error() helper for consistent error formatting
- Unified error responses (streaming and non-streaming)
- Request ID tracking and logging throughout
- Enhanced _normalize_content_blocks() with circular reference detection

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@christian-taillon
Copy link
Owner

@nahoj, thanks for pr.

Will review this weekend and update hosted app on OpenWebUI Community and reference your profile/commit!

  • Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants