mirror of
https://github.com/open-webui/pipelines.git
synced 2026-11-05 01:37:24 +00:00
[PR #179] [MERGED] Refactor Anthropic Manifold for improved reliability #348
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/pipelines#348
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/pipelines/pull/179
Author: @justinh-rahb
Created: 7/30/2024
Status: ✅ Merged
Merged: 7/31/2024
Merged by: @justinh-rahb
Base:
main← Head:anthropic-fix📝 Commits (1)
dd5e986refac: anthropic manifold📊 Changes
1 file changed (+47 additions, -24 deletions)
View changed files
📝
examples/pipelines/providers/anthropic_manifold_pipeline.py(+47 -24)📄 Description
This pull request addresses issues related to the use of the Anthropic library for interacting with the Anthropic API. The previously implemented pipeline was experiencing authentication errors which were not reproducible using simple cURL commands. To resolve this, the code has been refactored to utilize the
requestslibrary coupled withsseclient-py, eliminating dependency on the original Anthropic library.Key Changes:
Dependency Update:
anthropiclibrary dependency.sseclient-pyas a requirement to handle server-sent events (SSE).Initialization:
API Call Adjustments:
stream_responseandget_completionhave been adapted to function usingrequests.post()instead of the Anthropic client method.SSEClientfor real-time updates.Error Handling:
Context:
This refactor was driven by user-reported bugs related to API key expiration and authentication issues. The previous implementation using the Anthropic library seemed inherently problematic, while manual cURL calls with the same API keys consistently yielded valid responses.
The transition to using direct HTTP requests has resulted in a more stable and reliable pipeline, reducing potential issues caused by previous library dependencies. This change is expected to enhance user experience, particularly for those deploying the pipeline via Docker with the Open WebUI. Thanks to @sriparashiva for the code, I used some portions of it for this refactored implementation. Thank you also to @dannykorpan and @Digit404 for your patience and assistance.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.