groq_ruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +57 -0
- data/CLAUDE.md +103 -0
- data/LICENSE.txt +21 -0
- data/README.md +495 -0
- data/Rakefile +11 -0
- data/examples/README.md +39 -0
- data/examples/batch.rb +29 -0
- data/examples/chat_completion.rb +24 -0
- data/examples/chat_completion_stop.rb +19 -0
- data/examples/chat_completion_streaming.rb +23 -0
- data/examples/embedding.rb +20 -0
- data/examples/error_handling.rb +27 -0
- data/examples/file_upload.rb +23 -0
- data/examples/mcp_agent.rb +63 -0
- data/examples/mcp_chat_with_tools.rb +103 -0
- data/examples/mcp_resources_and_prompts.rb +89 -0
- data/examples/models_list.rb +16 -0
- data/examples/speech.rb +23 -0
- data/examples/transcription.rb +23 -0
- data/examples/translation.rb +22 -0
- data/lib/groq_ruby/client.rb +69 -0
- data/lib/groq_ruby/configuration.rb +62 -0
- data/lib/groq_ruby/error_mapper.rb +37 -0
- data/lib/groq_ruby/errors/api_connection_error.rb +8 -0
- data/lib/groq_ruby/errors/api_error.rb +14 -0
- data/lib/groq_ruby/errors/api_response_error.rb +5 -0
- data/lib/groq_ruby/errors/api_status_error.rb +23 -0
- data/lib/groq_ruby/errors/api_timeout_error.rb +8 -0
- data/lib/groq_ruby/errors/authentication_error.rb +4 -0
- data/lib/groq_ruby/errors/bad_request_error.rb +4 -0
- data/lib/groq_ruby/errors/configuration_error.rb +4 -0
- data/lib/groq_ruby/errors/conflict_error.rb +4 -0
- data/lib/groq_ruby/errors/error.rb +5 -0
- data/lib/groq_ruby/errors/internal_server_error.rb +4 -0
- data/lib/groq_ruby/errors/not_found_error.rb +4 -0
- data/lib/groq_ruby/errors/parameter_error.rb +13 -0
- data/lib/groq_ruby/errors/permission_denied_error.rb +4 -0
- data/lib/groq_ruby/errors/rate_limit_error.rb +4 -0
- data/lib/groq_ruby/errors/unprocessable_entity_error.rb +4 -0
- data/lib/groq_ruby/mcp/bridge.rb +239 -0
- data/lib/groq_ruby/mcp/claude_desktop_config.rb +79 -0
- data/lib/groq_ruby/mcp/client.rb +171 -0
- data/lib/groq_ruby/mcp/errors/error.rb +7 -0
- data/lib/groq_ruby/mcp/errors/json_rpc_error.rb +21 -0
- data/lib/groq_ruby/mcp/errors/protocol_error.rb +7 -0
- data/lib/groq_ruby/mcp/errors/timeout_error.rb +7 -0
- data/lib/groq_ruby/mcp/errors/transport_error.rb +6 -0
- data/lib/groq_ruby/mcp/errors/unknown_tool_error.rb +7 -0
- data/lib/groq_ruby/mcp/json_rpc.rb +51 -0
- data/lib/groq_ruby/mcp/prompt.rb +21 -0
- data/lib/groq_ruby/mcp/resource.rb +17 -0
- data/lib/groq_ruby/mcp/server_config.rb +22 -0
- data/lib/groq_ruby/mcp/tool.rb +22 -0
- data/lib/groq_ruby/mcp/transport.rb +32 -0
- data/lib/groq_ruby/mcp/transports/stdio.rb +100 -0
- data/lib/groq_ruby/mcp.rb +25 -0
- data/lib/groq_ruby/models/audio/transcription.rb +10 -0
- data/lib/groq_ruby/models/audio/translation.rb +8 -0
- data/lib/groq_ruby/models/batches/batch.rb +16 -0
- data/lib/groq_ruby/models/batches/batch_list.rb +10 -0
- data/lib/groq_ruby/models/batches/batch_request_counts.rb +8 -0
- data/lib/groq_ruby/models/chat/chat_completion.rb +14 -0
- data/lib/groq_ruby/models/chat/chat_completion_choice.rb +10 -0
- data/lib/groq_ruby/models/chat/chat_completion_chunk.rb +13 -0
- data/lib/groq_ruby/models/chat/chat_completion_chunk_choice.rb +10 -0
- data/lib/groq_ruby/models/chat/chat_completion_delta.rb +8 -0
- data/lib/groq_ruby/models/chat/chat_completion_message.rb +10 -0
- data/lib/groq_ruby/models/embeddings/create_embedding_response.rb +11 -0
- data/lib/groq_ruby/models/embeddings/embedding.rb +8 -0
- data/lib/groq_ruby/models/embeddings/embedding_usage.rb +8 -0
- data/lib/groq_ruby/models/files/file_deleted.rb +8 -0
- data/lib/groq_ruby/models/files/file_list.rb +10 -0
- data/lib/groq_ruby/models/files/file_object.rb +8 -0
- data/lib/groq_ruby/models/model.rb +8 -0
- data/lib/groq_ruby/models/model_deleted.rb +8 -0
- data/lib/groq_ruby/models/model_factory.rb +31 -0
- data/lib/groq_ruby/models/model_list.rb +10 -0
- data/lib/groq_ruby/models/usage.rb +11 -0
- data/lib/groq_ruby/multipart.rb +84 -0
- data/lib/groq_ruby/request.rb +13 -0
- data/lib/groq_ruby/resources/audio/speech.rb +32 -0
- data/lib/groq_ruby/resources/audio/transcriptions.rb +48 -0
- data/lib/groq_ruby/resources/audio/translations.rb +45 -0
- data/lib/groq_ruby/resources/audio.rb +26 -0
- data/lib/groq_ruby/resources/base.rb +33 -0
- data/lib/groq_ruby/resources/batches.rb +44 -0
- data/lib/groq_ruby/resources/chat/completions.rb +94 -0
- data/lib/groq_ruby/resources/chat.rb +16 -0
- data/lib/groq_ruby/resources/embeddings.rb +28 -0
- data/lib/groq_ruby/resources/files.rb +55 -0
- data/lib/groq_ruby/resources/models.rb +35 -0
- data/lib/groq_ruby/response.rb +9 -0
- data/lib/groq_ruby/streaming/chunk_stream.rb +58 -0
- data/lib/groq_ruby/streaming/event_parser.rb +23 -0
- data/lib/groq_ruby/transport.rb +169 -0
- data/lib/groq_ruby/version.rb +5 -0
- data/lib/groq_ruby.rb +36 -0
- data/lib/tasks/gem.rake +5 -0
- data/lib/tasks/lint/all.rake +11 -0
- data/lib/tasks/lint/rubocop.rake +15 -0
- data/lib/tasks/security.rake +11 -0
- data/lib/tasks/types.rake +11 -0
- data/sig/groq_ruby.rbs +191 -0
- data/sig/zeitwerk.rbs +13 -0
- data.tar.gz.sig +0 -0
- metadata +237 -0
- metadata.gz.sig +0 -0
metadata
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: groq_ruby
|
|
3
|
+
version: !ruby/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
|
|
24
|
+
HrikpdU3LfHhkuw0i+u6DY6wo2ig8TmBElYcGVBvHLC4zE+SauB3twUA3KS+L28s
|
|
25
|
+
ZLkdQKSHAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
26
|
+
BBQYc3LuAKPW1hVGU4v2+Heo9njxkzANBgkqhkiG9w0BAQsFAAOCAYEAbBHLTL6R
|
|
27
|
+
1qTMfAN3QDkKR1LY1ZwVmIOewbYb2ZR8Wh7YVrMsPjxhtyKPSHQcKjUfHJWu/x0v
|
|
28
|
+
R4REqmqtQVAYIS+wE+eU0m6amJhIaUBPpe9VUGAATQFGcZfkvZSSo2iypKvUviCR
|
|
29
|
+
QEnvdwdikjj8UWPq+BY5XwzPwDalktwNIbKOGpA6Vi/QvNsPgT60gVlfSK00r+xD
|
|
30
|
+
2K2IW+cbg7n5tMk12TPe6sGYZ/Etv8HbAIhfmvqeojRoQRxu9TkuRK5RoooPNb6I
|
|
31
|
+
gQ+tY0DZWiRb8ZA16J2H7xByPGMG05Wh35RFK0nHHBJIKGtUFoo9IKLX2CTcYCV3
|
|
32
|
+
CDn4zKpaoNCrvzrb33CN1/WLOHyd0MwcaUlZXbPPIJwba22bKxJwcZak+ito48+o
|
|
33
|
+
eOOM3Ey1zRgRMJ796ATHV0nD9PJ55WJtOf8mDlfEo3OzQEr9eOUDKroboS67Rx6Z
|
|
34
|
+
2mrF2gBJQHxM1jOVHd7xTUWPJaUaSXrQYrxuu7BEP1cSFUsn4TI0Q7RK
|
|
35
|
+
-----END CERTIFICATE-----
|
|
36
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
37
|
+
dependencies:
|
|
38
|
+
- !ruby/object:Gem::Dependency
|
|
39
|
+
name: dry-monads
|
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
|
41
|
+
requirements:
|
|
42
|
+
- - "~>"
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
version: '1.6'
|
|
45
|
+
type: :runtime
|
|
46
|
+
prerelease: false
|
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - "~>"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '1.6'
|
|
52
|
+
- !ruby/object:Gem::Dependency
|
|
53
|
+
name: dry-schema
|
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
- - "~>"
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '1.13'
|
|
59
|
+
type: :runtime
|
|
60
|
+
prerelease: false
|
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - "~>"
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '1.13'
|
|
66
|
+
- !ruby/object:Gem::Dependency
|
|
67
|
+
name: event_stream_parser
|
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
|
69
|
+
requirements:
|
|
70
|
+
- - "~>"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '1.0'
|
|
73
|
+
type: :runtime
|
|
74
|
+
prerelease: false
|
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
76
|
+
requirements:
|
|
77
|
+
- - "~>"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '1.0'
|
|
80
|
+
- !ruby/object:Gem::Dependency
|
|
81
|
+
name: zeitwerk
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - "~>"
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '2.6'
|
|
87
|
+
type: :runtime
|
|
88
|
+
prerelease: false
|
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - "~>"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '2.6'
|
|
94
|
+
description: |
|
|
95
|
+
Idiomatic Ruby client for Groq's OpenAI-compatible API. Covers chat
|
|
96
|
+
completions (sync + streaming), embeddings, audio (speech, transcription,
|
|
97
|
+
translation), models, files, and batches. Built on Net::HTTP, with
|
|
98
|
+
parameter validation via dry-schema and internal Result-based control
|
|
99
|
+
flow via dry-monads.
|
|
100
|
+
email:
|
|
101
|
+
- p.osiczko@tetrapyloctomy.org
|
|
102
|
+
executables: []
|
|
103
|
+
extensions: []
|
|
104
|
+
extra_rdoc_files: []
|
|
105
|
+
files:
|
|
106
|
+
- CHANGELOG.md
|
|
107
|
+
- CLAUDE.md
|
|
108
|
+
- LICENSE.txt
|
|
109
|
+
- README.md
|
|
110
|
+
- Rakefile
|
|
111
|
+
- examples/README.md
|
|
112
|
+
- examples/batch.rb
|
|
113
|
+
- examples/chat_completion.rb
|
|
114
|
+
- examples/chat_completion_stop.rb
|
|
115
|
+
- examples/chat_completion_streaming.rb
|
|
116
|
+
- examples/embedding.rb
|
|
117
|
+
- examples/error_handling.rb
|
|
118
|
+
- examples/file_upload.rb
|
|
119
|
+
- examples/mcp_agent.rb
|
|
120
|
+
- examples/mcp_chat_with_tools.rb
|
|
121
|
+
- examples/mcp_resources_and_prompts.rb
|
|
122
|
+
- examples/models_list.rb
|
|
123
|
+
- examples/speech.rb
|
|
124
|
+
- examples/transcription.rb
|
|
125
|
+
- examples/translation.rb
|
|
126
|
+
- lib/groq_ruby.rb
|
|
127
|
+
- lib/groq_ruby/client.rb
|
|
128
|
+
- lib/groq_ruby/configuration.rb
|
|
129
|
+
- lib/groq_ruby/error_mapper.rb
|
|
130
|
+
- lib/groq_ruby/errors/api_connection_error.rb
|
|
131
|
+
- lib/groq_ruby/errors/api_error.rb
|
|
132
|
+
- lib/groq_ruby/errors/api_response_error.rb
|
|
133
|
+
- lib/groq_ruby/errors/api_status_error.rb
|
|
134
|
+
- lib/groq_ruby/errors/api_timeout_error.rb
|
|
135
|
+
- lib/groq_ruby/errors/authentication_error.rb
|
|
136
|
+
- lib/groq_ruby/errors/bad_request_error.rb
|
|
137
|
+
- lib/groq_ruby/errors/configuration_error.rb
|
|
138
|
+
- lib/groq_ruby/errors/conflict_error.rb
|
|
139
|
+
- lib/groq_ruby/errors/error.rb
|
|
140
|
+
- lib/groq_ruby/errors/internal_server_error.rb
|
|
141
|
+
- lib/groq_ruby/errors/not_found_error.rb
|
|
142
|
+
- lib/groq_ruby/errors/parameter_error.rb
|
|
143
|
+
- lib/groq_ruby/errors/permission_denied_error.rb
|
|
144
|
+
- lib/groq_ruby/errors/rate_limit_error.rb
|
|
145
|
+
- lib/groq_ruby/errors/unprocessable_entity_error.rb
|
|
146
|
+
- lib/groq_ruby/mcp.rb
|
|
147
|
+
- lib/groq_ruby/mcp/bridge.rb
|
|
148
|
+
- lib/groq_ruby/mcp/claude_desktop_config.rb
|
|
149
|
+
- lib/groq_ruby/mcp/client.rb
|
|
150
|
+
- lib/groq_ruby/mcp/errors/error.rb
|
|
151
|
+
- lib/groq_ruby/mcp/errors/json_rpc_error.rb
|
|
152
|
+
- lib/groq_ruby/mcp/errors/protocol_error.rb
|
|
153
|
+
- lib/groq_ruby/mcp/errors/timeout_error.rb
|
|
154
|
+
- lib/groq_ruby/mcp/errors/transport_error.rb
|
|
155
|
+
- lib/groq_ruby/mcp/errors/unknown_tool_error.rb
|
|
156
|
+
- lib/groq_ruby/mcp/json_rpc.rb
|
|
157
|
+
- lib/groq_ruby/mcp/prompt.rb
|
|
158
|
+
- lib/groq_ruby/mcp/resource.rb
|
|
159
|
+
- lib/groq_ruby/mcp/server_config.rb
|
|
160
|
+
- lib/groq_ruby/mcp/tool.rb
|
|
161
|
+
- lib/groq_ruby/mcp/transport.rb
|
|
162
|
+
- lib/groq_ruby/mcp/transports/stdio.rb
|
|
163
|
+
- lib/groq_ruby/models/audio/transcription.rb
|
|
164
|
+
- lib/groq_ruby/models/audio/translation.rb
|
|
165
|
+
- lib/groq_ruby/models/batches/batch.rb
|
|
166
|
+
- lib/groq_ruby/models/batches/batch_list.rb
|
|
167
|
+
- lib/groq_ruby/models/batches/batch_request_counts.rb
|
|
168
|
+
- lib/groq_ruby/models/chat/chat_completion.rb
|
|
169
|
+
- lib/groq_ruby/models/chat/chat_completion_choice.rb
|
|
170
|
+
- lib/groq_ruby/models/chat/chat_completion_chunk.rb
|
|
171
|
+
- lib/groq_ruby/models/chat/chat_completion_chunk_choice.rb
|
|
172
|
+
- lib/groq_ruby/models/chat/chat_completion_delta.rb
|
|
173
|
+
- lib/groq_ruby/models/chat/chat_completion_message.rb
|
|
174
|
+
- lib/groq_ruby/models/embeddings/create_embedding_response.rb
|
|
175
|
+
- lib/groq_ruby/models/embeddings/embedding.rb
|
|
176
|
+
- lib/groq_ruby/models/embeddings/embedding_usage.rb
|
|
177
|
+
- lib/groq_ruby/models/files/file_deleted.rb
|
|
178
|
+
- lib/groq_ruby/models/files/file_list.rb
|
|
179
|
+
- lib/groq_ruby/models/files/file_object.rb
|
|
180
|
+
- lib/groq_ruby/models/model.rb
|
|
181
|
+
- lib/groq_ruby/models/model_deleted.rb
|
|
182
|
+
- lib/groq_ruby/models/model_factory.rb
|
|
183
|
+
- lib/groq_ruby/models/model_list.rb
|
|
184
|
+
- lib/groq_ruby/models/usage.rb
|
|
185
|
+
- lib/groq_ruby/multipart.rb
|
|
186
|
+
- lib/groq_ruby/request.rb
|
|
187
|
+
- lib/groq_ruby/resources/audio.rb
|
|
188
|
+
- lib/groq_ruby/resources/audio/speech.rb
|
|
189
|
+
- lib/groq_ruby/resources/audio/transcriptions.rb
|
|
190
|
+
- lib/groq_ruby/resources/audio/translations.rb
|
|
191
|
+
- lib/groq_ruby/resources/base.rb
|
|
192
|
+
- lib/groq_ruby/resources/batches.rb
|
|
193
|
+
- lib/groq_ruby/resources/chat.rb
|
|
194
|
+
- lib/groq_ruby/resources/chat/completions.rb
|
|
195
|
+
- lib/groq_ruby/resources/embeddings.rb
|
|
196
|
+
- lib/groq_ruby/resources/files.rb
|
|
197
|
+
- lib/groq_ruby/resources/models.rb
|
|
198
|
+
- lib/groq_ruby/response.rb
|
|
199
|
+
- lib/groq_ruby/streaming/chunk_stream.rb
|
|
200
|
+
- lib/groq_ruby/streaming/event_parser.rb
|
|
201
|
+
- lib/groq_ruby/transport.rb
|
|
202
|
+
- lib/groq_ruby/version.rb
|
|
203
|
+
- lib/tasks/gem.rake
|
|
204
|
+
- lib/tasks/lint/all.rake
|
|
205
|
+
- lib/tasks/lint/rubocop.rake
|
|
206
|
+
- lib/tasks/security.rake
|
|
207
|
+
- lib/tasks/types.rake
|
|
208
|
+
- sig/groq_ruby.rbs
|
|
209
|
+
- sig/zeitwerk.rbs
|
|
210
|
+
homepage: https://github.com/posiczko/groq_ruby
|
|
211
|
+
licenses:
|
|
212
|
+
- MIT
|
|
213
|
+
metadata:
|
|
214
|
+
allowed_push_host: https://rubygems.org
|
|
215
|
+
source_code_uri: https://github.com/posiczko/groq_ruby
|
|
216
|
+
changelog_uri: https://github.com/posiczko/groq_ruby/blob/main/CHANGELOG.md
|
|
217
|
+
bug_tracker_uri: https://github.com/posiczko/groq_ruby/issues
|
|
218
|
+
documentation_uri: https://github.com/posiczko/groq_ruby#readme
|
|
219
|
+
rubygems_mfa_required: 'true'
|
|
220
|
+
rdoc_options: []
|
|
221
|
+
require_paths:
|
|
222
|
+
- lib
|
|
223
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
224
|
+
requirements:
|
|
225
|
+
- - ">="
|
|
226
|
+
- !ruby/object:Gem::Version
|
|
227
|
+
version: 3.2.0
|
|
228
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
|
+
requirements:
|
|
230
|
+
- - ">="
|
|
231
|
+
- !ruby/object:Gem::Version
|
|
232
|
+
version: '0'
|
|
233
|
+
requirements: []
|
|
234
|
+
rubygems_version: 4.0.11
|
|
235
|
+
specification_version: 4
|
|
236
|
+
summary: Ruby client for the Groq API.
|
|
237
|
+
test_files: []
|
metadata.gz.sig
ADDED
|
Binary file
|