Expand description
§use-ai
AI interaction primitive facade for RustUse.
§Experimental
use-ai is experimental while the release line remains below 0.3.0.
§Example
use use_ai::{AiMessageRole, AiModelName, PromptName, ToolName};
let prompt = PromptName::new("support-triage")?;
let model = AiModelName::new("reasoning-chat")?;
let tool = ToolName::new("ticket-search")?;
assert_eq!(prompt.as_str(), "support-triage");
assert_eq!(model.value(), "reasoning-chat");
assert_eq!(tool.as_str(), "ticket-search");
assert_eq!(AiMessageRole::Assistant.as_str(), "assistant");§Scope
- Facade re-exports for focused AI interaction metadata crates.
- Prompt, message, context, role, model, provider, capability, tool-call, agent, reasoning, planning, RAG, memory, guardrail, and AI eval primitives.
§Relationship to use-ml
use-ai models AI interaction primitives: prompts, messages, roles, context
windows, tool calls, agents, RAG, reasoning, memory, guardrails, AI model
interfaces, and AI-specific evaluation.
use-ml models machine-learning primitives: datasets, features, labels,
tensors, model artifacts, training, inference, evaluation, metrics, pipelines,
embeddings, experiments, and model documentation.
These sets are siblings. They should interoperate conceptually but avoid dependency cycles.
§Non-goals
- Model calls, network calls, tool execution, retrieval, memory storage, guardrail enforcement, eval execution, or orchestration.
§License
Licensed under either Apache-2.0 or MIT.
Structs§
- AgentId
- Agent
Name - AiCapability
Name - AiContext
Citation - AiContext
Id - AiContext
Item Id - AiContext
Window - AiContext
Window Size - AiConversation
Id - AiEndpoint
Name - AiEval
Rubric Name - AiEval
RunId - AiEval
Score - AiMemory
Confidence - AiMemory
Id - AiMessage
Content Ref - AiMessage
Id - AiMessage
Token Count - AiModel
Context Window - AiModel
Family - AiModel
Id - AiModel
Name - AiModel
Output Limit - AiParticipant
Id - AiProvider
Id - AiProvider
Name - AiRole
Name - Guardrail
Id - Guardrail
Name - PlanId
- Plan
Name - Plan
Step Id - Prompt
Id - Prompt
Name - Prompt
Template - Prompt
Text - Prompt
Variable Name - RagChunk
Id - RagCorpus
Name - RagDocument
Id - Tool
Argument Name - Tool
Call Id - Tool
Name
Enums§
- Agent
Action Kind - Agent
Autonomy Level - Agent
Error - Agent
Handoff Kind - Agent
Kind - Agent
Loop Kind - Agent
Mode - Agent
Observation Kind - Agent
Status - AiApi
Mode - AiBilling
Unit - AiCapability
Error - AiCapability
Kind - AiCapability
Status - AiContext
Error - AiContext
FitStatus - AiContext
Item Kind - AiContext
Priority - AiContext
Source Kind - AiEndpoint
Kind - AiEval
Dataset Kind - AiEval
Error - AiEval
Failure Mode - AiEval
Judge Kind - AiEval
Kind - AiEval
Metric Kind - AiEval
Outcome - AiEval
Target Kind - AiGrounding
Status - AiInstruction
Authority - AiMemory
Capability - AiMemory
Conflict Kind - AiMemory
Error - AiMemory
Kind - AiMemory
Operation Kind - AiMemory
Retention Kind - AiMemory
Scope - AiMemory
Sensitivity - AiMemory
Source Kind - AiMemory
Status - AiMessage
Error - AiMessage
Format - AiMessage
Part Kind - AiMessage
Role - AiMessage
Source - AiMessage
Status - AiMessage
Visibility - AiModality
Support - AiModel
Deployment Kind - AiModel
Error - AiModel
Interface Kind - AiModel
Kind - AiModel
Lifecycle Stage - AiModel
Modality - AiModel
Reasoning Mode - AiParticipant
Kind - AiPersona
Kind - AiPrompt
Error - AiProvider
Error - AiProvider
Kind - AiQuota
Kind - AiRate
Limit Kind - AiReasoning
Capability - AiRegion
Kind - AiRole
Error - AiRole
Scope - AiRole
Status - AiSafety
Capability - AiStreaming
Support - AiStructured
Output Support - AiTool
UseSupport - Guardrail
Action - Guardrail
Check Kind - Guardrail
Error - Guardrail
Kind - Guardrail
Policy Area - Guardrail
Result Kind - Guardrail
Severity - Guardrail
Status - Guardrail
Violation Kind - Plan
Dependency Kind - Plan
Execution Mode - Plan
Priority - Plan
Review Status - Plan
Risk Kind - Plan
Status - Plan
Step Kind - Planning
Error - Prompt
Format - Prompt
Instruction Kind - Prompt
Part Kind - Prompt
Status - Prompt
Variable Kind - RagChunk
Kind - RagCitation
Kind - RagContext
Assembly Kind - RagError
- RagFreshness
Status - RagGrounding
Status - RagRanker
Kind - RagRetrieval
Mode - RagRetriever
Kind - Reasoning
Artifact Kind - Reasoning
Effort - Reasoning
Error - Reasoning
Error Kind - Reasoning
Mode - Reasoning
Step Kind - Reasoning
Strategy - Reasoning
Trace Status - Reasoning
Visibility - Tool
Argument Kind - Tool
Call Error - Tool
Call Error Kind - Tool
Call Kind - Tool
Call Status - Tool
Choice Kind - Tool
Result Kind - Tool
Schema Kind