fix: litellm

This commit is contained in:
Timothy J. Baek 2024-06-03 18:02:21 -07:00
parent 17bc338c4a
commit ecd7f8e5ad
2 changed files with 2 additions and 2 deletions

View File

@ -109,7 +109,7 @@ class Pipeline:
headers["Authorization"] = f"Bearer {self.valves.LITELLM_API_KEY}" headers["Authorization"] = f"Bearer {self.valves.LITELLM_API_KEY}"
try: try:
payload = {**body, "model": model_id, "user_id": body["user"]["id"]} payload = {**body, "model": model_id, "user": body["user"]["id"]}
payload.pop("chat_id", None) payload.pop("chat_id", None)
payload.pop("user", None) payload.pop("user", None)
payload.pop("title", None) payload.pop("title", None)

View File

@ -197,7 +197,7 @@ class Pipeline:
try: try:
r = requests.post( r = requests.post(
url=f"http://{self.valves.LITELLM_PROXY_HOST}:{self.valves.LITELLM_PROXY_PORT}/v1/chat/completions", url=f"http://{self.valves.LITELLM_PROXY_HOST}:{self.valves.LITELLM_PROXY_PORT}/v1/chat/completions",
json={**body, "model": model_id, "user_id": body["user"]["id"]}, json={**body, "model": model_id, "user": body["user"]["id"]},
stream=True, stream=True,
) )