Skip to content

Commit 647519f

Browse files
authored
Refactor proxy handling (#51)
This commit refactors the way proxy-ing requests through prepend.me works. - dropped custom API client to prepend.me - added configuration to openai-ruby gem to use prepend.me as base URL
1 parent 8650477 commit 647519f

4 files changed

Lines changed: 94 additions & 231 deletions

File tree

examples/13_conversation_features_comprehensive.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,22 @@
138138
puts "Response from loaded conversation: #{chat2.last[:content]}"
139139
puts
140140

141+
puts "8. Creating multiple system messages:"
142+
chat3 = AI::Chat.new
143+
chat3.web_search = true
144+
puts "Message after first system message:"
145+
chat3.system("You speak like spider-man.")
146+
chat3.user("Where is the best place to get pizza in Chicago?")
147+
chat3.generate!
148+
puts "Response: #{chat3.last[:content]}"
149+
puts "\n\n"
150+
chat3.system("End every sentence with ✨")
151+
chat3.generate!
152+
puts "Message after second system message:"
153+
puts "Response: #{chat3.last[:content]}"
154+
puts
155+
141156
puts "=" * 60
142157
puts "All conversation features demonstrated!"
143158
puts "=" * 60
159+

examples/14_schema_generation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
puts
109109
chat = AI::Chat.new
110110
chat.schema_file = "schema.json"
111-
if chat.schema.present?
111+
if chat.schema.is_a?(Hash)
112112
puts "✓ AI::Chat#schema_file= assigns AI::Chat#schema"
113113
else
114114
puts "✗ AI::Chat#schema_file= does not assign AI::Chat#schema"

0 commit comments

Comments
 (0)