-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/scripts/object_orientated_programming_poc/oop_poc_agent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
The purpose of this script is to demonstrate how to use the new OOP interface for Synapse AI Agents. | ||
1. Register and send a prompt to a custom agent | ||
2. Get a baseline agent instance and send a prompt to it | ||
""" | ||
|
||
from synapseclient import Synapse | ||
from synapseclient.models import Agent | ||
|
||
CLOUD_AGENT_ID = "my_agent_id" | ||
AGENT_REGISTRATION_ID = 123 | ||
|
||
syn = Synapse() | ||
syn.login() | ||
|
||
|
||
def register_and_send_prompt_to_custom_agent(): | ||
my_custom_agent = Agent(cloud_agent_id=CLOUD_AGENT_ID) | ||
my_custom_agent.register(synapse_client=syn) | ||
my_custom_agent.prompt(prompt="Hello, how are you?") | ||
|
||
|
||
def get_baseline_agent_and_send_prompt_to_it(): | ||
baseline_agent = Agent().get(synapse_client=syn) | ||
baseline_agent.prompt(prompt="Hello, how are you?") | ||
|
||
|
||
register_and_send_prompt_to_custom_agent() | ||
get_baseline_agent_and_send_prompt_to_it() |