|
1 | | -# IntelliJava |
2 | | - IntelliJava allows java developers to easily integrate with the latest language models and deep learning frameworks like GPT-3 using few lines of code. |
| 1 | +# IntelliJava-OpenaiAPI |
| 2 | +*IntelliJava V0.1* |
| 3 | + |
| 4 | +IntelliJava allows java developers to easily integrate with the latest language models and deep learning frameworks like GPT-3 using few lines of code. |
| 5 | +The first version supports only Openai APIs. It provides a simple and intuitive API with convenient methods for sending text input to GPT-3 and receiving generated text in return. |
| 6 | + |
| 7 | +# How to use |
| 8 | +1. Import the core jar file to your project [intellijava.jar](https://insta-answer-public.s3.amazonaws.com/opensource/IntelliJava/version0.1/com.intellijava.core-0.1-SNAPSHOT.jar). |
| 9 | +2. Add gson dependency using maven or the jar file (check the dependencies section). |
| 10 | +3. Call the RemoteLanguageModel as described in the code example. |
| 11 | + |
| 12 | +# Code Example |
| 13 | +``` |
| 14 | +// 1- initiate the remote language model |
| 15 | +String apiKey = "<todo-add-api-key>"; |
| 16 | +RemoteLanguageModel wrapper = new RemoteLanguageModel(apiKey, "openai"); |
| 17 | +
|
| 18 | +// 2- call generateText with any command ! |
| 19 | +String command = "write a java code that says hello wrold"; |
| 20 | +String resValue = wrapper.generateText("text-davinci-002", command, 0.5F, 100); |
| 21 | +``` |
| 22 | +For full example check the samples projects inside sample_code folder. |
| 23 | + |
| 24 | +# Dependencies |
| 25 | +The only dependencies is **GSON**. |
| 26 | + |
| 27 | +For Maven: |
| 28 | +``` |
| 29 | +<dependency> |
| 30 | + <groupId>com.google.code.gson</groupId> |
| 31 | + <artifactId>gson</artifactId> |
| 32 | + <version>2.8.9</version> |
| 33 | +</dependency> |
| 34 | +``` |
| 35 | + |
| 36 | +For Gradle: |
| 37 | +``` |
| 38 | +dependencies { |
| 39 | + implementation 'com.google.code.gson:gson:2.8.9' |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +For jar download: |
| 44 | +[gson download repo](https://search.maven.org/artifact/com.google.code.gson/gson/2.8.9/jar) |
| 45 | + |
| 46 | +# License |
| 47 | + |
| 48 | +MIT License |
| 49 | + |
| 50 | +Copyright (c) 2023 Github.com/Barqawiz/IntelliJava |
| 51 | + |
| 52 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 53 | +of this software and associated documentation files (the "Software"), to deal |
| 54 | +in the Software without restriction, including without limitation the rights |
| 55 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 56 | +copies of the Software, and to permit persons to whom the Software is |
| 57 | +furnished to do so, subject to the following conditions: |
| 58 | + |
| 59 | +The above copyright notice and this permission notice shall be included in all |
| 60 | +copies or substantial portions of the Software. |
| 61 | + |
| 62 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 63 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 64 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 65 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 66 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 67 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 68 | +SOFTWARE. |
0 commit comments