Rate limit handling (#11)

* Added a rate limit exception
* Reduce request/response timeouts because looks like there are major issues
* Add rate limit exception catch to all consumers
* Version to 0.6.3
This commit is contained in:
cybermaggedon 2024-08-19 22:15:32 +01:00 committed by GitHub
parent 25f557d8a5
commit a38f530c5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 188 additions and 152 deletions

View file

@ -59,15 +59,16 @@ class Processor(ConsumerProducer):
prompt = v.prompt
# FIXME: Deal with rate limits?
output = self.cohere.chat(
model=self.model,
message=prompt,
preamble = "You are a helpful AI-assistant.",
temperature=0.0,
chat_history=[],
prompt_truncation='auto',
connectors=[]
)
model=self.model,
message=prompt,
preamble = "You are a helpful AI-assistant.",
temperature=0.0,
chat_history=[],
prompt_truncation='auto',
connectors=[]
)
resp = output.text
print(resp, flush=True)