@@ -41,10 +41,21 @@ def create_answer_translator(
4141 return utils .create_translator (model , AnswerResponse )
4242
4343
44+ @dataclass
45+ class AnswerGeneratorSettings :
46+ answer_generator_model : typechat .TypeChatLanguageModel
47+ answer_combiner_model : typechat .TypeChatLanguageModel
48+ max_chars_in_budget : int
49+ concurrency : int
50+ fast_stop : bool
51+ model_instructions : list [typechat .PromptSection ] | None = None
52+ include_context_schema : bool | None = None
53+
54+
4455class IAnswerGenerator (Protocol ):
4556 """Protocol for answer generators."""
4657
47- settings : " AnswerGeneratorSettings"
58+ settings : AnswerGeneratorSettings
4859
4960 async def generate_answer (
5061 self , question : str , context : AnswerContext | str , debug : bool
@@ -55,17 +66,6 @@ async def combine_partial_answers(
5566 ) -> typechat .Result [AnswerResponse ]: ...
5667
5768
58- @dataclass
59- class AnswerGeneratorSettings :
60- answer_generator_model : typechat .TypeChatLanguageModel
61- answer_combiner_model : typechat .TypeChatLanguageModel
62- max_chars_in_budget : int
63- concurrency : int
64- fast_stop : bool
65- model_instructions : list [typechat .PromptSection ] | None = None
66- include_context_schema : bool | None = None
67-
68-
6969def create_answer_generator_settings (
7070 model : typechat .TypeChatLanguageModel | None = None ,
7171) -> AnswerGeneratorSettings :
0 commit comments