OpenAI Library MT5
- 라이브러리
-
VitalDefender Inc.
StormWave Technologies: AI 기반 솔루션으로 금융을 재정의하다
StormWave는 금융 전문가와 기관을 위한 고급 AI 기반 도구 개발을 전문으로 하는 금융 혁신의 선두 주자입니다. 우리의 목표는 생성적 인공지능과 최첨단 기계 학습을 활용하여 복잡한 프로세스를 자동화하고, 운영 효율성을 높이며, 규제 준수를 보장함으로써 고객에게 권한을 부여하는 것입니다. - 버전: 1.0
- 활성화: 5
The following library is proposed as a means of being able to use the OpenAI API directly on the metatrader, in the simplest way possible.
For more on the library's capabilities, read the following article:
https://www.mql5.com/en/blogs/post/756098
The files needed to use the library can be found here:
In order to use the library, you must include the following Header, which you can find at the following link:
https://www.mql5.com/en/blogs/post/756108
#import "StormWaveOpenAI.ex5"
COpenAI *iOpenAI(string);
CMessages *iMessages(void);
CTools *iTools(void);
#import
This is all you need to be able to Use the library with ease.
Below is an example of how you can use the library with ease and operate with the OpenAI API
#include <StormWaveOpenAI.mqh> //--- Include the custom OpenAI header file for API integration COpenAI *client; //--- Declare a pointer to the OpenAI client CMessages *_message_; //--- Declare a pointer for handling messages //--- The OnStart function is the entry point of the script OnStart() { client = iOpenAI("YOUR_API_KEY"); //--- Initialize the OpenAI client with your API key client.start_thread(); //--- Start a new thread for the OpenAI client to operate in string completion; //--- Variable to store the API response _message_ = iMessages(); //--- Initialize the message handler string user_content = "Hi how are you?"; //--- Define the message content _message_.AddMessage(user_content, user); //--- Add the message to the handler with a user identifier //--- Call the API to generate a completion based on the provided messages completion = client.completions_create( /*model = */ "gpt-3.5-turbo-0125", //--- Specify the model to use for the completion /*messages = */ _message_, //--- Pass the messages to the API /*max_tokens = */ 300, //--- Set the maximum number of tokens to generate /*temperature = */ 1.0 //--- Set the creativity level of the response ); client.PrintResultMessage(); //--- Print the result of the API call delete _message_; //--- Clean up the message handler delete client; //--- Clean up the OpenAI client }
For further details, please feel free to contact me. I express my thanks in advance in case you decide to purchase this library. Should you encounter bugs, I would be grateful if you could contribute to the improvement of the library by privately sending me the problems you encounter so that I can make the necessary improvements.
