diff --git a/gleam.toml b/gleam.toml index ac68627..d9201f2 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,5 +1,5 @@ name = "gloq" -version = "1.2.2" +version = "1.3.2" # Fill out these fields if you intend to generate HTML documentation or publish # your project to the Hex package manager. diff --git a/src/gloq.gleam b/src/gloq.gleam index 61e8fe9..e96c116 100644 --- a/src/gloq.gleam +++ b/src/gloq.gleam @@ -98,3 +98,16 @@ pub fn send(builder: GroqRequestBuilder) -> String { Error(_) -> "Error, Request Failed" } } + +/// Builds the request body for the GroqCloud API that can be sent using the appropriate HTTP client. +pub fn view_models(api_key: String) { + let request = + request.new() + |> request.set_method(http.Get) + |> request.set_host("api.groq.com") + |> request.set_path("/openai/v1/models") + |> request.set_header("Authorization", "Bearer " <> api_key) + |> request.set_header("Content-Type", "application/json") + + request +}