MCPcopy Create free account
hub / github.com/SensAI-PT/RAGMeUp / clean_reply

Method clean_reply

server/LLMHelper.py:80–88  ·  view source on GitHub ↗
(self, reply)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected