zuno 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51b2206418e88cbbfcd5f130d8e7d0f8486773317bd463e639ddcdf1ded31dd9
4
- data.tar.gz: db8b41989dbec0e5f07405a567c56de04b0ed6badb4537514845574ab1afbc37
3
+ metadata.gz: cf1792df415cee7140b1c93937b432fa7dbcc1d9f36ac3f13484e32712f4ec50
4
+ data.tar.gz: f687effb232e1ac3f920102fe06be674709d740c073c85174ffe698abd918883
5
5
  SHA512:
6
- metadata.gz: 37a62efd042c8511fbe7553a8dcf4ab880886d816317ed31bc5f0800b1554d6205af300394841e6c238700a8b6018ba4be33ec55af8a87c9c983dac773346368
7
- data.tar.gz: '028768a79656ab3cb2695ee2d475a0627317eb6cbc87817a782dd0aa6048081c77cc24e4a124d72a00cffae0217c6a516076ef30a33376f86bc8702e04edcec0'
6
+ metadata.gz: 44f45a9d8f4067bb258436a4b9434c67629bb0c1a23049423b7039ec48fd923b5b0be327abb3547771caaa825407fe8c872e440158d931486848a6fb538498b4
7
+ data.tar.gz: 34dec504254b3149893db199bd149f319c95a427cb56d8d82bb7e4ebfd399dfebbc90781392a0d7b85475d64cf3ea144158a0b5ab6d001a61251718ca1d2c26b
@@ -0,0 +1,30 @@
1
+ require 'httparty'
2
+ require 'open-uri'
3
+
4
+ module Providers
5
+ class GroqCloud
6
+ include HTTParty
7
+ base_uri 'https://api.groq.com'
8
+
9
+ def initialize
10
+ @api_key = Zuno.configuration.groq_cloud_api_key
11
+ self.class.headers 'Authorization' => "Bearer #{@api_key}"
12
+ end
13
+
14
+ def transcribe(audio, language = "en")
15
+ response = self.class.post(
16
+ '/openai/v1/audio/transcriptions',
17
+ multipart: true,
18
+ body: {
19
+ file: audio,
20
+ model: 'whisper-large-v3',
21
+ temperature: 0,
22
+ response_format: 'json',
23
+ language: language
24
+ }
25
+ )
26
+
27
+ { text: JSON.parse(response.body)["text"] }
28
+ end
29
+ end
30
+ end
@@ -1,6 +1,6 @@
1
1
  module Zuno
2
2
  class Configuration
3
- attr_accessor :chat_completion_model, :openai_api_key, :anthropic_api_key
3
+ attr_accessor :chat_completion_model, :openai_api_key, :anthropic_api_key, :groq_cloud_api_key
4
4
 
5
5
  def initialize
6
6
  @openai_api_key = nil
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "providers/groq_cloud"
4
+
5
+ module Zuno
6
+ class << self
7
+ def transcribe(audio:)
8
+ Providers::GroqCloud.new.transcribe(audio)
9
+ end
10
+ end
11
+ end
data/lib/zuno/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zuno
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
data/lib/zuno.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative "zuno/version"
4
4
  require_relative "zuno/configuration"
5
5
  require "zuno/chat"
6
+ require "zuno/transcription"
6
7
  require "faraday"
7
8
 
8
9
  module Zuno
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Paul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-24 00:00:00.000000000 Z
11
+ date: 2024-07-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: AI toolkit for Ruby
14
14
  email:
@@ -18,10 +18,12 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/providers/anthropic.rb
21
+ - lib/providers/groq_cloud.rb
21
22
  - lib/providers/openai.rb
22
23
  - lib/zuno.rb
23
24
  - lib/zuno/chat.rb
24
25
  - lib/zuno/configuration.rb
26
+ - lib/zuno/transcription.rb
25
27
  - lib/zuno/version.rb
26
28
  homepage: https://github.com/dqnamo
27
29
  licenses: