anthropics/anthropic-sdk-ruby
Tentang
The Anthropic SDK for Ruby provides access to the Claude API from Ruby applications.
Alat pengembanganPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- -2
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliAnthropic SDK for Ruby
The Anthropic SDK for Ruby provides access to the Claude API from Ruby applications.
Documentation
Full documentation is available at platform.claude.com/docs/en/api/sdks/ruby.
Installation
Add to your application's Gemfile:
gem "anthropic", "~> 2.9.0"
Getting started
require "bundler/setup"
require "anthropic"
anthropic = Anthropic::Client.new(
api_key: ENV["ANTHROPIC_API_KEY"] # This is the default and can be omitted
)
message = anthropic.messages.create(
max_tokens: 1024,
messages: [{role: "user", content: "Hello, Claude"}],
model: Anthropic::Model::CLAUDE_OPUS_5_5
)
puts(message.content)
Requirements
Ruby 3.2.0+
Contributing
See CONTRIBUTING.md.
License
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details. Versions released before the change from the MIT License, and third-party contributions merged before it, remain under the MIT License. See LICENSE-MIT.
Acknowledgements
Thank you @alexrudall for giving feedback, donating the anthropic Ruby Gem name, and paving the way by building the first Anthropic Ruby SDK.
Jelajahi proyek terkait
Memuat…