mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 12:11:02 +02:00
Fix MistralAI, symbol error caused it to fail to start
This commit is contained in:
parent
222de268c7
commit
fcb28e3a47
1 changed files with 12 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ Simple LLM service, performs text prompt completion using Mistral.
|
||||||
Input is prompt, output is response.
|
Input is prompt, output is response.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from mistralai import Mistral, RateLimitError
|
from mistralai import Mistral
|
||||||
from prometheus_client import Histogram
|
from prometheus_client import Histogram
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
@ -130,12 +130,18 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
print("Done.", flush=True)
|
print("Done.", flush=True)
|
||||||
|
|
||||||
# FIXME: Wrong exception, don't know what this LLM throws
|
# FIXME: Wrong exception. The MistralAI library has retry logic
|
||||||
# for a rate limit
|
# so retry-able errors are retried transparently. It means we
|
||||||
except Mistral.RateLimitError:
|
# don't get rate limit events.
|
||||||
|
|
||||||
# Leave rate limit retries to the base handler
|
# We could choose to turn off retry and handle all that here
|
||||||
raise TooManyRequests()
|
# or subclass BackoffStrategy to keep the retry logic, but
|
||||||
|
# get the events out.
|
||||||
|
|
||||||
|
# except Mistral.RateLimitError:
|
||||||
|
|
||||||
|
# # Leave rate limit retries to the base handler
|
||||||
|
# raise TooManyRequests()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue