mirror of
https://github.com/TheBlewish/Automated-AI-Web-Researcher-Ollama.git
synced 2025-04-22 17:49:10 +00:00
Update llm_wrapper.py
added base url
This commit is contained in:
parent
2e278f3c05
commit
e69620c03f
1 changed files with 2 additions and 1 deletions
|
@ -23,9 +23,10 @@ class LLMWrapper:
|
|||
def _initialize_openai(self):
|
||||
"""Initialize OpenAI client"""
|
||||
api_key = self.llm_config.get('api_key') or os.getenv('OPENAI_API_KEY')
|
||||
base_url = self.llm_config.get('base_url', 'https://api.openai.com/v1')
|
||||
if not api_key:
|
||||
raise ValueError("OpenAI API key not found. Set it in config or OPENAI_API_KEY environment variable")
|
||||
self.client = OpenAI(api_key=api_key)
|
||||
self.client = OpenAI(api_key=api_key, base_url=base_url)
|
||||
self.model_name = self.llm_config.get('model_name', 'gpt-4o-mini')
|
||||
|
||||
def generate(self, prompt, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue