Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /BerriAI_litellm /tests /test_team_logging.py
| # What this tests ? | |
| ## Tests /models and /model/* endpoints | |
| import pytest | |
| import asyncio | |
| import aiohttp | |
| import os | |
| import dotenv | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| async def generate_key(session, models=[], team_id=None): | |
| url = "http://0.0.0.0:4000/key/generate" | |
| headers = {"Authorization": "Bearer sk-1234", "Content-Type": "application/json"} | |
| data = { | |
| "models": models, | |
| "duration": None, | |
| "team_id": team_id, | |
| } | |
| async with session.post(url, headers=headers, json=data) as response: | |
| status = response.status | |
| response_text = await response.text() | |
| print(response_text) | |
| print() | |
| if status != 200: | |
| raise Exception(f"Request did not return a 200 status code: {status}") | |
| return await response.json() | |
| async def chat_completion(session, key, model="azure-gpt-3.5", request_metadata=None): | |
| url = "http://0.0.0.0:4000/chat/completions" | |
| headers = { | |
| "Authorization": f"Bearer {key}", | |
| "Content-Type": "application/json", | |
| } | |
| data = { | |
| "model": model, | |
| "messages": [ | |
| {"role": "system", "content": "You are a helpful assistant."}, | |
| {"role": "user", "content": "Hello!"}, | |
| ], | |
| "metadata": request_metadata, | |
| } | |
| print("data sent in test=", data) | |
| async with session.post(url, headers=headers, json=data) as response: | |
| status = response.status | |
| response_text = await response.text() | |
| print(response_text) | |
| print() | |
| if status != 200: | |
| raise Exception(f"Request did not return a 200 status code: {status}") | |
Xet Storage Details
- Size:
- 1.65 kB
- Xet hash:
- 404a52106593778dfb3df3c7f16889a72f0207c0c5a95a26bac29a05657c7fc6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.