MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / generate_async

Method generate_async

trinity/common/models/model.py:514–520  ·  view source on GitHub ↗

Generate a list of experiences from a list of prompts in async.

(self, prompts: List[str], **kwargs)

Source from the content-addressed store, hash-verified

512
513 @_history_recorder
514 async def generate_async(self, prompts: List[str], **kwargs) -> List[Experience]:
515 """Generate a list of experiences from a list of prompts in async."""
516 lora_request = await self.get_lora_request_async()
517 results = await asyncio.gather(
518 *[self.model.generate.remote(prompt, lora_request, **kwargs) for prompt in prompts]
519 )
520 return [exp for exps in results for exp in exps]
521
522 @_history_recorder
523 def chat(self, messages: List[dict], **kwargs) -> List[Experience]:

Callers 3

run_asyncMethod · 0.80
test_generateMethod · 0.80
test_chat_completionsMethod · 0.80

Calls 2

remoteMethod · 0.80

Tested by 2

test_generateMethod · 0.64
test_chat_completionsMethod · 0.64