evalquiz_pipeline_server.evalquiz_config_iteration.internal_pipeline_modules.question_generation package

Subpackages

Submodules

evalquiz_pipeline_server.evalquiz_config_iteration.internal_pipeline_modules.question_generation.message_composer module

class evalquiz_pipeline_server.evalquiz_config_iteration.internal_pipeline_modules.question_generation.message_composer.MessageComposer(course_settings: CourseSettings, generation_settings: GenerationSettings, max_previous_messages: int = 3)[source]

Bases: object

collect_few_shot_example_sources(few_shot_example_sources: defaultdict[int, defaultdict[str, str]]) list[collections.defaultdict[str, str]][source]
compose(question: Question, capabilites: list[evalquiz_proto.shared.generated.Capability], filtered_text: str, previous_messages: list[dict[str, str]]) list[dict[str, str]][source]
compose_capability_message(capabilites: list[evalquiz_proto.shared.generated.Capability]) str[source]
compose_few_shot_examples(question_type: QuestionType, previous_messages: list[dict[str, str]]) list[dict[str, str]][source]
compose_query_message(question: Question, capabilities: list[evalquiz_proto.shared.generated.Capability], filtered_text: str) dict[str, str][source]
compose_relevant_educational_objective_explanations(capabilites: list[evalquiz_proto.shared.generated.Capability]) str[source]
compose_system_message(capabilites: list[evalquiz_proto.shared.generated.Capability]) dict[str, str][source]
num_tokens_from_messages(messages: list[dict[str, str]], model: str = 'gpt-3.5-turbo-0301') int[source]

Source: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/chatgpt?pivots=programming-language-chat-completions, Accessed: 03.09.2023 Returns the number of tokens used by a list of messages.

property token_overhead: int

evalquiz_pipeline_server.evalquiz_config_iteration.internal_pipeline_modules.question_generation.question_generation module

Module contents