Skip to content

Commit 04f6565

Browse files
committed
Replacve OPENAI_MAX_COMPLETION_TOKENS
1 parent aed6ee0 commit 04f6565

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

tools/issue_handler/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ This creates a `.env` file that you will need to fill with the required tokens a
4949
**Optional variables** (override defaults):
5050
- `OPENAI_MODEL` - Model to use (default: `gpt-5.2-chat-latest`)
5151
- `OPENAI_TEMPERATURE` - Response creativity 0.0-1.0 (default: `0.4`)
52-
- `OPENAI_MAX_RESPONSE_TOKENS` - Max response length (default: `500`)
52+
- `OPENAI_MAX_COMPLETION_TOKENS` - Max response length (default: `500`)
5353

5454
## Usage
5555

@@ -82,7 +82,7 @@ The tool runs:
8282
**Optional GitHub Variables** (override defaults if needed):
8383
- `OPENAI_MODEL` - Model to use (default: `gpt-5.2-chat-latest`)
8484
- `OPENAI_TEMPERATURE` - Response creativity 0.0-1.0 (default: `0.4`)
85-
- `OPENAI_MAX_RESPONSE_TOKENS` - Max response length (default: `500`)
85+
- `OPENAI_MAX_COMPLETION_TOKENS` - Max response length (default: `500`)
8686

8787
**Automatically Provided**:
8888
- `GITHUB_TOKEN` - Provided by GitHub Actions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# List of Python dependencies with exact versions
2-
openai==2.17.0
2+
openai==2.14.0
33
pytest==9.0.2
44
requests==2.32.5
55
python-dotenv==1.2.1

tools/issue_handler/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ GITHUB_REPOSITORY=DataDog/dd-sdk-ios
3232
# Optional: Override OpenAI defaults
3333
# OPENAI_MODEL=gpt-5.2-chat-latest
3434
# OPENAI_TEMPERATURE=0.4
35-
# OPENAI_MAX_RESPONSE_TOKENS=500
35+
# OPENAI_MAX_COMPLETION_TOKENS=500
3636
EOL
3737

3838
echo "✨ Created .env file"

tools/issue_handler/src/openai_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class OpenAIHandler:
5454

5555
# Content limits to prevent abuse
5656
MAX_CONTENT_LENGTH = 4000
57-
MAX_RESPONSE_TOKENS = int(os.environ.get("OPENAI_MAX_RESPONSE_TOKENS", "500"))
57+
MAX_COMPLETION_TOKENS = int(os.environ.get("OPENAI_MAX_COMPLETION_TOKENS", "500"))
5858

5959
def __init__(self, api_key: str):
6060
"""
@@ -118,7 +118,7 @@ def analyze_issue(self, issue: GithubIssue) -> AnalysisResult:
118118
model=self.model,
119119
messages=messages,
120120
# temperature=float(os.environ.get("OPENAI_TEMPERATURE", "0.4")),
121-
max_completion_tokens=self.MAX_RESPONSE_TOKENS,
121+
max_completion_tokens=self.MAX_COMPLETION_TOKENS,
122122
response_format={"type": "json_object"}
123123
)
124124

0 commit comments

Comments
 (0)