mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-20 18:51:03 +02:00
Fix async send issues in LLMs
This commit is contained in:
parent
1495666e65
commit
0bcd9ffa36
4 changed files with 6 additions and 6 deletions
|
|
@ -154,7 +154,7 @@ class Processor(ConsumerProducer):
|
|||
print("Send response...", flush=True)
|
||||
|
||||
r = TextCompletionResponse(response=resp, error=None, in_token=inputtokens, out_token=outputtokens, model=self.model)
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
except TooManyRequests:
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ class Processor(ConsumerProducer):
|
|||
model=None,
|
||||
)
|
||||
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class Processor(ConsumerProducer):
|
|||
model=None,
|
||||
)
|
||||
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class Processor(ConsumerProducer):
|
|||
model=None,
|
||||
)
|
||||
|
||||
await self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class Processor(ConsumerProducer):
|
|||
model=self.model
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ class Processor(ConsumerProducer):
|
|||
model=None,
|
||||
)
|
||||
|
||||
self.producer.send(r, properties={"id": id})
|
||||
await self.send(r, properties={"id": id})
|
||||
|
||||
self.consumer.acknowledge(msg)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue