swiftide-integrations 0.34.0

Composable LLM agents, typed task graphs, and streaming RAG pipelines in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde_json::Value;
use swiftide_core::chat_completion::{ToolSpec, ToolSpecError};

pub(super) struct AwsBedrockToolSchema(Value);

impl AwsBedrockToolSchema {
    pub(super) fn into_value(self) -> Value {
        self.0
    }
}

impl TryFrom<&ToolSpec> for AwsBedrockToolSchema {
    type Error = ToolSpecError;

    fn try_from(spec: &ToolSpec) -> Result<Self, Self::Error> {
        Ok(Self(spec.canonical_parameters_schema_json()?))
    }
}