MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / test_agent_creation

Function test_agent_creation

tests/rust_unit_tests/agent_tests.rs:90–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88#[tokio::test]
89#[ignore = "Requires OpenAI API key (set OPENAI_API_KEY environment variable to run)"]
90async fn test_agent_creation() {
91 let _agent_id = AgentId::new();
92 let llm_config = LlmConfig::OpenAI {
93 api_key: std::env::var("OPENAI_API_KEY").unwrap(),
94 model: "gpt-3.5-turbo".to_string(),
95 base_url: None,
96 organization: None,
97 };
98
99 let agent = AgentBuilder::new("test_agent", llm_config)
100 .description("A test agent")
101 .capabilities(vec![
102 AgentCapability::TextProcessing,
103 AgentCapability::DataAnalysis,
104 ])
105 .build()
106 .await
107 .unwrap();
108
109 assert_eq!(agent.config().name, "test_agent");
110 assert_eq!(agent.config().description, "A test agent");
111 assert!(agent.has_capability(&AgentCapability::TextProcessing));
112 assert!(agent.has_capability(&AgentCapability::DataAnalysis));
113}
114
115#[tokio::test]
116#[ignore = "Requires OpenAI API key (set OPENAI_API_KEY environment variable to run)"]

Callers

nothing calls this directly

Calls 4

to_stringMethod · 0.80
buildMethod · 0.45
capabilitiesMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected