-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
39 lines (31 loc) · 1.56 KB
/
example.py
File metadata and controls
39 lines (31 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from curaive import Curaive, PipelineConfig, Question, QuestionType, ReasoningTrack
config_internal = PipelineConfig.create_default(
reasoning_track=ReasoningTrack.INTERNAL, model="gpt-oss:20b-cloud", temperature=0.0
)
config_agentic = PipelineConfig.create_default(
reasoning_track=ReasoningTrack.AGENTIC, model="gpt-oss:20b-cloud", temperature=0.0
)
pipeline_internal = Curaive(config_internal)
pipeline_agentic = Curaive(config_agentic)
open_ended_question = Question(
id="oe_001",
question="What are the approved medications for hypertension in patients with diabetes?",
question_type=QuestionType.OPEN_ENDED,
options={},
)
multiple_choice_question = Question(
id="mc_001",
question="A 55-year-old with type 2 diabetes and hypertension. Which medication is first-line?",
question_type=QuestionType.MULTIPLE_CHOICE,
options={"A": "Lisinopril", "B": "Metoprolol", "C": "Hydrochlorothiazide", "D": "Amlodipine"},
)
result = pipeline_internal.answer_question(open_ended_question)
print(f"Internal track answer: {result.answer[:200]}...")
print(f"Tokens: {result.token_usage.total_tokens}\n")
result = pipeline_agentic.answer_question(open_ended_question)
print(f"Agentic track answer: {result.answer[:200]}...")
print(f"Briefing package: {result.briefing_package[:200] if result.briefing_package else 'None'}...")
print(f"Tokens: {result.total_token_usage.total_tokens}\n")
result = pipeline_internal.answer_question(multiple_choice_question)
print(f"Multiple choice selected: {result.extracted_answer}")
print(f"Reasoning: {result.reasoning[:200]}...")