zuno 0.1.4 → 1.0.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.
metadata CHANGED
@@ -1,74 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - John Paul
7
+ - Hyperaide
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-06 00:00:00.000000000 Z
11
+ date: 2026-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: httparty
14
+ name: typhoeus
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: faraday
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
33
+ version: '13.0'
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: event_stream_parser
42
+ name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
47
+ version: '3.13'
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: AI toolkit for Ruby
54
+ version: '3.13'
55
+ description: Standalone Ruby SDK for AI generation across OpenRouter and Replicate,
56
+ with iterative tool loops and SSE streaming.
56
57
  email:
57
- - johnarpaul@gmail.com
58
+ - team@hyperaide.dev
58
59
  executables: []
59
60
  extensions: []
60
61
  extra_rdoc_files: []
61
62
  files:
62
- - lib/providers/openai.rb
63
+ - README.md
63
64
  - lib/zuno.rb
64
- - lib/zuno/chat.rb
65
- - lib/zuno/configuration.rb
66
65
  - lib/zuno/version.rb
67
- homepage: https://github.com/dqnamo
66
+ homepage: https://github.com/hyperaide/hyperaide
68
67
  licenses:
69
68
  - MIT
70
69
  metadata:
71
- homepage_uri: https://github.com/dqnamo
70
+ homepage_uri: https://github.com/hyperaide/hyperaide
71
+ source_code_uri: https://github.com/hyperaide/hyperaide
72
72
  post_install_message:
73
73
  rdoc_options: []
74
74
  require_paths:
@@ -77,15 +77,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 3.0.0
80
+ version: '3.1'
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.4.10
87
+ rubygems_version: 3.5.22
88
88
  signing_key:
89
89
  specification_version: 4
90
- summary: AI toolkit for Ruby
90
+ summary: Ruby SDK with provider/model abstraction, single-shot generation, loops,
91
+ and streaming
91
92
  test_files: []
@@ -1,58 +0,0 @@
1
- require 'ostruct'
2
- require 'faraday'
3
- require 'byebug'
4
- require 'event_stream_parser'
5
-
6
- module Providers
7
- class OpenAI
8
- def initialize
9
- @connection = Faraday.new(url: "https://api.openai.com") do |faraday|
10
- faraday.request :json
11
- faraday.response :json
12
- faraday.adapter Faraday.default_adapter
13
- end
14
-
15
- @api_key = Zuno.configuration.openai_api_key
16
- end
17
-
18
- def chat_completion(messages, model, options = {}, raw_response)
19
- response = @connection.post("/v1/chat/completions") do |req|
20
- req.headers["Content-Type"] = "application/json"
21
- req.headers["Authorization"] = "Bearer #{@api_key}"
22
- req.body = {
23
- model: model,
24
- messages: messages,
25
- }.merge(options).to_json
26
-
27
- if options[:stream]
28
- parser = EventStreamParser::Parser.new
29
- req.options.on_data = Proc.new do |chunk, size|
30
- if raw_response
31
- yield chunk
32
- else
33
- parser.feed(chunk) do |type, data, id, reconnection_time|
34
- return if data == "[DONE]"
35
- content = JSON.parse(data)["choices"][0]["delta"]["content"]
36
- yield OpenStruct.new(content: content) if content
37
- end
38
- end
39
- end
40
- end
41
- end
42
-
43
- unless options[:stream]
44
- if raw_response
45
- return response.body
46
- else
47
- if response.body["error"]
48
- raise response.body["error"]["message"]
49
- elsif response.body["choices"][0]["message"]["content"]
50
- OpenStruct.new(content: response.body["choices"][0]["message"]["content"])
51
- elsif response.body["choices"][0]["message"]["tool_calls"]
52
- OpenStruct.new(tool_calls: response.body["choices"][0]["message"]["tool_calls"])
53
- end
54
- end
55
- end
56
- end
57
- end
58
- end
data/lib/zuno/chat.rb DELETED
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "providers/openai"
4
-
5
- module Zuno
6
- OPENAI_MODELS = %w[gpt-3.5-turbo gpt-4-turbo gpt-4-turbo-preview gpt-4o gpt-4o-mini].freeze
7
-
8
- class << self
9
- def chat(messages:, model: nil, **options)
10
- model ||= Zuno.configuration.chat_completion_model
11
- provider = provider_for_model(model)
12
- raw_response = options.delete(:raw_response) || false
13
-
14
- if options[:stream]
15
- provider.chat_completion(messages, model, options, raw_response) do |chunk|
16
- yield chunk if block_given?
17
- end
18
- else
19
- provider.chat_completion(messages, model, options, raw_response)
20
- end
21
- end
22
-
23
- private
24
-
25
- def provider_for_model(model)
26
- case model
27
- when *OPENAI_MODELS then Providers::OpenAI.new
28
- else
29
- raise ArgumentError, "Unsupported model: #{model}"
30
- end
31
- end
32
-
33
- def model_providers_mapping
34
- @model_providers_mapping ||= {
35
- **OPENAI_MODELS.to_h { |model| [model, Providers::OpenAI.new] },
36
- }
37
- end
38
- end
39
- end
@@ -1,11 +0,0 @@
1
- module Zuno
2
- class Configuration
3
- attr_accessor :chat_completion_model, :openai_api_key, :anthropic_api_key, :groq_cloud_api_key
4
-
5
- def initialize
6
- @chat_completion_model = nil
7
- @openai_api_key = nil
8
- @anthropic_api_key = nil
9
- end
10
- end
11
- end