The OpenAI PHP SDK extension for the WoltLab Suite enables developers to access and seamlessly integrate the powerful OpenAI GPT-3 API into their forum and community platforms. With this extension, developers can now use APIs for text search, response, and classification to enhance the user experience.
Thanks to the OpenAI PHP SDK, you can access the latest features and integrate them into your WoltLab Suite. By integrating GPT-3, you can provide your users with high-quality language processing. You can use the SDK to generate automated responses, classify texts, and intelligently search for relevant content.
It is important to note, however, that this extension is intended solely for third-party developers. The extension has no direct function or application for end-users.
Usage Example:
<?php
// ...
$openAI = \wcf\system\openAI\ScOpenAI::getInstance();
echo (string)$openAI->chat([
'model' => 'gpt-3.5-turbo',
'messages' => [['role' => 'user', 'content' => 'When did Mozart die?']],
'temperature' => 0.7,
'max_tokens' => 256
])->getBody();
// ...
Display More
Approximate result:
{
"id": "chatcmpl-6tqi9OJUxwWYS20sLd0U22WtEobR0",
"object": "chat.completion",
"created": 1678768681,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 12,
"completion_tokens": 15,
"total_tokens": 27
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\nMozart died on December 5, 1791."
},
"finish_reason": "stop",
"index": 0
}
]
}
Display More
A standalone version of this library, as well as other examples, can be found here:

-
Version 1.4.2
- SoftCreatR
- 6.72 kB
- 7 Downloads
Preparations for extensions
-
Version 1.4.1
- SoftCreatR
- 5.87 kB
- 7 Downloads
- Option OPENAI_USER_ID removed. This should be provided in extensions if needed
- The individual methods createChatCompletion and createCompletion have been eliminated to decrease the overall complexity. Although these methods can still be invoked, it is now necessary to explicitly set the method option.
-
Version 1.3.0
- SoftCreatR
- 6.23 kB
- 4 Downloads
Various code optimizations and improvements.
-
Version 1.2.2
- SoftCreatR
- 5.29 kB
- 5 Downloads
- Incorrect or obsolete method annotations updated
- Exception handling improved
- Corrected routes/methods:
- createModeration
-
Version 1.2.1
- SoftCreatR
- 4.95 kB
- 3 Downloads
Incorrect or obsolete method annotations updated
-
Version 1.2.0
- SoftCreatR
- 4.85 kB
- 1 Download
- Added support for file uploads (e.g. for transcription)
- Fixed error in __call.
New Routes/Methods:
- deleteModel
- retrieveModel
Corrected routes/methods:
- deleteFile
- retrieveFile
Changed routes/methods:
-
Version 1.1.1
- SoftCreatR
- 4.55 kB
- 1 Download
- Streaming options removed for now
- Added invalidation of clients when setting/overwriting the timeout
-
Version 1.1.0
- SoftCreatR
- 4.66 kB
- 3 Downloads
- Fixed a bug that prevented completion from being executed
- Missing method setTimeout added
- HTTP client creation improved
-
Version 1.0.0
- SoftCreatR
- 4.52 kB
- 6 Downloads
Initial release