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

Method asyncSetUp

tests/common/vllm_test.py:1533–1552  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1531)
1532class TestAPIServerToolCall(VLLMTestBase):
1533 async def asyncSetUp(self):
1534 self.config = get_template_config()
1535 self.config.mode = "explore"
1536 self.config.model.model_path = get_api_model_path()
1537 self.config.explorer.rollout_model.engine_type = "vllm"
1538 self.config.explorer.rollout_model.engine_num = 1
1539 self.config.explorer.rollout_model.tensor_parallel_size = 1
1540 self.config.explorer.rollout_model.chat_template = CHAT_TEMPLATE
1541 self.config.explorer.rollout_model.enable_openai_api = True
1542 self.config.explorer.rollout_model.enable_history = True
1543 # added for toolcalls
1544 self.config.explorer.rollout_model.enable_auto_tool_choice = True
1545 self.config.explorer.rollout_model.tool_call_parser = "hermes"
1546 self.config.explorer.rollout_model.enable_thinking = self.enable_thinking
1547 self.config.explorer.rollout_model.reasoning_parser = self.reasoning_parser
1548
1549 self.config.check_and_update()
1550 self.engines, self.auxiliary_engines = await create_test_models(self.config)
1551 self.model_wrapper = self.engines[0]
1552 self.model_wrapper_no_history = clone_wrapper(self.model_wrapper, enable_history=False)
1553
1554 async def test_api_tool_calls(self):
1555 """Tests the full conversation flow of a tool call via the OpenAI API.

Callers

nothing calls this directly

Calls 5

get_template_configFunction · 0.90
get_api_model_pathFunction · 0.90
create_test_modelsFunction · 0.85
clone_wrapperFunction · 0.85
check_and_updateMethod · 0.80

Tested by

no test coverage detected