Skip to main content

Crate agentkit_provider_groq

Crate agentkit_provider_groq 

Source
Expand description

Groq model adapter for the agentkit agent loop.

This crate provides GroqAdapter and GroqConfig for connecting the agent loop to the Groq chat completions API, which serves open-source models on custom LPU hardware. It is built on the generic agentkit_adapter_completions crate.

§Quick start

use agentkit_loop::{Agent, SessionConfig};
use agentkit_provider_groq::{GroqAdapter, GroqConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = GroqConfig::from_env()?;
    let adapter = GroqAdapter::new(config)?;

    let agent = Agent::builder()
        .model(adapter)
        .build()?;

    let mut driver = agent
        .start(SessionConfig::new("demo"))
        .await?;
    Ok(())
}

Structs§

GroqAdapter
Model adapter that connects the agentkit agent loop to Groq.
GroqConfig
Configuration for connecting to the Groq API.
GroqProvider
The Groq provider, implementing CompletionsProvider.
GroqRequestConfig
Request parameters serialized into the Groq request body.

Enums§

GroqError
Errors produced by the Groq adapter.

Type Aliases§

GroqSession
An active session with the Groq API.
GroqTurn
A completed turn from the Groq API.