Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions node/prompt-chatgpt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🤖 Node Prompt ChatGPT Function

Ask question, and let OpenAI GPT-3.5-turbo answer.
Ask question, and let OpenAI GPT-5.6-terra answer.

## 🧰 Usage

Expand Down Expand Up @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is

### OPENAI_MAX_TOKENS

The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens.
The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model.

| Question | Answer |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions node/prompt-chatgpt/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default async ({ req, res }) => {

try {
const response = await openai.chat.completions.create({
model: 'gpt-3.5-turbo',
max_tokens: parseInt(process.env.OPENAI_MAX_TOKENS ?? '512'),
model: 'gpt-5.6-terra',
max_completion_tokens: parseInt(process.env.OPENAI_MAX_TOKENS ?? '512'),
messages: [{ role: 'user', content: req.bodyJson.prompt }],
});
const completion = response.choices[0].message.content;
Expand Down
4 changes: 2 additions & 2 deletions php/prompt-chatgpt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🤖 PHP Prompt ChatGPT Function

Ask question, and let OpenAI GPT-3.5-turbo answer.
Ask question, and let OpenAI GPT-5.6-terra answer.

## 🧰 Usage

Expand Down Expand Up @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is

### OPENAI_MAX_TOKENS

The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens.
The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model.

| Question | Answer |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions php/prompt-chatgpt/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

try {
$response = $openai->chat()->create([
'model' => 'gpt-3.5-turbo',
'max_tokens' => $_ENV['MAX_TOKENS'] ?: 150,
'model' => 'gpt-5.6-terra',
'max_completion_tokens' => $_ENV['MAX_TOKENS'] ?: 150,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

150-token cap also limits GPT-5.6 reasoning

max_completion_tokens counts internal reasoning tokens as well as visible answer text, so the PHP template's default budget of 150 can be consumed before a multi-step prompt gets a useful answer; the handler still returns this as a successful completion. The old GPT-3.5 max_tokens limit did not have this reasoning-token cost, so consider raising the default or documenting that the configured budget includes reasoning.

Prompt To Fix With AI
This is a comment left during a code review.
Path: php/prompt-chatgpt/src/index.php
Line: 26

Comment:
**150-token cap also limits GPT-5.6 reasoning**

`max_completion_tokens` counts internal reasoning tokens as well as visible answer text, so the PHP template's default budget of 150 can be consumed before a multi-step prompt gets a useful answer; the handler still returns this as a successful completion. The old GPT-3.5 `max_tokens` limit did not have this reasoning-token cost, so consider raising the default or documenting that the configured budget includes reasoning.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

🟡 Minor · bug · Reply if this doesn't apply.

'messages' => [
['role' => 'user', 'content' => $context->req->bodyJson['prompt']]
],
Expand Down
4 changes: 2 additions & 2 deletions python/prompt_chatgpt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🤖 Python Prompt ChatGPT Function

Ask question, and let OpenAI GPT-3.5-turbo answer.
Ask question, and let OpenAI GPT-5.6-terra answer.

## 🧰 Usage

Expand Down Expand Up @@ -76,7 +76,7 @@ A unique key used to authenticate with the OpenAI API. Please note that this is

### OPENAI_MAX_TOKENS

The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model. For GPT-3.5-turbo, the limit is 4096 tokens.
The maximum number of tokens that the OpenAI response should contain. Be aware that OpenAI models read and write a maximum number of tokens per API call, which varies depending on the model.

| Question | Answer |
| ------------- | ------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions python/prompt_chatgpt/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def main(context):

try:
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
max_tokens=int(os.environ.get("OPENAI_MAX_TOKENS", "512")),
model="gpt-5.6-terra",
max_completion_tokens=int(os.environ.get("OPENAI_MAX_TOKENS", "512")),
messages=[{"role": "user", "content": context.req.body["prompt"]}],
)
completion = response.choices[0].message.content
Expand Down