-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding Concurrent Chat completion API
- Loading branch information
1 parent
534a4f8
commit 950ab5a
Showing
10 changed files
with
281 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/io/github/namankhurpia/Interfaces/ConcurrentApiInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.github.namankhurpia.Interfaces; | ||
|
||
import io.github.namankhurpia.Pojo.MyModels.ChatCompletionRequestList; | ||
import io.github.namankhurpia.Pojo.MyModels.ChatCompletionResponseList; | ||
import io.github.namankhurpia.Pojo.MyModels.ModerationRequestList; | ||
import io.github.namankhurpia.Pojo.MyModels.ModerationResponseList; | ||
|
||
public interface ConcurrentApiInterface { | ||
|
||
ModerationResponseList CallMultipleModerationAPI(String key,ModerationRequestList requestList); | ||
|
||
ChatCompletionResponseList CallMultipleChatCompletionAPI(String key, ChatCompletionRequestList requestList); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/main/java/io/github/namankhurpia/Interfaces/MultipleCallInterface.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/main/java/io/github/namankhurpia/Pojo/MyModels/ChatCompletionRequestList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package io.github.namankhurpia.Pojo.MyModels; | ||
|
||
import io.github.namankhurpia.Pojo.ChatCompletion.ChatCompletionRequest; | ||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
/** | ||
* contains all functionality of an arraylist | ||
*/ | ||
public class ChatCompletionRequestList { | ||
|
||
/** | ||
* Min Size = 1; | ||
*/ | ||
|
||
ArrayList<ChatCompletionRequest> requestList; | ||
|
||
public ChatCompletionRequestList(ArrayList<ChatCompletionRequest> requestList) | ||
{ | ||
this.requestList = requestList; | ||
} | ||
|
||
public void add(ChatCompletionRequest obj) | ||
{ | ||
requestList.add(obj); | ||
} | ||
|
||
public void remove(int index) | ||
{ | ||
requestList.remove(index); | ||
} | ||
|
||
public void remove(ChatCompletionRequest obj) | ||
{ | ||
requestList.remove(obj); | ||
} | ||
|
||
public int size() | ||
{ | ||
return requestList.size(); | ||
} | ||
|
||
public void add(int index, ChatCompletionRequest element) | ||
{ | ||
requestList.add(index, element); | ||
} | ||
|
||
public void addAll(Collection collection) | ||
{ | ||
requestList.addAll(collection); | ||
} | ||
|
||
public void addAll(int index,Collection collection) | ||
{ | ||
requestList.addAll(index,collection); | ||
} | ||
|
||
public void clear() | ||
{ | ||
requestList.clear(); | ||
} | ||
|
||
public boolean contains(ChatCompletionRequest request) | ||
{ | ||
return requestList.contains(request); | ||
} | ||
|
||
public ChatCompletionRequest get(int index) | ||
{ | ||
return requestList.get(index); | ||
} | ||
|
||
public int indexOf(ChatCompletionRequest obj) | ||
{ | ||
return requestList.indexOf(obj); | ||
} | ||
|
||
public boolean isEmpty() | ||
{ | ||
return requestList.isEmpty(); | ||
} | ||
|
||
|
||
|
||
} |
85 changes: 85 additions & 0 deletions
85
src/main/java/io/github/namankhurpia/Pojo/MyModels/ChatCompletionResponseList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package io.github.namankhurpia.Pojo.MyModels; | ||
|
||
|
||
import io.github.namankhurpia.Pojo.ChatCompletion.ChatCompletionResponse; | ||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
/** | ||
* contains all functionality of an arraylist | ||
*/ | ||
public class ChatCompletionResponseList { | ||
|
||
/** | ||
* Min Size = 1; | ||
*/ | ||
ArrayList<ChatCompletionResponse> responseList; | ||
|
||
public ChatCompletionResponseList(ArrayList<ChatCompletionResponse> requestList) | ||
{ | ||
this.responseList = requestList; | ||
} | ||
|
||
public void add(ChatCompletionResponse obj) | ||
{ | ||
responseList.add(obj); | ||
} | ||
|
||
public void remove(int index) | ||
{ | ||
responseList.remove(index); | ||
} | ||
|
||
public void remove(ChatCompletionResponse obj) | ||
{ | ||
responseList.remove(obj); | ||
} | ||
|
||
public int size() | ||
{ | ||
return responseList.size(); | ||
} | ||
|
||
public void add(int index, ChatCompletionResponse element) | ||
{ | ||
responseList.add(index, element); | ||
} | ||
|
||
public void addAll(Collection collection) | ||
{ | ||
responseList.addAll(collection); | ||
} | ||
|
||
public void addAll(int index,Collection collection) | ||
{ | ||
responseList.addAll(index,collection); | ||
} | ||
|
||
public void clear() | ||
{ | ||
responseList.clear(); | ||
} | ||
|
||
public boolean contains(ChatCompletionResponse request) | ||
{ | ||
return responseList.contains(request); | ||
} | ||
|
||
public ChatCompletionResponse get(int index) | ||
{ | ||
return responseList.get(index); | ||
} | ||
|
||
public int indexOf(ChatCompletionResponse obj) | ||
{ | ||
return responseList.indexOf(obj); | ||
} | ||
|
||
public boolean isEmpty() | ||
{ | ||
return responseList.isEmpty(); | ||
} | ||
|
||
} |
71 changes: 70 additions & 1 deletion
71
src/main/java/io/github/namankhurpia/Pojo/MyModels/ModerationResponseList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,87 @@ | ||
package io.github.namankhurpia.Pojo.MyModels; | ||
|
||
import io.github.namankhurpia.Pojo.Moderations.ModerationAPIRequest; | ||
import io.github.namankhurpia.Pojo.Moderations.ModerationAPIResponse; | ||
import lombok.Data; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
/** | ||
* contains all functionality of an arraylist | ||
*/ | ||
@Data | ||
public class ModerationResponseList { | ||
|
||
/** | ||
* Min Size = 1; | ||
*/ | ||
ArrayList<ModerationAPIResponse> responseList; | ||
|
||
ModerationResponseList() | ||
public ModerationResponseList(ArrayList<ModerationAPIResponse> requestList) | ||
{ | ||
this.responseList = requestList; | ||
} | ||
|
||
public void add(ModerationAPIResponse obj) | ||
{ | ||
responseList.add(obj); | ||
} | ||
|
||
public void remove(int index) | ||
{ | ||
responseList.remove(index); | ||
} | ||
|
||
public void remove(ModerationAPIResponse obj) | ||
{ | ||
responseList.remove(obj); | ||
} | ||
|
||
public int size() | ||
{ | ||
return responseList.size(); | ||
} | ||
|
||
public void add(int index, ModerationAPIResponse element) | ||
{ | ||
responseList.add(index, element); | ||
} | ||
|
||
public void addAll(Collection collection) | ||
{ | ||
responseList.addAll(collection); | ||
} | ||
|
||
public void addAll(int index,Collection collection) | ||
{ | ||
responseList.addAll(index,collection); | ||
} | ||
|
||
public void clear() | ||
{ | ||
responseList.clear(); | ||
} | ||
|
||
public boolean contains(ModerationAPIResponse request) | ||
{ | ||
return responseList.contains(request); | ||
} | ||
|
||
public ModerationAPIResponse get(int index) | ||
{ | ||
return responseList.get(index); | ||
} | ||
|
||
public int indexOf(ModerationAPIResponse obj) | ||
{ | ||
return responseList.indexOf(obj); | ||
} | ||
|
||
public boolean isEmpty() | ||
{ | ||
return responseList.isEmpty(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters