make schema optional argument

This commit is contained in:
Gokul Mohanarangan
2023-08-17 09:23:14 +05:30
parent 5f79e04642
commit eb13a7bd64
9 changed files with 48 additions and 37 deletions

View File

@@ -14,7 +14,6 @@ class TranscriptTopicDetectorProcessor(Processor):
PROMPT = """
### Human:
Generate information based on the given schema:
For the title field, generate a short title for the given text.
For the summary field, summarize the given text in a maximum of
@@ -62,7 +61,7 @@ class TranscriptTopicDetectorProcessor(Processor):
self.logger.info(f"Topic detector got {len(text)} length transcript")
prompt = self.PROMPT.format(input_text=text)
result = await retry(self.llm.generate)(
prompt=prompt, kwargs=self.kwargs, logger=self.logger
prompt=prompt, schema=self.topic_detector_schema, logger=self.logger
)
summary = TitleSummary(
title=result["title"],