- Added different AIs for ASR and for structure builder
- Forcing models to use JSON from now on
This commit is contained in:
2026-09-23 00:22:09 +03:00
parent 3ae4d82f14
commit 642542ad10
4 changed files with 34 additions and 17 deletions

View File

@@ -79,16 +79,15 @@ class ImageElement(_StrictModel):
event_id: int
StructureElement = Annotated[
StructureElement = (
HeadingElement
| ParagraphElement
| UnorderedListElement
| OrderedListElement
| DefinitionElement
| ImportantElement
| ImageElement,
Field(discriminator="type"),
]
| ImageElement
)
class Structure(_StrictModel):
@@ -204,7 +203,7 @@ class StructureBuilder:
retries_left = self.MAX_RETRIES
while retries_left > 0:
retries_left -= 1
response = self._agent.completion(messages=messages)
response = self._agent.completion(messages=messages, response_format=_BuildResult)
if debug_dir:
with open(
f"{debug_dir}/{retries_left}-retries-left.txt",