MCPcopy Index your code
hub / github.com/InfinitiBit/graphbit / execute

Method execute

core/src/agents.rs:237–248  ·  view source on GitHub ↗
(&self, message: AgentMessage)

Source from the content-addressed store, hash-verified

235 }
236
237 async fn execute(&self, message: AgentMessage) -> GraphBitResult<serde_json::Value> {
238 let request = self.build_llm_request(&message);
239
240 let response = self.llm_provider.complete(request).await?;
241
242 // Try to parse response as JSON, fallback to string
243 if let Ok(json_value) = serde_json::from_str::<serde_json::Value>(&response.content) {
244 Ok(json_value)
245 } else {
246 Ok(serde_json::Value::String(response.content))
247 }
248 }
249
250 async fn validate_output(&self, output: &str, schema: &serde_json::Value) -> ValidationResult {
251 self.validator.validate_against_schema(output, schema)

Callers

nothing calls this directly

Calls 2

build_llm_requestMethod · 0.80
completeMethod · 0.45

Tested by

no test coverage detected