Patch/non gpt model pydantic output (#1003)

* patching for non-gpt model

* removal of json_object tool name assignment

* fixed issue for smaller models due to instructions prompt

* fixing for ollama llama3 models

* closing brackets

* removed not used and fixes
This commit is contained in:
Lorenze Jay
2024-07-26 10:57:56 -07:00
committed by GitHub
parent 8b513de64c
commit 5ac7050f7a
3 changed files with 14 additions and 17 deletions

View File

@@ -66,11 +66,11 @@ class TaskEvaluator:
"- Entities extracted from the task output, if any, their type, description, and relationships"
)
instructions = "I'm gonna convert this raw text into valid JSON."
instructions = "Convert all responses into valid JSON output."
if not self._is_gpt(self.llm):
model_schema = PydanticSchemaParser(model=TaskEvaluation).get_schema()
instructions = f"{instructions}\n\nThe json should have the following structure, with the following keys:\n{model_schema}"
instructions = f"{instructions}\n\nReturn only valid JSON with the following schema:\n```json\n{model_schema}\n```"
converter = Converter(
llm=self.llm,