Project

qyro_sdk

0.0
The project is in a healthy, maintained state
A Ruby SDK for interacting with the Qyro AI API (server & client).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

~> 2.7
 Project Readme

Qyro Ruby SDK

Ruby SDK for interacting with Qyro AI server & client APIs.

Installation

Add this line to your application's Gemfile:

gem "qyro_sdk"

And then execute:

bundle install

Or install it yourself as:

gem install qyro_sdk

Usage

require "qyro_sdk"

BASE_URL      = "https://qyroai.com"
API_KEY_ID    = "<API_KEY_ID>"
API_KEY_SECRET = "<API_KEY_SECRET>"
ASSISTANT_ID  = "<ASSISTANT_ID>"

if __FILE__ == $0
  # --- Server-side Example ---
  puts "=== Server SDK Example ==="
  server_client = QyroSDK::QyroServerClient.new(
    base_url: BASE_URL,
    api_key_id: API_KEY_ID,
    api_key_secret: API_KEY_SECRET
  )

  # create a new session
  session = server_client.create_session(ASSISTANT_ID, { user_id: "123" })
  puts "Created server session: #{session.id}"

  # send a chat message
  messages = server_client.chat(ASSISTANT_ID, session.id, "Hello from Ruby (server)")
  messages.each { |m| puts "[#{m.role}] #{m.content}" }

  # --- Client-side Example ---
  puts "\n=== Client SDK Example ==="
  token_generator = QyroSDK::ClientTokenGenerator.new(API_KEY_ID, API_KEY_SECRET)
  token = token_generator.generate({ client: "ruby-sdk-example" })

  client = QyroSDK::QyroClient.new(base_url: BASE_URL, token: token)
  client_session = client.create_session(ASSISTANT_ID, { locale: "en" })
  puts "Created client session: #{client_session.id}"

  client_messages = client.chat(ASSISTANT_ID, client_session.id, "Hello from Ruby (client)")
  client_messages.each { |m| puts "[#{m.role}] #{m.content}" }
end