8000 GitHub - halllo/AgentDo: Light-weight function-calling abstraction.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

halllo/AgentDo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentDo

Light-weight function-calling abstraction.

Setup the Amazon Bedrock Runtime and the BedrockAgent:

services.AddSingleton<IAmazonBedrockRuntime>(sp =>
{
	return new AmazonBedrockRuntimeClient(
		awsAccessKeyId: config["AWSBedrockAccessKeyId"]!,
		awsSecretAccessKey: config["AWSBedrockSecretAccessKey"]!,
		region: Amazon.RegionEndpoint.GetBySystemName(config["AWSBedrockRegion"]!));
});

services.AddKeyedSingleton<IAgent, BedrockAgent>("bedrock");
services.Configure<BedrockAgentOptions>(o =>
{
	o.ModelId = "anthropic.claude-3-5-sonnet-20240620-v1:0";
});

Now you can get the agent injected and start it with agent.Do(...) by passing in the task and tools.

public async Task StartAgent([FromKeyedServices("bedrock")] IAgent agent)
{
	await agent.Do(
		task: "Get the most popular song played on a radio station RGBG and rate it as bad.",
		tools:
		[
			Tool.From([Description("Get radio song")]
				([Description("The call sign for the radio station for which you want the most popular song."), Required] string sign)
				=> new { songName = "Random Song 1" }),

			Tool.From([Description("Rate a song")]
				(string song, string rating)
				=> "Rated!"),
		]);
}

About

Light-weight function-calling abstraction.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0