forked from rungalileo/sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp-simple.py
More file actions
36 lines (32 loc) · 1.03 KB
/
Copy pathapp-simple.py
File metadata and controls
36 lines (32 loc) · 1.03 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
from galileo import Message, MessageRole
from galileo.prompts import get_prompt, create_prompt
from galileo.experiments import run_experiment
from galileo.datasets import get_dataset
from dotenv import load_dotenv
load_dotenv()
project = "datasets-experiments"
prompt = get_prompt(name="geography-prompt")
if prompt is None:
prompt = create_prompt(
name="geography-prompt",
template=[
Message(
role=MessageRole.system,
content="You are a helpful assistant. Answer questions accurately and concisely.",
),
Message(role=MessageRole.user, content="{{input}}"),
],
)
results = run_experiment(
"geography-experiment",
dataset=get_dataset(name="countries"),
prompt_template=prompt,
# Optional
prompt_settings={
"max_tokens": 256,
"model_alias": "GPT-4o", # Make sure you have an integration set up for the model alias you're using
"temperature": 0.8,
},
metrics=["correctness"],
project=project,
)