diff --git a/trustgraph/model/text_completion/azure/llm.py b/trustgraph/model/text_completion/azure/llm.py index 44c83452..86395317 100755 --- a/trustgraph/model/text_completion/azure/llm.py +++ b/trustgraph/model/text_completion/azure/llm.py @@ -134,10 +134,7 @@ class Processor(ConsumerProducer): print("Send response...", flush=True) - resp = response.replace("```json", "") - resp = resp.replace("```", "") - - r = TextCompletionResponse(response=resp, error=None) + r = TextCompletionResponse(response=response, error=None) self.producer.send(r, properties={"id": id}) except TooManyRequests: diff --git a/trustgraph/model/text_completion/bedrock/llm.py b/trustgraph/model/text_completion/bedrock/llm.py index 4466ad72..fccf6353 100755 --- a/trustgraph/model/text_completion/bedrock/llm.py +++ b/trustgraph/model/text_completion/bedrock/llm.py @@ -213,13 +213,10 @@ class Processor(ConsumerProducer): print(outputtext, flush=True) - resp = outputtext.replace("```json", "") - resp = resp.replace("```", "") - print("Send response...", flush=True) r = TextCompletionResponse( error=None, - response=resp + response=outputtext ) self.send(r, properties={"id": id}) diff --git a/trustgraph/model/text_completion/cohere/llm.py b/trustgraph/model/text_completion/cohere/llm.py index 216c8e40..af55fd2c 100755 --- a/trustgraph/model/text_completion/cohere/llm.py +++ b/trustgraph/model/text_completion/cohere/llm.py @@ -93,9 +93,6 @@ class Processor(ConsumerProducer): resp = output.text print(resp, flush=True) - resp = resp.replace("```json", "") - resp = resp.replace("```", "") - print("Send response...", flush=True) r = TextCompletionResponse(response=resp, error=None) self.send(r, properties={"id": id}) diff --git a/trustgraph/model/text_completion/ollama/llm.py b/trustgraph/model/text_completion/ollama/llm.py index e7cdbaf4..93d89720 100755 --- a/trustgraph/model/text_completion/ollama/llm.py +++ b/trustgraph/model/text_completion/ollama/llm.py @@ -87,10 +87,7 @@ class Processor(ConsumerProducer): print("Send response...", flush=True) - resp = response.replace("```json", "") - resp = resp.replace("```", "") - - r = TextCompletionResponse(response=resp, error=None) + r = TextCompletionResponse(response=response, error=None) self.send(r, properties={"id": id}) diff --git a/trustgraph/model/text_completion/vertexai/llm.py b/trustgraph/model/text_completion/vertexai/llm.py index a5dc9c24..17ebde6c 100755 --- a/trustgraph/model/text_completion/vertexai/llm.py +++ b/trustgraph/model/text_completion/vertexai/llm.py @@ -148,9 +148,6 @@ class Processor(ConsumerProducer): resp = resp.text - resp = resp.replace("```json", "") - resp = resp.replace("```", "") - print("Send response...", flush=True) r = TextCompletionResponse(