Skip to content

Commit 9534f8e

Browse files
committed
Using RubyLLM new with_params to replace crmne/ruby_llm#131
1 parent 8f10a27 commit 9534f8e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ gem "wechat", git: "https://git.thape.com.cn/Eric-Guo/wechat.git", branch: :main
4646
gem "rake"
4747

4848
# bundle config local.ruby_llm /Users/$(whoami)/git/oss/ruby_llm/
49-
gem "ruby_llm", git: "https://git.thape.com.cn/ai/ruby_llm.git", branch: :WithResponseFormat2
49+
gem "ruby_llm", git: "https://git.thape.com.cn/ai/ruby_llm.git", branch: :dify_api
5050
gem "uri"
5151
gem "faraday-net_http"
5252
gem "net-http", "~> 0.4.1"

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ GIT
1414

1515
GIT
1616
remote: https://git.thape.com.cn/ai/ruby_llm.git
17-
revision: f0fc8ffb2cc76548448d1a8fd28849c58eff7d9c
18-
branch: WithResponseFormat2
17+
revision: 4bef85c4fa1e59f7cf6d6c44685097593ced0cdf
18+
branch: dify_api
1919
specs:
2020
ruby_llm (1.3.2beta1)
2121
base64

app/models/guest_message.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def ai_spam_score
4848

4949
chat = RubyLLM.chat
5050
chat.with_instructions system_prompt
51-
chat.with_response_format(type: :object, properties: {result: {type: :integer}})
51+
chat.with_params(response_format: { type: 'json_object' })
5252
response = chat.ask "#{name} from company #{company} (#{contact_details}) leaving message:\n\n#{message}"
5353
response.content
5454
end

0 commit comments

Comments
 (0)