(self, completion, choices)
| 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() |
no test coverage detected