Comments (5)
@ManukMinasyan Thank you for clarification.
Now I know, why I wasn't able to reproduce the bug: It has already been fixed in Release 0.2.0
Please make sure, that you are using the latest version of the package.
from client.
I was not able to reproduce the issue.
Additionally the API specification says, that "completion_tokens" is not nullable. See: https://github.com/openai/openai-openapi/blob/master/openapi.yaml#L2080
Can you provide more details about the parameters you sent?
from client.
@gehrisandro I'm getting that error with this prompt:
$parameters['prompt'] = '""
Instruction: <<Answer to the Quora question>>
Question: <<abc>>
Information: <<>>
Result Structure <<answer>>
""';
from client.
After many time of searches, I have found the problem. It turns out that OpenAI will not return completion_tokens.
Request:
curl --location --request POST 'https://api.openai.com/v1/completions' \
--header 'Authorization: Bearer XXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "text-davinci-002",
"prompt": "Instruction: <<Create an article idea title and outline for an essay about the following keyword>> Keyword:<<sasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdsasd,.asmdv>>Structure: <<Title:Outline:>>",
"max_tokens": 100,
"temperature": 0.7
}'
Response
{
"id": "cmpl-6BQocmU7pbkVMGcRFXaGcgtnLJ259",
"object": "text_completion",
"created": 1668182706,
"model": "text-davinci-002",
"choices": [
{
"text": "",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 116,
"total_tokens": 116
}
}
from client.
I think it is necessary to set completion tokens to zero in this situation.
from client.
Related Issues (20)
- [Support]: How to modify to adapt a locally-deployed OpenAI API compatible embedding service?
- [Bug]: GPT-3 Model Being Used Despite Specifying GPT-4 in Client Request HOT 1
- Azure Chat with Custom Data problem HOT 1
- [Bug]: ThreadRunResponse missing step_details information HOT 1
- [Bug]: getErrorCode(): Return value must be of type ?string, int returned HOT 1
- [Bug]: all runs result with failure code: "server_error", message: "Sorry, something went wrong." HOT 1
- 提问我该如何结束发起的http请求呢
- Constant HTTP 500 Server errors HOT 2
- [Enhancement] streaming support for assistant api HOT 7
- [Bug]: Images (Dall-e 3) method not working with Azure HOT 1
- How to set the frequency_penalty? HOT 1
- [Bug]: Warning: Undefined array key "code" in Responses/FineTuning/RetrieveJobResponseError.php on line 42 HOT 2
- [Bug]: local.ERROR: 'json_object' is not of type 'object' - 'response_format' {"exception":"[object] (OpenAI\Exceptions\ErrorException(code: 0): 'json_object' is not of type 'object' - 'response_format' at /app/vendor/openai-php/client/src/Transporters/HttpTransporter.php:131) HOT 6
- [Bug]: JSON format is not supported
- [Improvement]: `dd` is not a PHP function, the first image of readme.md needs to be changed. use `var_dump` or `print_r` HOT 1
- [Bug]: HOT 1
- Fatal error: Cannot declare class OpenAI, because the name is already in use in E:\Xampp_8.2\htdocs\ia\vendor\openai-php\client\src\OpenAI.php on line 8 [Bug]: HOT 1
- [Feature]: Compatibility with assistants v2 HOT 4
- [improvement]: No support for assistant version v2 HOT 16
- Usage stats are now available when using streaming in the Chat Completions API HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client.