-
Notifications
You must be signed in to change notification settings - Fork 0
API call Usage example
Chamath K.B. Attanayaka edited this page Jul 31, 2023
·
2 revisions
apikey = ENV['OPENAI_API_KEY']
client = LlmLib::OpenAIClient.new(apikey)
prompt = "Once upon a time"
max_tokens = 100
response = client.chat_gpt_call(prompt,
max_tokens)
puts response
apikey = ENV['HUGGINGFACE_API_KEY']
client = LlmLib::HuggingfaceApiClient.new(apikey)
query = "Once upon a time"
response = client.hugging_bloom_call(query)
puts response
Replace 'API_KEY' with your actual OpenAI/Huggingface API key