...
In the next section we will show how a Sager can create and use their own agents with a “hello world” example.
Creating a Custom Agent
Login to Sage LLM AWS account
The first step will be connecting to the AWS account where custom agents are deployed and managed.
Start by logging in with JumpCloud: https://console.jumpcloud.com/login
Select: aws-sso-organization
Select: org-sagebase-synapsellm-prod
Select: LlmDeveloper
From the top right corner, ensure you are in us-east-1 (N. Virginia)
If you do not see option for: org-sagebase-synapsellm-prod and LLMDevelop, please open an IT ticket to request access to the account.
Create a Hello-World Agent
We will be using CloudFormation to handle all of the details of creating an our hello-world bedrock agent.
...
Code Block | ||
---|---|---|
| ||
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "A simlesimple 'hello world' bedrock agent.", "Parameters": { "agentName": { "Description": "Provide a unique name for this bedrock agent.", "Type": "String", "AllowedPattern": "^([0-9a-zA-Z][_-]?){1,100}$" } }, "Resources": { "bedrockAgent": { "Type": "AWS::Bedrock::Agent", "Properties": { "AgentName": { "Ref": "agentName" }, "AgentResourceRoleArn": "arn:aws:iam::050451359079:role/bedrock-agent-role-bedrockAgentRole-uVdCv8WImmcJ", "AutoPrepare": true, "Description": "A simple 'hello world' bedrock agent that will reply with 'world' when given a 'hello'", "FoundationModel": "anthropic.claude-3-sonnet-20240229-v1:0", "IdleSessionTTLInSeconds": 3600, "Instruction": "You are a helpful test agent that when greeted with: 'hello' will always response with: 'world'", "SkipResourceInUseCheckOnDelete": true } } } } |
...
Create a token file that contains your personal access token with the following template:
Code Block language text Authorization: Bearer <paste youre personal access token here> Content-Type: application/json; charset=utf8
Open a command prompt with access to curl and setup the following:
Code Block curl -X PUT 'https://repo-prod.prod.sagebase.org/repo/v1/agent/registration' \ -H @C:/Users/John/.synapse/non-admin-token.txt \ -H "Content-Type: application/json; charset=utf8" \ --data-raw '{"awsAgentId":"I6DE8ZTR25"}'
You will need to replace:
C:/Users/John/.synapse/non-admin-token.txt
with the path to the token file you created in step 1.You will also need to replace the awsAgetnId with your own agent ID from step 17. of the previous section.
Once curl command is setup correctly, pres enter to execute it. If successful you should receive a response similar to:
Code Block language json {"agentRegistrationId":"9","awsAgentId":"I6DE8ZTR25","awsAliasId":"TSTALIASID","registeredOn":"2024-11-15T02:27:18.846Z","type":"CUSTOM"}
Make sure that resulting awsAgentId matches your agent’s ID, and record the resulting agentRegistrationId.
Now that we have an agent registration ID for our new agent we can test our agent in production using the following URL (replace the '9' with the agentrRegistrationId you received in step 5):
Code Block https://www.synapse.org/Chat:initialMessage=hello&agentRegistrationId=9
...
Congratulations! At this point you have successfully created your new hello-world agent and successfully registered it with Synapse. Finally, by providing your agent registration ID in the UI, you should have successfully started a new conversation with your agent in production Synapse!
...