From e53ec039ee88896020c4520ba9b4b75650cc0d35 Mon Sep 17 00:00:00 2001 From: Finn Bacall Date: Wed, 15 Jan 2025 11:21:05 +0000 Subject: [PATCH] Replace `secrets` calls --- lib/llm/chatgpt_service.rb | 2 +- lib/llm/willma_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/llm/chatgpt_service.rb b/lib/llm/chatgpt_service.rb index 88fdc2ff9..95525e3cc 100644 --- a/lib/llm/chatgpt_service.rb +++ b/lib/llm/chatgpt_service.rb @@ -6,7 +6,7 @@ module Llm class ChatgptService < Service require 'openai' def initialize - api_key = Rails.application.secrets&.gpt_api_key + api_key = Rails.application.config.secrets&.gpt_api_key @client = OpenAI::Client.new(access_token: api_key) @params = { # max_tokens: 50, diff --git a/lib/llm/willma_service.rb b/lib/llm/willma_service.rb index 98a305c08..4ee8ec290 100644 --- a/lib/llm/willma_service.rb +++ b/lib/llm/willma_service.rb @@ -41,7 +41,7 @@ def call(prompt) def do_request(url, mode, data = {}) header = { 'Content-Type': 'application/json', - 'X-API-KEY': Rails.application.secrets&.willma_api_key + 'X-API-KEY': Rails.application.config.secrets&.willma_api_key } parsed_url = URI.parse(url)