Skip to content

Commit

Permalink
fix: updating openai call
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-whodo committed Jan 31, 2025
1 parent ac11347 commit 289ad01
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pr-diff-bot/pr_diff_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ def __init__(self, github_token: str, openrouter_key: str, model: str = "anthrop
"""
self.model = model
self.github = Github(github_token)
self.openai_client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=openrouter_key,
default_headers={
"HTTP-Referer": "https://github.com/pr-diff-bot",
"X-Title": "PR Diff Analyzer"
}
)

# Initialize OpenAI client with OpenRouter configuration
headers = {
"HTTP-Referer": "https://github.com/pr-diff-bot",
"X-Title": "PR Diff Analyzer"
}
self.openai_client = OpenAI(api_key=openrouter_key, base_url="https://openrouter.ai/api/v1", default_headers=headers)
self.bot_signature = "<!-- PR-DIFF-BOT-COMMENT -->"

def get_pull_request(self, repo_name: str, pr_number: int) -> PullRequest:
Expand Down

0 comments on commit 289ad01

Please sign in to comment.