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 +4 -4
 - data/lib/providers/groq_cloud.rb +30 -0
 - data/lib/zuno/configuration.rb +1 -1
 - data/lib/zuno/transcription.rb +11 -0
 - data/lib/zuno/version.rb +1 -1
 - data/lib/zuno.rb +1 -0
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: cf1792df415cee7140b1c93937b432fa7dbcc1d9f36ac3f13484e32712f4ec50
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f687effb232e1ac3f920102fe06be674709d740c073c85174ffe698abd918883
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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
         
     | 
    
        data/lib/zuno/configuration.rb
    CHANGED
    
    
    
        data/lib/zuno/version.rb
    CHANGED
    
    
    
        data/lib/zuno.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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:
         
     |