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

Method completion_finish_chunk

examples/server/server.py:10167–10186  ·  view source on GitHub ↗
(
        self,
        request: CompletionRequest,
        completion: Completion,
        finish_reason: str,
    )

Source from the content-addressed store, hash-verified

10165 return chunks
10166
10167 def completion_finish_chunk(
10168 self,
10169 request: CompletionRequest,
10170 completion: Completion,
10171 finish_reason: str,
10172 ) -> CompletionChunk:
10173 return {
10174 "id": request.id,
10175 "object": "text_completion",
10176 "created": request.created,
10177 "model": self.model.model_path,
10178 "choices": [
10179 {
10180 "text": "",
10181 "index": completion.index,
10182 "logprobs": None,
10183 "finish_reason": finish_reason,
10184 }
10185 ],
10186 }
10187
10188 def _build_completion_choice(
10189 self,

Callers 1

finish_completionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected