gloq

Types

pub type GroqRequestBuilder {
  GroqRequestBuilder(
    key: String,
    user: String,
    context: String,
    model: String,
  )
}

Constructors

  • GroqRequestBuilder(
      key: String,
      user: String,
      context: String,
      model: String,
    )

Functions

pub fn build(builder: GroqRequestBuilder) -> Request(String)

Builds the request body for the GroqCloud API that can be sent using the appropriate HTTP client.

pub fn default_groq_request() -> GroqRequestBuilder

Creates a new GroqRequestBuilder with default model and user values.

pub fn new_groq_request() -> GroqRequestBuilder

Create a new GroqRequestBuilder with no default values.

pub fn send(builder: GroqRequestBuilder) -> String

Sends the request to the GroqCloud API for chat completions.

Function is deprecated, send logic is left to consumer To create a request, use the build function and send the request using the appropriate HTTP client of your choice. Uses the hackney HTTP client to send the request, this command is no longer supported.

pub fn view_models(api_key: String) -> Request(String)

Builds the request body for the GroqCloud API that can be sent using the appropriate HTTP client.

pub fn with_context(
  builder: GroqRequestBuilder,
  context: String,
) -> GroqRequestBuilder

Sets the context/prompt for the GroqRequestBuilder.

pub fn with_key(
  builder: GroqRequestBuilder,
  key: String,
) -> GroqRequestBuilder

Enum of all models available for the GroqRequestBuilder. Sets the API key for the GroqRequestBuilder.

pub fn with_model(
  builder: GroqRequestBuilder,
  model: String,
) -> GroqRequestBuilder

Sets the model for the GroqRequestBuilder.

pub fn with_user(
  builder: GroqRequestBuilder,
  user: String,
) -> GroqRequestBuilder

Sets the user role for the GroqRequestBuilder.

Search Document