{"id":19744535,"url":"https://github.com/conneroisu/groq-go","last_synced_at":"2025-04-30T07:33:24.083Z","repository":{"id":234965575,"uuid":"789809088","full_name":"conneroisu/groq-go","owner":"conneroisu","description":"client package for interacting with language models avaliable on the groq api with numerous integrations: composio, toolhouse, jigsawstack, e2b, and more.","archived":false,"fork":false,"pushed_at":"2025-02-05T16:11:31.000Z","size":5145,"stargazers_count":12,"open_issues_count":12,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T23:51:13.727Z","etag":null,"topics":["ai","chat-model","chat-moderation","composio","cross-platform","e2b","golang","golang-package","groq","groq-ai-api","groq-api","jigsawstack","jsonschema","jsonschema-generator","language-model","llm","package","toolhouse","transcription"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conneroisu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-21T16:02:12.000Z","updated_at":"2025-03-13T16:30:17.000Z","dependencies_parsed_at":"2024-04-21T22:08:40.091Z","dependency_job_id":"814a6ffb-49e1-48fd-9124-dff5507a55a7","html_url":"https://github.com/conneroisu/groq-go","commit_stats":null,"previous_names":["conneroisu/go-groq","conneroisu/groq-go"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conneroisu%2Fgroq-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conneroisu%2Fgroq-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conneroisu%2Fgroq-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conneroisu%2Fgroq-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conneroisu","download_url":"https://codeload.github.com/conneroisu/groq-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251660916,"owners_count":21623337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat-model","chat-moderation","composio","cross-platform","e2b","golang","golang-package","groq","groq-ai-api","groq-api","jigsawstack","jsonschema","jsonschema-generator","language-model","llm","package","toolhouse","transcription"],"created_at":"2024-11-12T02:00:39.747Z","updated_at":"2025-04-30T07:33:24.076Z","avatar_url":"https://github.com/conneroisu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# groq-go\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/conneroisu/groq-go.svg)](https://pkg.go.dev/github.com/conneroisu/groq-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/conneroisu/groq-go)](https://goreportcard.com/report/github.com/conneroisu/groq-go)\n[![Coverage Status](https://coveralls.io/repos/github/conneroisu/groq-go/badge.svg?branch=main)](https://coveralls.io/github/conneroisu/groq-go?branch=main)\n[![PhormAI](https://img.shields.io/badge/Phorm-Ask_AI-%23F2777A.svg?\u0026logo=data:image/svg+xml)](https://www.phorm.ai/query?projectId=0634251d-5a98-4c37-ac2f-385b588ce3d3)\n\n## Features\n\n- Supports all models from [Groq](https://wow.groq.com/) in a type-safe way.\n- Supports streaming.\n- Supports moderation.\n- Supports audio transcription.\n- Supports audio translation.\n- Supports Tool Use.\n- Supports Function Calling.\n- JSON Schema Generation from structs.\n- Supports [Toolhouse](https://app.toolhouse.ai/) function calling. [Extention](https://github.com/conneroisu/groq-go/tree/main/extensions/toolhouse)\n- Supports [E2b](https://e2b.dev/) function calling. [Extention](https://github.com/conneroisu/groq-go/tree/main/extensions/e2b)\n- Supports [Composio](https://composio.dev/) function calling. [Extention](https://github.com/conneroisu/groq-go/tree/main/extensions/composio)\n- Supports [Jigsaw Stack](https://jigsawstack.com/) function calling. [Extention](https://github.com/conneroisu/groq-go/tree/main/extensions/jigsawstack)\n\n## Installation\n\n```bash\ngo get github.com/conneroisu/groq-go\n```\n\n## Examples\n\nFor introductory examples, see the [examples](https://github.com/conneroisu/groq-go/tree/main/examples) directory.\n\n- [audio](/examples/audio-lex-fridman)\n- [json](/examples/json-chat)\n- [moderation](/examples/moderation)\n- [Use llava-v1.5-7b-4096-preview to talks about images](/examples/llava-blind)\n- [Chat with a terminal using groq-go](/examples/terminal-chat)\n- [Document VHDL files using groq-go](/examples/vhdl-documentor-json)\n- [Execute generated python code using Toolhouse and groq-go](/examples/toolhouse-python-code-interpreter)\n- [Star a Github Repository using Composio and groq-go](/examples/composio-github-star)\n\nExternal Repositories using groq-go:\n- [Automatic Git Commit Message Generator](https://github.com/conneroisu/gita)\n\n\n## Development\n\nThis project uses [devenv](https://devenv.sh) for development. Make sure you have it installed.\n\nTo start development:\n\n```bash\ndirenv allow\n```\n\nTo run tests:\n\n```bash\ntest\n```\n\nIf you fork the repository, you should set up the following environment variables in ci/cd:\n\n```bash\nexport E2B_API_KEY=your-e2b-api-key\nexport GROQ_KEY=your-groq-key\nexport TOOLHOUSE_API_KEY=your-toolhouse-api-key\n```\n\n## Documentation\n\nThe following documentation is generated from the source code using [gomarkdoc](https://github.com/princjef/gomarkdoc).\n\n\u003c!-- gomarkdoc:embed:start --\u003e\n\n\u003c!-- Code generated by gomarkdoc. DO NOT EDIT --\u003e\n\n# groq\n\n```go\nimport \"github.com/conneroisu/groq-go\"\n```\n\nPackage groq provides a unofficial client for the Groq API.\n\nWith specially designed hardware, the Groq API is a super fast way to query open source llms.\n\nAPI Documentation: https://console.groq.com/docs/quickstart\n\n## Index\n\n- [Constants](\u003c#constants\u003e)\n- [Variables](\u003c#variables\u003e)\n- [type AudioModel](\u003c#AudioModel\u003e)\n- [type AudioRequest](\u003c#AudioRequest\u003e)\n- [type AudioResponse](\u003c#AudioResponse\u003e)\n  - [func \\(r \\*AudioResponse\\) SetHeader\\(header http.Header\\)](\u003c#AudioResponse.SetHeader\u003e)\n- [type ChatCompletionChoice](\u003c#ChatCompletionChoice\u003e)\n- [type ChatCompletionMessage](\u003c#ChatCompletionMessage\u003e)\n  - [func \\(m ChatCompletionMessage\\) MarshalJSON\\(\\) \\(\\[\\]byte, error\\)](\u003c#ChatCompletionMessage.MarshalJSON\u003e)\n  - [func \\(m \\*ChatCompletionMessage\\) UnmarshalJSON\\(bs \\[\\]byte\\) \\(err error\\)](\u003c#ChatCompletionMessage.UnmarshalJSON\u003e)\n- [type ChatCompletionRequest](\u003c#ChatCompletionRequest\u003e)\n- [type ChatCompletionResponse](\u003c#ChatCompletionResponse\u003e)\n  - [func \\(r \\*ChatCompletionResponse\\) SetHeader\\(h http.Header\\)](\u003c#ChatCompletionResponse.SetHeader\u003e)\n- [type ChatCompletionResponseFormat](\u003c#ChatCompletionResponseFormat\u003e)\n- [type ChatCompletionResponseFormatJSONSchema](\u003c#ChatCompletionResponseFormatJSONSchema\u003e)\n- [type ChatCompletionStream](\u003c#ChatCompletionStream\u003e)\n- [type ChatCompletionStreamChoice](\u003c#ChatCompletionStreamChoice\u003e)\n- [type ChatCompletionStreamChoiceDelta](\u003c#ChatCompletionStreamChoiceDelta\u003e)\n- [type ChatCompletionStreamResponse](\u003c#ChatCompletionStreamResponse\u003e)\n- [type ChatMessageImageURL](\u003c#ChatMessageImageURL\u003e)\n- [type ChatMessagePart](\u003c#ChatMessagePart\u003e)\n- [type ChatMessagePartType](\u003c#ChatMessagePartType\u003e)\n- [type ChatModel](\u003c#ChatModel\u003e)\n- [type Client](\u003c#Client\u003e)\n  - [func NewClient\\(groqAPIKey string, opts ...Opts\\) \\(\\*Client, error\\)](\u003c#NewClient\u003e)\n  - [func \\(c \\*Client\\) ChatCompletion\\(ctx context.Context, request ChatCompletionRequest\\) \\(response ChatCompletionResponse, err error\\)](\u003c#Client.ChatCompletion\u003e)\n  - [func \\(c \\*Client\\) ChatCompletionJSON\\(ctx context.Context, request ChatCompletionRequest, output any\\) \\(err error\\)](\u003c#Client.ChatCompletionJSON\u003e)\n  - [func \\(c \\*Client\\) ChatCompletionStream\\(ctx context.Context, request ChatCompletionRequest\\) \\(stream \\*ChatCompletionStream, err error\\)](\u003c#Client.ChatCompletionStream\u003e)\n  - [func \\(c \\*Client\\) Moderate\\(ctx context.Context, messages \\[\\]ChatCompletionMessage, model ModerationModel\\) \\(response \\[\\]Moderation, err error\\)](\u003c#Client.Moderate\u003e)\n  - [func \\(c \\*Client\\) Transcribe\\(ctx context.Context, request AudioRequest\\) \\(AudioResponse, error\\)](\u003c#Client.Transcribe\u003e)\n  - [func \\(c \\*Client\\) Translate\\(ctx context.Context, request AudioRequest\\) \\(AudioResponse, error\\)](\u003c#Client.Translate\u003e)\n- [type FinishReason](\u003c#FinishReason\u003e)\n  - [func \\(r FinishReason\\) MarshalJSON\\(\\) \\(\\[\\]byte, error\\)](\u003c#FinishReason.MarshalJSON\u003e)\n- [type Format](\u003c#Format\u003e)\n- [type ImageURLDetail](\u003c#ImageURLDetail\u003e)\n- [type LogProbs](\u003c#LogProbs\u003e)\n- [type Model](\u003c#Model\u003e)\n- [type Moderation](\u003c#Moderation\u003e)\n- [type ModerationModel](\u003c#ModerationModel\u003e)\n- [type Opts](\u003c#Opts\u003e)\n  - [func WithBaseURL\\(baseURL string\\) Opts](\u003c#WithBaseURL\u003e)\n  - [func WithClient\\(client \\*http.Client\\) Opts](\u003c#WithClient\u003e)\n  - [func WithLogger\\(logger \\*slog.Logger\\) Opts](\u003c#WithLogger\u003e)\n- [type PromptAnnotation](\u003c#PromptAnnotation\u003e)\n- [type Role](\u003c#Role\u003e)\n- [type Segments](\u003c#Segments\u003e)\n- [type StreamOptions](\u003c#StreamOptions\u003e)\n- [type TopLogProbs](\u003c#TopLogProbs\u003e)\n- [type TranscriptionTimestampGranularity](\u003c#TranscriptionTimestampGranularity\u003e)\n- [type Usage](\u003c#Usage\u003e)\n- [type Words](\u003c#Words\u003e)\n\n\n## Constants\n\n\u003ca name=\"RoleSystem\"\u003e\u003c/a\u003e\n\n```go\nconst (\n    // RoleSystem is the system chat message role.\n    RoleSystem Role = \"system\"\n    // RoleUser is the user chat message role.\n    RoleUser Role = \"user\"\n    // RoleAssistant is the assistant chat message role.\n    RoleAssistant Role = \"assistant\"\n    // RoleFunction is the function chat message role.\n    RoleFunction Role = \"function\"\n    // RoleTool is the tool chat message role.\n    RoleTool Role = \"tool\"\n\n    // ImageURLDetailHigh is the high image url detail.\n    ImageURLDetailHigh ImageURLDetail = \"high\"\n    // ImageURLDetailLow is the low image url detail.\n    ImageURLDetailLow ImageURLDetail = \"low\"\n    // ImageURLDetailAuto is the auto image url detail.\n    ImageURLDetailAuto ImageURLDetail = \"auto\"\n\n    // ChatMessagePartTypeText is the text chat message part type.\n    ChatMessagePartTypeText ChatMessagePartType = \"text\"\n    // ChatMessagePartTypeImageURL is the image url chat message part type.\n    ChatMessagePartTypeImageURL ChatMessagePartType = \"image_url\"\n)\n```\n\n## Variables\n\n\u003ca name=\"ModelGemma29BIt\"\u003e\u003c/a\u003e\n\n```go\nvar (\n    // ModelGemma29BIt is an AI text chat model.\n    //\n    // It is created/provided by Google.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelGemma29BIt ChatModel = \"gemma2-9b-it\"\n    // ModelGemma7BIt is an AI text chat model.\n    //\n    // It is created/provided by Google.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelGemma7BIt ChatModel = \"gemma-7b-it\"\n    // ModelLlama3170BVersatile is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 32768 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3170BVersatile ChatModel = \"llama-3.1-70b-versatile\"\n    // ModelLlama318BInstant is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 131072 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama318BInstant ChatModel = \"llama-3.1-8b-instant\"\n    // ModelLlama3211BVisionPreview is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3211BVisionPreview ChatModel = \"llama-3.2-11b-vision-preview\"\n    // ModelLlama321BPreview is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama321BPreview ChatModel = \"llama-3.2-1b-preview\"\n    // ModelLlama323BPreview is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama323BPreview ChatModel = \"llama-3.2-3b-preview\"\n    // ModelLlama3290BVisionPreview is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3290BVisionPreview ChatModel = \"llama-3.2-90b-vision-preview\"\n    // ModelLlama3370BSpecdec is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3370BSpecdec ChatModel = \"llama-3.3-70b-specdec\"\n    // ModelLlama3370BVersatile is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 32768 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3370BVersatile ChatModel = \"llama-3.3-70b-versatile\"\n    // ModelLlama370B8192 is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama370B8192 ChatModel = \"llama3-70b-8192\"\n    // ModelLlama38B8192 is an AI text chat model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama38B8192 ChatModel = \"llama3-8b-8192\"\n    // ModelLlama3Groq70B8192ToolUsePreview is an AI text chat model.\n    //\n    // It is created/provided by Groq.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3Groq70B8192ToolUsePreview ChatModel = \"llama3-groq-70b-8192-tool-use-preview\"\n    // ModelLlama3Groq8B8192ToolUsePreview is an AI text chat model.\n    //\n    // It is created/provided by Groq.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelLlama3Groq8B8192ToolUsePreview ChatModel = \"llama3-groq-8b-8192-tool-use-preview\"\n    // ModelMixtral8X7B32768 is an AI text chat model.\n    //\n    // It is created/provided by Mistral AI.\n    //\n    // It has 32768 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- ChatCompletion\n    // \t- ChatCompletionStream\n    // \t- ChatCompletionJSON\n    ModelMixtral8X7B32768 ChatModel = \"mixtral-8x7b-32768\"\n    // ModelDistilWhisperLargeV3En is an AI audio transcription model.\n    //\n    // It is created/provided by Hugging Face.\n    //\n    // It has 448 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- CreateTranscription\n    // \t- CreateTranslation\n    ModelDistilWhisperLargeV3En AudioModel = \"distil-whisper-large-v3-en\"\n    // ModelWhisperLargeV3 is an AI audio transcription model.\n    //\n    // It is created/provided by OpenAI.\n    //\n    // It has 448 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- CreateTranscription\n    // \t- CreateTranslation\n    ModelWhisperLargeV3 AudioModel = \"whisper-large-v3\"\n    // ModelWhisperLargeV3Turbo is an AI audio transcription model.\n    //\n    // It is created/provided by OpenAI.\n    //\n    // It has 448 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- CreateTranscription\n    // \t- CreateTranslation\n    ModelWhisperLargeV3Turbo AudioModel = \"whisper-large-v3-turbo\"\n    // ModelLlamaGuard38B is an AI moderation model.\n    //\n    // It is created/provided by Meta.\n    //\n    // It has 8192 context window.\n    //\n    // It can be used with the following client methods:\n    //\t- Moderate\n    ModelLlamaGuard38B ModerationModel = \"llama-guard-3-8b\"\n)\n```\n\n\u003ca name=\"AudioModel\"\u003e\u003c/a\u003e\n## type [AudioModel](\u003chttps://github.com/conneroisu/groq-go/blob/main/models.go#L20\u003e)\n\nAudioModel is the type for audio models present on the groq api.\n\n```go\ntype AudioModel Model\n```\n\n\u003ca name=\"AudioRequest\"\u003e\u003c/a\u003e\n## type [AudioRequest](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L498-L516\u003e)\n\nAudioRequest represents a request structure for audio API.\n\n```go\ntype AudioRequest struct {\n    // Model is the model to use for the transcription.\n    Model AudioModel\n    // FilePath is either an existing file in your filesystem or a\n    // filename representing the contents of Reader.\n    FilePath string\n    // Reader is an optional io.Reader when you do not want to use\n    // an existing file.\n    Reader io.Reader\n    // Prompt is the prompt for the transcription.\n    Prompt string\n    // Temperature is the temperature for the transcription.\n    Temperature float32\n    // Language is the language for the transcription. Only for\n    // transcription.\n    Language string\n    // Format is the format for the response.\n    Format Format\n}\n```\n\n\u003ca name=\"AudioResponse\"\u003e\u003c/a\u003e\n## type [AudioResponse](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L518-L533\u003e)\n\nAudioResponse represents a response structure for audio API.\n\n```go\ntype AudioResponse struct {\n    // Task is the task of the response.\n    Task string `json:\"task\"`\n    // Language is the language of the response.\n    Language string `json:\"language\"`\n    // Duration is the duration of the response.\n    Duration float64 `json:\"duration\"`\n    // Segments is the segments of the response.\n    Segments Segments `json:\"segments\"`\n    // Words is the words of the response.\n    Words Words `json:\"words\"`\n    // Text is the text of the response.\n    Text string `json:\"text\"`\n\n    Header http.Header // Header is the header of the response.\n}\n```\n\n\u003ca name=\"AudioResponse.SetHeader\"\u003e\u003c/a\u003e\n### func \\(\\*AudioResponse\\) [SetHeader](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L580\u003e)\n\n```go\nfunc (r *AudioResponse) SetHeader(header http.Header)\n```\n\nSetHeader sets the header of the response.\n\n\u003ca name=\"ChatCompletionChoice\"\u003e\u003c/a\u003e\n## type [ChatCompletionChoice](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L192-L203\u003e)\n\nChatCompletionChoice represents the chat completion choice.\n\n```go\ntype ChatCompletionChoice struct {\n    Index int `json:\"index\"` // Index is the index of the choice.\n    // Message is the chat completion message of the choice.\n    Message ChatCompletionMessage `json:\"message\"`\n    // FinishReason is the finish reason of the choice.\n    FinishReason FinishReason `json:\"finish_reason\"`\n    // LogProbs is the log probs of the choice.\n    //\n    // This is basically the probability of the model choosing the\n    // token.\n    LogProbs *LogProbs `json:\"logprobs,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatCompletionMessage\"\u003e\u003c/a\u003e\n## type [ChatCompletionMessage](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L53-L74\u003e)\n\nChatCompletionMessage represents the chat completion message.\n\n```go\ntype ChatCompletionMessage struct {\n    // Name is the name of the chat completion message.\n    Name string `json:\"name\"`\n    // Role is the role of the chat completion message.\n    Role Role `json:\"role\"`\n    // Content is the content of the chat completion message.\n    Content string `json:\"content\"`\n    // MultiContent is the multi content of the chat completion\n    // message.\n    MultiContent []ChatMessagePart `json:\"-\"`\n    // FunctionCall setting for Role=assistant prompts this may be\n    // set to the function call generated by the model.\n    FunctionCall *tools.FunctionCall `json:\"function_call,omitempty\"`\n    // ToolCalls setting for Role=assistant prompts this may be set\n    // to the tool calls generated by the model, such as function\n    // calls.\n    ToolCalls []tools.ToolCall `json:\"tool_calls,omitempty\"`\n    // ToolCallID is setting for Role=tool prompts this should be\n    // set to the ID given in the assistant's prior request to call\n    // a tool.\n    ToolCallID string `json:\"tool_call_id,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatCompletionMessage.MarshalJSON\"\u003e\u003c/a\u003e\n### func \\(ChatCompletionMessage\\) [MarshalJSON](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L356\u003e)\n\n```go\nfunc (m ChatCompletionMessage) MarshalJSON() ([]byte, error)\n```\n\nMarshalJSON method implements the json.Marshaler interface.\n\nIt exists to allow for the use of the multi\\-part content field.\n\n\u003ca name=\"ChatCompletionMessage.UnmarshalJSON\"\u003e\u003c/a\u003e\n### func \\(\\*ChatCompletionMessage\\) [UnmarshalJSON](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L387\u003e)\n\n```go\nfunc (m *ChatCompletionMessage) UnmarshalJSON(bs []byte) (err error)\n```\n\nUnmarshalJSON method implements the json.Unmarshaler interface.\n\nIt exists to allow for the use of the multi\\-part content field.\n\n\u003ca name=\"ChatCompletionRequest\"\u003e\u003c/a\u003e\n## type [ChatCompletionRequest](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L103-L163\u003e)\n\nChatCompletionRequest represents a request structure for the chat completion API.\n\n```go\ntype ChatCompletionRequest struct {\n    // Model is the model of the chat completion request.\n    Model ChatModel `json:\"model\"`\n    // Messages is the messages of the chat completion request.\n    //\n    // These act as the prompt for the model.\n    Messages []ChatCompletionMessage `json:\"messages\"`\n    // MaxTokens is the max tokens of the chat completion request.\n    MaxTokens int `json:\"max_tokens,omitempty\"`\n    // Temperature is the temperature of the chat completion\n    // request.\n    Temperature float32 `json:\"temperature,omitempty\"`\n    // TopP is the top p of the chat completion request.\n    TopP float32 `json:\"top_p,omitempty\"`\n    // N is the n of the chat completion request.\n    N   int `json:\"n,omitempty\"`\n    // Stream is the stream of the chat completion request.\n    Stream bool `json:\"stream,omitempty\"`\n    // Stop is the stop of the chat completion request.\n    Stop []string `json:\"stop,omitempty\"`\n    // PresencePenalty is the presence penalty of the chat\n    // completion request.\n    PresencePenalty float32 `json:\"presence_penalty,omitempty\"`\n    // ResponseFormat is the response format of the chat completion\n    // request.\n    ResponseFormat *ChatCompletionResponseFormat `json:\"response_format,omitempty\"`\n    // Seed is the seed of the chat completion request.\n    Seed *int `json:\"seed,omitempty\"`\n    // FrequencyPenalty is the frequency penalty of the chat\n    // completion request.\n    FrequencyPenalty float32 `json:\"frequency_penalty,omitempty\"`\n    // LogitBias is must be a token id string (specified by their\n    // token ID in the tokenizer), not a word string.\n    // incorrect: `\"logit_bias\":{ \"You\": 6}`, correct: `\"logit_bias\":{\"1639\": 6}`\n    // refs: https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias\n    LogitBias map[string]int `json:\"logit_bias,omitempty\"`\n    // LogProbs indicates whether to return log probabilities of the\n    // output tokens or not. If true, returns the log probabilities\n    // of each output token returned in the content of message.\n    //\n    // This option is currently not available on the\n    // gpt-4-vision-preview model.\n    LogProbs bool `json:\"logprobs,omitempty\"`\n    // TopLogProbs is an integer between 0 and 5 specifying the\n    // number of most likely tokens to return at each token\n    // position, each with an associated log probability. Logprobs\n    // must be set to true if this parameter is used.\n    TopLogProbs int `json:\"top_logprobs,omitempty\"`\n    // User is the user of the chat completion request.\n    User string `json:\"user,omitempty\"`\n    // Tools is the tools of the chat completion request.\n    Tools []tools.Tool `json:\"tools,omitempty\"`\n    // This can be either a string or an ToolChoice object.\n    ToolChoice any `json:\"tool_choice,omitempty\"`\n    // Options for streaming response. Only set this when you set stream: true.\n    StreamOptions *StreamOptions `json:\"stream_options,omitempty\"`\n    // Disable the default behavior of parallel tool calls by setting it: false.\n    ParallelToolCalls any `json:\"parallel_tool_calls,omitempty\"`\n    // RetryDelay is the delay between retries.\n    RetryDelay time.Duration `json:\"-\"`\n}\n```\n\n\u003ca name=\"ChatCompletionResponse\"\u003e\u003c/a\u003e\n## type [ChatCompletionResponse](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L206-L223\u003e)\n\nChatCompletionResponse represents a response structure for chat completion API.\n\n```go\ntype ChatCompletionResponse struct {\n    // ID is the id of the response.\n    ID  string `json:\"id\"`\n    // Object is the object of the response.\n    Object string `json:\"object\"`\n    // Created is the created time of the response.\n    Created int64 `json:\"created\"`\n    // Model is the model of the response.\n    Model ChatModel `json:\"model\"`\n    // Choices is the choices of the response.\n    Choices []ChatCompletionChoice `json:\"choices\"`\n    // Usage is the usage of the response.\n    Usage Usage `json:\"usage\"`\n    // SystemFingerprint is the system fingerprint of the response.\n    SystemFingerprint string `json:\"system_fingerprint\"`\n    // Header is the header of the response.\n    http.Header\n}\n```\n\n\u003ca name=\"ChatCompletionResponse.SetHeader\"\u003e\u003c/a\u003e\n### func \\(\\*ChatCompletionResponse\\) [SetHeader](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L430\u003e)\n\n```go\nfunc (r *ChatCompletionResponse) SetHeader(h http.Header)\n```\n\nSetHeader sets the header of the response.\n\n\u003ca name=\"ChatCompletionResponseFormat\"\u003e\u003c/a\u003e\n## type [ChatCompletionResponseFormat](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L76-L82\u003e)\n\nChatCompletionResponseFormat is the chat completion response format.\n\n```go\ntype ChatCompletionResponseFormat struct {\n    // Type is the type of the chat completion response format.\n    Type Format `json:\"type,omitempty\"`\n    // JSONSchema is the json schema of the chat completion response\n    // format.\n    JSONSchema *ChatCompletionResponseFormatJSONSchema `json:\"json_schema,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatCompletionResponseFormatJSONSchema\"\u003e\u003c/a\u003e\n## type [ChatCompletionResponseFormatJSONSchema](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L85-L100\u003e)\n\nChatCompletionResponseFormatJSONSchema is the chat completion response format json schema.\n\n```go\ntype ChatCompletionResponseFormatJSONSchema struct {\n    // Name is the name of the chat completion response format json\n    // schema.\n    //\n    // it is used to further identify the schema in the response.\n    Name string `json:\"name\"`\n    // Description is the description of the chat completion\n    // response format json schema.\n    Description string `json:\"description,omitempty\"`\n    // Schema is the schema of the chat completion response format\n    // json schema.\n    Schema schema.Schema `json:\"schema\"`\n    // Strict determines whether to enforce the schema upon the\n    // generated content.\n    Strict bool `json:\"strict\"`\n}\n```\n\n\u003ca name=\"ChatCompletionStream\"\u003e\u003c/a\u003e\n## type [ChatCompletionStream](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L298-L300\u003e)\n\nChatCompletionStream is a stream of ChatCompletionStreamResponse.\n\n```go\ntype ChatCompletionStream struct {\n    // contains filtered or unexported fields\n}\n```\n\n\u003ca name=\"ChatCompletionStreamChoice\"\u003e\u003c/a\u003e\n## type [ChatCompletionStreamChoice](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L238-L245\u003e)\n\nChatCompletionStreamChoice represents a response structure for chat completion API.\n\n```go\ntype ChatCompletionStreamChoice struct {\n    // Index is the index of the choice.\n    Index int `json:\"index\"`\n    // Delta is the delta of the choice.\n    Delta ChatCompletionStreamChoiceDelta `json:\"delta\"`\n    // FinishReason is the finish reason of the choice.\n    FinishReason FinishReason `json:\"finish_reason\"`\n}\n```\n\n\u003ca name=\"ChatCompletionStreamChoiceDelta\"\u003e\u003c/a\u003e\n## type [ChatCompletionStreamChoiceDelta](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L226-L235\u003e)\n\nChatCompletionStreamChoiceDelta represents a response structure for chat completion API.\n\n```go\ntype ChatCompletionStreamChoiceDelta struct {\n    // Content is the content of the response.\n    Content string `json:\"content,omitempty\"`\n    // Role is the role of the creator of the completion.\n    Role string `json:\"role,omitempty\"`\n    // FunctionCall is the function call of the response.\n    FunctionCall *tools.FunctionCall `json:\"function_call,omitempty\"`\n    // ToolCalls are the tool calls of the response.\n    ToolCalls []tools.ToolCall `json:\"tool_calls,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatCompletionStreamResponse\"\u003e\u003c/a\u003e\n## type [ChatCompletionStreamResponse](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L263-L296\u003e)\n\nChatCompletionStreamResponse represents a response structure for chat completion API.\n\n```go\ntype ChatCompletionStreamResponse struct {\n    // ID is the identifier for the chat completion stream response.\n    ID  string `json:\"id\"`\n    // Object is the object type of the chat completion stream\n    // response.\n    Object string `json:\"object\"`\n    // Created is the creation time of the chat completion stream\n    // response.\n    Created int64 `json:\"created\"`\n    // Model is the model used for the chat completion stream\n    // response.\n    Model ChatModel `json:\"model\"`\n    // Choices is the choices for the chat completion stream\n    // response.\n    Choices []ChatCompletionStreamChoice `json:\"choices\"`\n    // SystemFingerprint is the system fingerprint for the chat\n    // completion stream response.\n    SystemFingerprint string `json:\"system_fingerprint\"`\n    // PromptAnnotations is the prompt annotations for the chat\n    // completion stream response.\n    PromptAnnotations []PromptAnnotation `json:\"prompt_annotations,omitempty\"`\n    // PromptFilterResults is the prompt filter results for the chat\n    // completion stream response.\n    PromptFilterResults []struct {\n        Index int `json:\"index\"`\n    }   `json:\"prompt_filter_results,omitempty\"`\n    // Usage is an optional field that will only be present when you\n    // set stream_options: {\"include_usage\": true} in your request.\n    //\n    // When present, it contains a null value except for the last\n    // chunk which contains the token usage statistics for the\n    // entire request.\n    Usage *Usage `json:\"usage,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatMessageImageURL\"\u003e\u003c/a\u003e\n## type [ChatMessageImageURL](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L36-L41\u003e)\n\nChatMessageImageURL represents the chat message image url.\n\n```go\ntype ChatMessageImageURL struct {\n    // URL is the url of the image.\n    URL string `json:\"url,omitempty\"`\n    // Detail is the detail of the image url.\n    Detail ImageURLDetail `json:\"detail,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatMessagePart\"\u003e\u003c/a\u003e\n## type [ChatMessagePart](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L44-L51\u003e)\n\nChatMessagePart represents the chat message part of a chat completion message.\n\n```go\ntype ChatMessagePart struct {\n    // Text is the text of the chat message part.\n    Text string `json:\"text,omitempty\"`\n    // Type is the type of the chat message part.\n    Type ChatMessagePartType `json:\"type,omitempty\"`\n    // ImageURL is the image url of the chat message part.\n    ImageURL *ChatMessageImageURL `json:\"image_url,omitempty\"`\n}\n```\n\n\u003ca name=\"ChatMessagePartType\"\u003e\u003c/a\u003e\n## type [ChatMessagePartType](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L26\u003e)\n\nChatMessagePartType is the chat message part type.\n\nstring\n\n```go\ntype ChatMessagePartType string\n```\n\n\u003ca name=\"ChatModel\"\u003e\u003c/a\u003e\n## type [ChatModel](\u003chttps://github.com/conneroisu/groq-go/blob/main/models.go#L14\u003e)\n\nChatModel is the type for chat models present on the groq api.\n\n```go\ntype ChatModel Model\n```\n\n\u003ca name=\"Client\"\u003e\u003c/a\u003e\n## type [Client](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L21-L33\u003e)\n\nClient is a Groq api client.\n\n```go\ntype Client struct {\n    // contains filtered or unexported fields\n}\n```\n\n\u003ca name=\"NewClient\"\u003e\u003c/a\u003e\n### func [NewClient](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L54\u003e)\n\n```go\nfunc NewClient(groqAPIKey string, opts ...Opts) (*Client, error)\n```\n\nNewClient creates a new Groq client.\n\n\u003ca name=\"Client.ChatCompletion\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [ChatCompletion](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L19-L22\u003e)\n\n```go\nfunc (c *Client) ChatCompletion(ctx context.Context, request ChatCompletionRequest) (response ChatCompletionResponse, err error)\n```\n\nChatCompletion method is an API call to create a chat completion.\n\n\u003ca name=\"Client.ChatCompletionJSON\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [ChatCompletionJSON](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L73-L77\u003e)\n\n```go\nfunc (c *Client) ChatCompletionJSON(ctx context.Context, request ChatCompletionRequest, output any) (err error)\n```\n\nChatCompletionJSON method is an API call to create a chat completion w/ object output.\n\n\u003ca name=\"Client.ChatCompletionStream\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [ChatCompletionStream](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L45-L48\u003e)\n\n```go\nfunc (c *Client) ChatCompletionStream(ctx context.Context, request ChatCompletionRequest) (stream *ChatCompletionStream, err error)\n```\n\nChatCompletionStream method is an API call to create a chat completion w/ streaming support.\n\n\u003ca name=\"Client.Moderate\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [Moderate](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L117-L121\u003e)\n\n```go\nfunc (c *Client) Moderate(ctx context.Context, messages []ChatCompletionMessage, model ModerationModel) (response []Moderation, err error)\n```\n\nModerate performs a moderation api call over a string. Input can be an array or slice but a string will reduce the complexity.\n\n\u003ca name=\"Client.Transcribe\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [Transcribe](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L161-L164\u003e)\n\n```go\nfunc (c *Client) Transcribe(ctx context.Context, request AudioRequest) (AudioResponse, error)\n```\n\nTranscribe calls the transcriptions endpoint with the given request.\n\nReturns transcribed text in the response\\_format specified in the request.\n\n\u003ca name=\"Client.Translate\"\u003e\u003c/a\u003e\n### func \\(\\*Client\\) [Translate](\u003chttps://github.com/conneroisu/groq-go/blob/main/inference.go#L171-L174\u003e)\n\n```go\nfunc (c *Client) Translate(ctx context.Context, request AudioRequest) (AudioResponse, error)\n```\n\nTranslate calls the translations endpoint with the given request.\n\nReturns the translated text in the response\\_format specified in the request.\n\n\u003ca name=\"FinishReason\"\u003e\u003c/a\u003e\n## type [FinishReason](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L307\u003e)\n\nFinishReason is the finish reason.\n\nstring\n\n```go\ntype FinishReason string\n```\n\n\u003ca name=\"ReasonStop\"\u003e\u003c/a\u003e\n\n```go\nconst (\n    // ReasonStop is the stop finish reason for a chat completion.\n    ReasonStop FinishReason = \"stop\"\n    // ReasonLength is the length finish reason for a chat completion.\n    ReasonLength FinishReason = \"length\"\n    // ReasonFunctionCall is the function call finish reason for a chat\n    // completion.\n    ReasonFunctionCall FinishReason = \"function_call\"\n    // ReasonToolCalls is the tool calls finish reason for a chat\n    // completion.\n    ReasonToolCalls FinishReason = \"tool_calls\"\n    // ReasonContentFilter is the content filter finish reason for a chat\n    // completion.\n    ReasonContentFilter FinishReason = \"content_filter\"\n    // ReasonNull is the null finish reason for a chat completion.\n    ReasonNull FinishReason = \"null\"\n)\n```\n\n\u003ca name=\"FinishReason.MarshalJSON\"\u003e\u003c/a\u003e\n### func \\(FinishReason\\) [MarshalJSON](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L420\u003e)\n\n```go\nfunc (r FinishReason) MarshalJSON() ([]byte, error)\n```\n\nMarshalJSON implements the json.Marshaler interface.\n\n\u003ca name=\"Format\"\u003e\u003c/a\u003e\n## type [Format](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L435\u003e)\n\nFormat is the format of a response. string\n\n```go\ntype Format string\n```\n\n\u003ca name=\"FormatText\"\u003e\u003c/a\u003e\n\n```go\nconst (\n    // FormatText is the text format. It is the default format of a\n    // response.\n    FormatText Format = \"text\"\n    // FormatJSON is the JSON format. There is no support for streaming with\n    // JSON format selected.\n    FormatJSON Format = \"json\"\n    // FormatSRT is the SRT format. This is a text format that is only\n    // supported for the transcription API.\n    // SRT format selected.\n    FormatSRT Format = \"srt\"\n    // FormatVTT is the VTT format. This is a text format that is only\n    // supported for the transcription API.\n    FormatVTT Format = \"vtt\"\n    // FormatVerboseJSON is the verbose JSON format. This is a JSON format\n    // that is only supported for the transcription API.\n    FormatVerboseJSON Format = \"verbose_json\"\n    // FormatJSONObject is the json object chat\n    // completion response format type.\n    FormatJSONObject Format = \"json_object\"\n    // FormatJSONSchema is the json schema chat\n    // completion response format type.\n    FormatJSONSchema Format = \"json_schema\"\n)\n```\n\n\u003ca name=\"ImageURLDetail\"\u003e\u003c/a\u003e\n## type [ImageURLDetail](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L22\u003e)\n\nImageURLDetail is the detail of the image at the URL.\n\nstring\n\n```go\ntype ImageURLDetail string\n```\n\n\u003ca name=\"LogProbs\"\u003e\u003c/a\u003e\n## type [LogProbs](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L165-L181\u003e)\n\nLogProbs is the top\\-level structure containing the log probability information.\n\n```go\ntype LogProbs struct {\n    // Content is a list of message content tokens with log\n    // probability information.\n    Content []struct {\n        // Token is the token of the log prob.\n        Token string `json:\"token\"`\n        // LogProb is the log prob of the log prob.\n        LogProb float64 `json:\"logprob\"`\n        // Omitting the field if it is null\n        Bytes []byte `json:\"bytes,omitempty\"`\n        // TopLogProbs is a list of the most likely tokens and\n        // their log probability, at this token position. In\n        // rare cases, there may be fewer than the number of\n        // requested top_logprobs returned.\n        TopLogProbs []TopLogProbs `json:\"top_logprobs\"`\n    } `json:\"content\"`\n}\n```\n\n\u003ca name=\"Model\"\u003e\u003c/a\u003e\n## type [Model](\u003chttps://github.com/conneroisu/groq-go/blob/main/models.go#L11\u003e)\n\nModel is a ai model accessible through the groq api.\n\n```go\ntype Model string\n```\n\n\u003ca name=\"Moderation\"\u003e\u003c/a\u003e\n## type [Moderation](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L606\u003e)\n\nModeration is a category of harmful content that can be used to categorize a chat history using Llama Guard 3.\n\n\\[Llama Guard 3\\]\\(https://llama.meta.com/docs/model-cards-and-prompt-formats/llama-guard-3/\\)\n\nLlama Guard 3 provides content safety support for the following languages: English, French, German, Hindi, Italian, Portuguese, Spanish, and Thai.\n\nstring\n\n```go\ntype Moderation string\n```\n\n\u003ca name=\"ModerationViolentCrimes\"\u003e\u003c/a\u003e\n\n```go\nconst (\n    // ModerationViolentCrimes (S1) is the violent crimes category.\n    //\n    // Responses that enable, encourage, or endorse the commission of\n    // violent crimes, including: (1) unlawful violence toward people\n    // (ex: terrorism, genocide, murder, hate-motivated violent crimes,\n    // child abuse, assault, battery, kidnapping) and (2) unlawful violence\n    // toward animals (ex: animal abuse)\n    ModerationViolentCrimes Moderation = \"violent_crimes\"\n    // ModerationNonviolentCrimes (S2) is the non-violent crimes category.\n    ModerationNonviolentCrimes Moderation = \"non_violent_crimes\"\n    // ModerationSexRelatedCrimes (S3) is the sex-related crimes category.\n    ModerationSexRelatedCrimes Moderation = \"sex_related_crimes\"\n    // ModerationChildSexualExploitation (S4) is the child sexual exploitation\n    // category.\n    //\n    // Responses that contain, describe, enable, encourage, or endorse the\n    // sexual abuse of children.\n    ModerationChildSexualExploitation Moderation = \"child_sexual_exploitation\"\n    // ModerationDefamation (S5) is the defamation category.\n    //\n    // Signifies responses that contain, describe, enable, encourage, or\n    // endorse defamation.\n    ModerationDefamation Moderation = \"defamation\"\n    // ModerationSpecializedAdvice (S6) is the specialized advice category.\n    //\n    // Signifies responses contain, describe, enable, encourage, or endorse\n    // specialized advice.\n    ModerationSpecializedAdvice Moderation = \"specialized_advice\"\n    // ModerationPrivacy (S7) is the privacy category.\n    //\n    // Responses contain, describe, enable, encourage, or endorse privacy.\n    ModerationPrivacy Moderation = \"privacy\"\n    // ModerationIntellectualProperty (S8) is the intellectual property\n    // category. Responses that contain, describe, enable, encourage, or\n    // endorse intellectual property.\n    ModerationIntellectualProperty Moderation = \"intellectual_property\"\n    // ModerationIndiscriminateWeapons (S9) is the indiscriminate weapons\n    // category.\n    //\n    // Responses that contain, describe, enable, encourage, or endorse\n    // indiscriminate weapons.\n    ModerationIndiscriminateWeapons Moderation = \"indiscriminate_weapons\"\n    // ModerationHate (S10) is the hate category.\n    //\n    // Responses contain, describe, enable, encourage, or endorse hate.\n    ModerationHate Moderation = \"hate\"\n    // ModerationSuicideOrSelfHarm (S11) is the suicide/self-harm category.\n    //\n    // Responses contain, describe, enable, encourage, or endorse suicide or\n    // self-harm.\n    ModerationSuicideOrSelfHarm Moderation = \"suicide_and_self_harm\"\n    // ModerationSexualContent (S12) is the sexual content category.\n    //\n    // Responses contain, describe, enable, encourage, or endorse\n    // sexual content.\n    ModerationSexualContent Moderation = \"sexual_content\"\n    // ModerationElections (S13) is the elections category.\n    //\n    // Responses contain factually incorrect information about electoral\n    // systems and processes, including in the time, place, or manner of\n    // voting in civic elections.\n    ModerationElections Moderation = \"elections\"\n    // ModerationCodeInterpreterAbuse (S14) is the code interpreter abuse\n    // category.\n    //\n    // Responses that contain, describe, enable, encourage, or\n    // endorse code interpreter abuse.\n    ModerationCodeInterpreterAbuse Moderation = \"code_interpreter_abuse\"\n)\n```\n\n\u003ca name=\"ModerationModel\"\u003e\u003c/a\u003e\n## type [ModerationModel](\u003chttps://github.com/conneroisu/groq-go/blob/main/models.go#L17\u003e)\n\nModerationModel is the type for moderation models present on the groq api.\n\n```go\ntype ModerationModel Model\n```\n\n\u003ca name=\"Opts\"\u003e\u003c/a\u003e\n## type [Opts](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L35\u003e)\n\nOpts is a function that sets options for a Groq client.\n\n```go\ntype Opts func(*Client)\n```\n\n\u003ca name=\"WithBaseURL\"\u003e\u003c/a\u003e\n### func [WithBaseURL](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L44\u003e)\n\n```go\nfunc WithBaseURL(baseURL string) Opts\n```\n\nWithBaseURL sets the base URL for the Groq client.\n\n\u003ca name=\"WithClient\"\u003e\u003c/a\u003e\n### func [WithClient](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L39\u003e)\n\n```go\nfunc WithClient(client *http.Client) Opts\n```\n\nWithClient sets the client for the Groq client.\n\n\u003ca name=\"WithLogger\"\u003e\u003c/a\u003e\n### func [WithLogger](\u003chttps://github.com/conneroisu/groq-go/blob/main/groq.go#L49\u003e)\n\n```go\nfunc WithLogger(logger *slog.Logger) Opts\n```\n\nWithLogger sets the logger for the Groq client.\n\n\u003ca name=\"PromptAnnotation\"\u003e\u003c/a\u003e\n## type [PromptAnnotation](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L32-L34\u003e)\n\nPromptAnnotation represents the prompt annotation.\n\n```go\ntype PromptAnnotation struct {\n    PromptIndex int `json:\"prompt_index,omitempty\"`\n}\n```\n\n\u003ca name=\"Role\"\u003e\u003c/a\u003e\n## type [Role](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L30\u003e)\n\nRole is the role of the chat completion message.\n\nstring\n\n```go\ntype Role string\n```\n\n\u003ca name=\"Segments\"\u003e\u003c/a\u003e\n## type [Segments](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L545-L568\u003e)\n\nSegments is the segments of the response.\n\n```go\ntype Segments []struct {\n    // ID is the ID of the segment.\n    ID  int `json:\"id\"`\n    // Seek is the seek of the segment.\n    Seek int `json:\"seek\"`\n    // Start is the start of the segment.\n    Start float64 `json:\"start\"`\n    // End is the end of the segment.\n    End float64 `json:\"end\"`\n    // Text is the text of the segment.\n    Text string `json:\"text\"`\n    // Tokens is the tokens of the segment.\n    Tokens []int `json:\"tokens\"`\n    // Temperature is the temperature of the segment.\n    Temperature float64 `json:\"temperature\"`\n    // AvgLogprob is the avg log prob of the segment.\n    AvgLogprob float64 `json:\"avg_logprob\"`\n    // CompressionRatio is the compression ratio of the segment.\n    CompressionRatio float64 `json:\"compression_ratio\"`\n    // NoSpeechProb is the no speech prob of the segment.\n    NoSpeechProb float64 `json:\"no_speech_prob\"`\n    // Transient is the transient of the segment.\n    Transient bool `json:\"transient\"`\n}\n```\n\n\u003ca name=\"StreamOptions\"\u003e\u003c/a\u003e\n## type [StreamOptions](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L247-L260\u003e)\n\nStreamOptions represents the stream options.\n\n```go\ntype StreamOptions struct {\n    // IncludeUsage is the include usage option of the stream\n    // options.\n    //\n    // If set, an additional chunk will be streamed before the data:\n    // [DONE] message.\n    // The usage field on this chunk shows the token usage\n    // statistics for the entire request, and the choices field will\n    // always be an empty array.\n    //\n    // All other chunks will also include a usage field, but with a\n    // null value.\n    IncludeUsage bool `json:\"include_usage,omitempty\"`\n}\n```\n\n\u003ca name=\"TopLogProbs\"\u003e\u003c/a\u003e\n## type [TopLogProbs](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L183-L190\u003e)\n\nTopLogProbs represents the top log probs.\n\n```go\ntype TopLogProbs struct {\n    // Token is the token of the top log probs.\n    Token string `json:\"token\"`\n    // LogProb is the log prob of the top log probs.\n    LogProb float64 `json:\"logprob\"`\n    // Bytes is the bytes of the top log probs.\n    Bytes []byte `json:\"bytes,omitempty\"`\n}\n```\n\n\u003ca name=\"TranscriptionTimestampGranularity\"\u003e\u003c/a\u003e\n## type [TranscriptionTimestampGranularity](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L496\u003e)\n\nTranscriptionTimestampGranularity is the timestamp granularity for the transcription.\n\nstring\n\n```go\ntype TranscriptionTimestampGranularity string\n```\n\n\u003ca name=\"TranscriptionTimestampGranularityWord\"\u003e\u003c/a\u003e\n\n```go\nconst (\n    // TranscriptionTimestampGranularityWord is the word timestamp\n    // granularity.\n    TranscriptionTimestampGranularityWord TranscriptionTimestampGranularity = \"word\"\n    // TranscriptionTimestampGranularitySegment is the segment timestamp\n    // granularity.\n    TranscriptionTimestampGranularitySegment TranscriptionTimestampGranularity = \"segment\"\n)\n```\n\n\u003ca name=\"Usage\"\u003e\u003c/a\u003e\n## type [Usage](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L437-L441\u003e)\n\nUsage Represents the total token usage per request to Groq.\n\n```go\ntype Usage struct {\n    PromptTokens     int `json:\"prompt_tokens\"`\n    CompletionTokens int `json:\"completion_tokens\"`\n    TotalTokens      int `json:\"total_tokens\"`\n}\n```\n\n\u003ca name=\"Words\"\u003e\u003c/a\u003e\n## type [Words](\u003chttps://github.com/conneroisu/groq-go/blob/main/types.go#L535-L543\u003e)\n\nWords is the words of the audio response.\n\n```go\ntype Words []struct {\n    // Word is the textual representation of a word in the audio\n    // response.\n    Word string `json:\"word\"`\n    // Start is the start of the words in seconds.\n    Start float64 `json:\"start\"`\n    // End is the end of the words in seconds.\n    End float64 `json:\"end\"`\n}\n```\n\nGenerated by [gomarkdoc](\u003chttps://github.com/princjef/gomarkdoc\u003e)\n\n\n\u003c!-- gomarkdoc:embed:end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconneroisu%2Fgroq-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconneroisu%2Fgroq-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconneroisu%2Fgroq-go/lists"}