-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
google ai support vision request (#869)
- Loading branch information
Showing
6 changed files
with
106 additions
and
31 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
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
19 changes: 19 additions & 0 deletions
19
jcommon/ai/google/src/main/java/run/mone/ai/google/bo/multiModal/GVisionContent.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,19 @@ | ||
package run.mone.ai.google.bo.multiModal; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
public class GVisionContent { | ||
|
||
@SerializedName("type") | ||
private String type; | ||
|
||
@SerializedName("text") | ||
private String text; | ||
|
||
@SerializedName("source") | ||
private GVisionSource source; | ||
} |
23 changes: 23 additions & 0 deletions
23
jcommon/ai/google/src/main/java/run/mone/ai/google/bo/multiModal/GVisionMsg.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,23 @@ | ||
package run.mone.ai.google.bo.multiModal; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* @author [email protected] | ||
* @date 2023/5/25 14:16 | ||
*/ | ||
@Data | ||
@Builder | ||
public class GVisionMsg implements Serializable { | ||
|
||
@SerializedName("role") | ||
private String role; | ||
|
||
@SerializedName("content") | ||
private List<GVisionContent> content; | ||
} |
32 changes: 32 additions & 0 deletions
32
jcommon/ai/google/src/main/java/run/mone/ai/google/bo/multiModal/GVisionRequest.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,32 @@ | ||
package run.mone.ai.google.bo.multiModal; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author [email protected] | ||
* @date 2024/4/9 16:36 | ||
*/ | ||
@Data | ||
@Builder | ||
public class GVisionRequest { | ||
|
||
|
||
@SerializedName("anthropic_version") | ||
private String anthropicVersion; | ||
|
||
@SerializedName("messages") | ||
private List<GVisionMsg> messages; | ||
|
||
@SerializedName("max_tokens") | ||
private int maxTokens; | ||
|
||
@SerializedName("stream") | ||
private boolean stream; | ||
|
||
|
||
|
||
} |
20 changes: 20 additions & 0 deletions
20
jcommon/ai/google/src/main/java/run/mone/ai/google/bo/multiModal/GVisionSource.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,20 @@ | ||
package run.mone.ai.google.bo.multiModal; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@Builder | ||
public class GVisionSource { | ||
|
||
@SerializedName("type") | ||
private String type; | ||
|
||
@SerializedName("media_type") | ||
private String mediaType; | ||
|
||
@SerializedName("data") | ||
private String data; | ||
|
||
} |