MCPcopy Index your code
hub / github.com/abetlen/llama-cpp-python / parse_chat_response

Method parse_chat_response

examples/server/server.py:8470–8484  ·  view source on GitHub ↗
(
        self,
        response_text: str,
        *,
        tools: Optional[List[ChatTemplateTool]] = None,
        partial: bool,
        generation_prompt: str = "",
    )

Source from the content-addressed store, hash-verified

8468 )
8469
8470 def parse_chat_response(
8471 self,
8472 response_text: str,
8473 *,
8474 tools: Optional[List[ChatTemplateTool]] = None,
8475 partial: bool,
8476 generation_prompt: str = "",
8477 ) -> Dict[str, Any]:
8478 return self._response_parser(
8479 tools=tools,
8480 generation_prompt=generation_prompt,
8481 ).parse_chat_response(
8482 response_text,
8483 partial=partial,
8484 )
8485
8486 def _chat_tool_name_and_grammar(
8487 self,

Callers

nothing calls this directly

Calls 2

_response_parserMethod · 0.95
parse_chat_responseMethod · 0.45

Tested by

no test coverage detected