
Intelligent Java (Intellijava)는 Java를 사용하여 최신 언어 모델 및 딥 러닝 프레임 워크와 통합하는 최고의 도구입니다. 라이브러리는 Chatgpt 및 Dall · E와 같은 모델에 입력을 보내고 생성 된 텍스트, 음성 또는 이미지를 수신하기위한 직관적 인 기능을 제공합니다. 몇 줄의 코드만으로도 최첨단 AI 모델의 전력에 쉽게 액세스하여 프로젝트를 향상시킬 수 있습니다.
지원되는 모델 :
RemoteLanguageModel , 이미지 생성을위한 RemoteImageModel , 음성 모델 to 텍스트에 대한 RemoteSpeechModel 및 ChatGpt의 Chatbot 에 전화하십시오. Maven Central 저장소에 출시 된 패키지 :
Maven :
< dependency >
< groupId >io.github.barqawiz</ groupId >
< artifactId >intellijava.core</ artifactId >
< version >0.8.2</ version >
</ dependency >Gradle :
implementation 'io.github.barqawiz:intellijava.core:0.8.2'
Gradle (Kotlin) :
implementation("io.github.barqawiz:intellijava.core:0.8.2")
JAR 다운로드 : Intellijava.jar.
언어 모델 코드 (2 단계) :
// 1- initiate the remote language model
String apiKey = "<add-openai-api-key>" ;
RemoteLanguageModel langModel = new RemoteLanguageModel ( apiKey , "openai" );
// 2- call generateText with any command !
LanguageModelInput langInput = new LanguageModelInput . Builder ( "Summarize the plot of the 'Inception' movie in two sentences" )
. setModel ( "text-davinci-003" ). setTemperature ( 0.7f ). setMaxTokens ( 50 ). build ();
String resValue = langModel . generateText ( langInput ); 생산량 : Inception follows Dom Cobb, a professional thief, who is offered a chance at redemption in exchange for planting an idea in a target's mind. He must navigate a dangerous landscape of dream-sharing technology and battle his inner demons in order to complete the mission and find his way back to reality.
이미지 생성 코드 (2 단계) :
// 1- initiate the remote image model
RemoteImageModel imageModel = new RemoteImageModel ( apiKey , "openai" );
// 2- call generateImages with any command !
ImageModelInput imageInput = new ImageModelInput . Builder ( "teddy writing a blog in times square" )
. setNumberOfImages ( 2 ). setImageSize ( "1024x1024" ). build ();
List < String > images = imageModel . generateImages ( imageInput ); 산출: 
텍스트 to Speech Code (2 단계) :
// 1- initiate the remote speech model
RemoteSpeechModel model = new RemoteSpeechModel ( apiKey , SpeechModels . google );
// 2- call generateEnglishText with any text
Text2SpeechInput input = new Text2SpeechInput . Builder ( "Hi, I am Intelligent Java." ). build ();
byte [] decodedAudio = model . generateEnglishText ( input ); 산출:
// save temporary audio file for testing
AudioHelper . saveTempAudio ( decodedAudio );chatgpt 코드 :
// 1- initiate the chat model.
Chatbot bot = new Chatbot ( apiKey , SupportedChatModels . openai );
// 2- prepare the chat history by calling addMessage.
String mode = "You are a helpful astronomy assistant." ;
ChatModelInput input = new ChatGPTInput . Builder ( mode )
. addUserMessage ( "what is the space between moon and earth" ). build ();
// 3- call chat!
List < String > resValues = bot . chat ( input ); 출력 : The average distance between the Moon and the Earth is about 238,855 miles (384,400 kilometers).
전체 예제 및 준비된 통합을 보려면 Sample_Code를 사용해보십시오.
유일한 종속성은 GSON 입니다. Intellijava Jar를 사용할 때 수동으로 추가해야합니다. 그러나 Maven을 통해이 저장소를 가져 오면 종속성을 처리합니다.
JAR 다운로드 : GSON 다운로드 repo
기고자 요청 :
아파치 라이센스
저작권 2023 github.com/barqawiz/intellijava
Apache 라이센스, 버전 2.0 ( "라이센스")에 따라 라이센스가 부여되었습니다. 라이센스를 준수하는 것 외에는이 파일을 사용할 수 없습니다. 라이센스 사본을 얻을 수 있습니다
http://www.apache.org/licenses/LICENSE-2.0
해당 법률에 의해 요구되거나 서면에 동의하지 않는 한, 라이센스에 따라 배포 된 소프트웨어는 명시 적 또는 묵시적 보증 또는 조건없이 "그대로"기준으로 배포됩니다. 라이센스에 따른 특정 언어 통치 권한 및 제한 사항에 대한 라이센스를 참조하십시오.