Skip to content

Commit

Permalink
Merge pull request #25 from AryaanSheth/13-enum-type-for-models
Browse files Browse the repository at this point in the history
Added View Models Wrapper
  • Loading branch information
AryaanSheth authored Sep 9, 2024
2 parents 285eed3 + 50da3d7 commit d8e9686
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
13 changes: 13 additions & 0 deletions src/gloq.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d8e9686

Please sign in to comment.