Commit
·
5ef2ea1
1
Parent(s):
6a2ef16
logging
Browse files
main.py
CHANGED
|
@@ -140,6 +140,7 @@ async def proxy(request: Request, model_path: str, api_key: str = Security(get_a
|
|
| 140 |
if k.lower() not in ['host', 'authorization', 'x-goog-api-key', 'content-length']
|
| 141 |
}
|
| 142 |
|
|
|
|
| 143 |
|
| 144 |
if "streamGenerateContent" in model_path:
|
| 145 |
target_url = target_url + "&alt=sse"
|
|
@@ -180,8 +181,6 @@ async def proxy(request: Request, model_path: str, api_key: str = Security(get_a
|
|
| 180 |
response_data = await response.aread()
|
| 181 |
response_json = json.loads(response_data)
|
| 182 |
|
| 183 |
-
print(response_json)
|
| 184 |
-
|
| 185 |
if 'candidates' in response_json:
|
| 186 |
for candidate in response_json.get('candidates', []):
|
| 187 |
if 'content' in candidate and 'parts' in candidate.get('content', {}):
|
|
|
|
| 140 |
if k.lower() not in ['host', 'authorization', 'x-goog-api-key', 'content-length']
|
| 141 |
}
|
| 142 |
|
| 143 |
+
print(request_body_to_send)
|
| 144 |
|
| 145 |
if "streamGenerateContent" in model_path:
|
| 146 |
target_url = target_url + "&alt=sse"
|
|
|
|
| 181 |
response_data = await response.aread()
|
| 182 |
response_json = json.loads(response_data)
|
| 183 |
|
|
|
|
|
|
|
| 184 |
if 'candidates' in response_json:
|
| 185 |
for candidate in response_json.get('candidates', []):
|
| 186 |
if 'content' in candidate and 'parts' in candidate.get('content', {}):
|