mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
Update Bedrock Titan V2 type definitions for encoding format support
- Add embeddingTypes parameter to AmazonTitanV2EmbeddingRequest - Add embeddingsByType response field for binary format support - Update type hints for enhanced embedding response handling
This commit is contained in:
parent
8296bfb866
commit
0e096d7883
1 changed files with 12 additions and 5 deletions
|
|
@ -324,15 +324,22 @@ class CohereEmbeddingResponse(TypedDict):
|
|||
texts: List[str]
|
||||
|
||||
|
||||
class AmazonTitanV2EmbeddingRequest(TypedDict):
|
||||
inputText: str
|
||||
class AmazonTitanV2EmbeddingRequest(TypedDict, total=False):
|
||||
inputText: Required[str]
|
||||
dimensions: int
|
||||
normalize: bool
|
||||
embeddingTypes: List[Literal["float", "binary"]]
|
||||
|
||||
|
||||
class AmazonTitanV2EmbeddingResponse(TypedDict):
|
||||
embedding: List[float]
|
||||
inputTextTokenCount: int
|
||||
class AmazonTitanV2EmbeddingsByType(TypedDict, total=False):
|
||||
binary: List[int] # Array of integers for binary format
|
||||
float: List[float] # Array of floats for float format
|
||||
|
||||
|
||||
class AmazonTitanV2EmbeddingResponse(TypedDict, total=False):
|
||||
embedding: List[float] # Legacy field - array of floats (backward compatibility)
|
||||
embeddingsByType: AmazonTitanV2EmbeddingsByType # New format per AWS schema
|
||||
inputTextTokenCount: Required[int] # Always present in AWS response
|
||||
|
||||
|
||||
class AmazonTitanG1EmbeddingRequest(TypedDict):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue