-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package cse.gradle.Server.APIs; | ||
|
||
public interface DallEApi { | ||
|
||
public String generateChatResponse(String[] messages); | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/cse/gradle/Server/APIs/MockDallEApiClient.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,17 @@ | ||
package cse.gradle.Server.APIs; | ||
|
||
public class MockDallEApiClient extends DallEApiClient { | ||
|
||
@Override | ||
public String generateChatResponse(String prompt) { | ||
// BEGIN: Mock generateChatResponse | ||
// Check if the prompt is valid | ||
if (prompt == null || prompt.isEmpty()) { | ||
throw new IllegalArgumentException("Prompt cannot be null or empty"); | ||
} | ||
|
||
// Return a preset image URL provided by wikipedia | ||
return "https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg?20070224000419"; | ||
// END: Mock generateChatResponse | ||
} | ||
} |
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