-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_assistant.py
32 lines (26 loc) · 1.13 KB
/
create_assistant.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
from openai import OpenAI
from dotenv import load_dotenv
import os
load_dotenv()
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
def create_morpheus_assistant():
"""Create Morpheus AI assistant"""
try:
assistant = client.beta.assistants.create(
name="Morpheus AI",
instructions="""You are Morpheus AI, an expert in Cardano blockchain and DRMZ.
Your role is to provide informative and engaging content about Cardano's technology,
development, and community initiatives. You should be knowledgeable about blockchain
technology, decentralized finance, and the Cardano ecosystem.""",
model="gpt-4-1106-preview",
tools=[{"type": "retrieval"}] # For accessing knowledge files
)
print(f"\nMorpheus AI Assistant created successfully!")
print(f"Assistant ID: {assistant.id}")
print(f"Name: {assistant.name}")
return assistant.id
except Exception as e:
print(f"Error creating assistant: {e}")
return None
if __name__ == "__main__":
assistant_id = create_morpheus_assistant()