(&self, message: AgentMessage)
| 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) |
nothing calls this directly
no test coverage detected