mirror of
https://github.com/hanzoai/sdk.git
synced 2026-10-30 15:00:56 +00:00
- Add complete multi-language SDK matrix (Python, TS, Go, Rust, PHP, Ruby, Dart, Java, Kotlin, Swift, C++, C#, Fetch, Angular, CLI) - Fix dedicated org repository links (hanzo-php/sdk, hanzo-ruby/sdk, hanzo-dart/sdk, hanzo-go/sdk, etc.) - Add OpenAPI 3.1 canonical specification (spec/openapi.json) for /v1 routes and Kai decision governance - Add wire conformance test fixtures (auth, chat, SSE streaming, tool calls, Kai decisions, embeddings, errors) - Add standalone zero-dependency Python conformance runner and local mock gateway (conformance/runner.py) - Add runnable multi-language quickstarts in examples/ - Add GitHub Actions CI workflow for conformance verification (.github/workflows/conformance.yml) Co-authored-by: Hanzo Dev <[email protected]>
28 lines
704 B
Ruby
Executable File
28 lines
704 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# Ruby Quickstart for Hanzo AI SDK
|
|
#
|
|
# Install: gem install hanzoai
|
|
# Repository: https://github.com/hanzo-ruby/sdk (mirror: https://github.com/hanzoai/ruby-sdk)
|
|
|
|
require 'hanzoai'
|
|
|
|
client = Hanzoai::Client.new(
|
|
api_key: ENV['HANZO_API_KEY'] || 'sk-test-key',
|
|
base_url: ENV['HANZO_BASE_URL'] || 'https://api.hanzo.ai/v1'
|
|
)
|
|
|
|
puts "--- 1. List Models ---"
|
|
models = client.models.list
|
|
models.data.first(5).each do |m|
|
|
puts "Model: #{m.id} (#{m.owned_by})"
|
|
end
|
|
|
|
puts "\n--- 2. Chat Completion ---"
|
|
reply = client.chat.completions.create(
|
|
model: 'zen5',
|
|
messages: [
|
|
{ role: 'user', content: 'Say hello from Ruby!' }
|
|
]
|
|
)
|
|
puts "Reply: #{reply.choices.first.message.content}"
|