-
Notifications
You must be signed in to change notification settings - Fork 2
Fix problems with callers confused by gzip encoding #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| # dependencies = [ | ||
| # "aiohttp", | ||
| # "arize-phoenix-otel", | ||
| # "multidict", | ||
| # "opentelemetry-api", | ||
| # "opentelemetry-sdk", | ||
| # "pyyaml", | ||
|
|
@@ -12,17 +13,18 @@ | |
|
|
||
| import json | ||
| import logging | ||
| import yaml | ||
| from typing import Dict, Any, List | ||
|
|
||
| from aiohttp import web | ||
| import aiohttp | ||
|
|
||
| import multidict | ||
| from opentelemetry import trace | ||
| from opentelemetry.sdk.trace import TracerProvider | ||
| from opentelemetry.sdk.trace.export import BatchSpanProcessor | ||
| from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter | ||
| from opentelemetry.sdk.resources import Resource | ||
| from openinference.semconv.trace import SpanAttributes | ||
| import yaml | ||
|
|
||
| # Configure logging | ||
| logging.basicConfig(level=logging.INFO) | ||
|
|
@@ -285,10 +287,14 @@ async def handle_generate_content(request): | |
| response_json.get("usageMetadata", {}).get("totalTokenCount", 0), | ||
| ) | ||
|
|
||
| mutable_headers = CIMultiDict(upstream_response.headers) | ||
| mutable_headers.pop('Transfer-Encoding', None) | ||
| mutable_headers.pop('Content-Encoding', None) | ||
|
|
||
|
Comment on lines
+290
to
+293
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, get an overview of the proxy.py file structure and handler locations
head -300 proxy.py | tail -50Repository: QuixiAI/VibeLogger Length of output: 2675 🏁 Script executed: # Look at the specific section around lines 290-293
sed -n '285,305p' proxy.pyRepository: QuixiAI/VibeLogger Length of output: 968 🏁 Script executed: # Check the structure of other handlers mentioned
sed -n '325,345p' proxy.py
sed -n '455,475p' proxy.py
sed -n '620,640p' proxy.pyRepository: QuixiAI/VibeLogger Length of output: 2644 Apply the same header cleanup to other proxy handlers for consistency. The fix at lines 290-293 correctly removes 🧰 Tools🪛 Ruff (0.14.10)290-290: Undefined name (F821) 🤖 Prompt for AI Agents |
||
| return web.Response( | ||
| status=upstream_response.status, | ||
| body=response_body, | ||
| headers=dict(upstream_response.headers), | ||
| headers=mutable_headers, | ||
| ) | ||
|
|
||
| except Exception as e: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.