from julep import Julep
# Initialize the Julep client
julep = Julep(api_key="your_api_key")
# Create an agent
agent = julep.agents.create(
name="Chat Buddy",
about="A friendly and helpful chatbot",
instructions=[
"Be friendly and engaging.",
"Be helpful and provide useful information.",
"Be concise and to the point.",
"Do not format your responses. Keep them as plain text.",
],
model="gpt-4o-mini",
)
# Create a session
session = julep.sessions.create(
agent=agent.id,
situation="User wants to have a casual chat about hobbies.",
)
# Chat with the agent
response = julep.sessions.chat(
session_id=session.id,
messages=[
{
"role": "user",
"content": "Hi there! What are some fun hobbies to try out?"
}
]
)