-
Notifications
You must be signed in to change notification settings - Fork 54
/
cookbook.py
52 lines (44 loc) · 1.49 KB
/
cookbook.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
from sentient import sentient
import asyncio
custom_instructions = """
1. Directly go to youtube.com rather than searching for the song on google!
"""
# #use with open ai
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="openai",
model="gpt-4o-2024-08-06"))
# #use with together ai
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="together",
model="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"))
# #use with ollama
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="ollama",
model="llama3"))
#using anthropic
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="anthropic",
model="claude-3-5-sonnet-20240620"))
# use with groq models
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="groq",
model="llama-3.1-70b-versatile"))
#using a custom endpoint (like remotely hosted vLLM/ ollama servers)
#endpoint must be openai compatible
result = asyncio.run(sentient.invoke(
goal="play shape of you on youtube",
task_instructions=custom_instructions,
provider="custom",
custom_base_url="http://localhost:8080/v1",
model="llama3.1"))
print(result)