MCPcopy
hub / github.com/fauxpilot/fauxpilot / streamed_response

Method streamed_response

copilot_proxy/utils/codegen.py:233–238  ·  view source on GitHub ↗
(self, completion, choices)

Source from the content-addressed store, hash-verified

231 return 'cmpl-' + ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(29))
232
233 def streamed_response(self, completion, choices):
234 for c in choices:
235 completion['id'] = self.random_completion_id()
236 completion['choices'] = [c]
237 yield f'{json.dumps(completion)}'
238 yield '[DONE]'
239
240 def non_streamed_response(self, completion, choices) -> str:
241 completion['id'] = self.random_completion_id()

Callers 1

__call__Method · 0.95

Calls 1

random_completion_idMethod · 0.95

Tested by

no test coverage detected