(self, reply)
| 78 | raise ValueError("No LLM backend selected.") |
| 79 | |
| 80 | def clean_reply(self, reply): |
| 81 | # Remove the code decorators and backticks that ChatGPT returns |
| 82 | if reply.startswith('```') and reply.endswith('```'): |
| 83 | # Remove the first line as that contains the ``` decorator with whatever language or syntax it is outputting |
| 84 | lines = reply.split('\n') |
| 85 | cleaned_lines = lines[1:-1] |
| 86 | return '\n'.join(cleaned_lines) |
| 87 | |
| 88 | return reply |
| 89 | |
| 90 | def generate_response(self, system_prompt, prompt, history): |
| 91 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected