MCPcopy Create free account
hub / github.com/abetlen/llama-cpp-python / collect_completion

Method collect_completion

examples/server/server.py:7885–7894  ·  view source on GitHub ↗
(stream: Iterator[Any])

Source from the content-addressed store, hash-verified

7883
7884 @staticmethod
7885 def collect_completion(stream: Iterator[Any]) -> OpenAICompletion:
7886 iterator = iter(stream)
7887 while True:
7888 try:
7889 next(iterator)
7890 except StopIteration as stop:
7891 result = stop.value
7892 if result is None:
7893 raise RuntimeError("missing completion result")
7894 return cast(OpenAICompletion, result)
7895
7896 @staticmethod
7897 def _tools_for_response_parser(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected