forked from phoenix/litellm-mirror
add _transform_openai_request_to_fine_tuned_embedding_request
This commit is contained in:
parent
4b63927514
commit
f4f1616777
1 changed files with 15 additions and 2 deletions
|
@ -23,14 +23,27 @@ class TextEmbeddingInput(TypedDict, total=False):
|
||||||
title: Optional[str]
|
title: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
|
# Fine-tuned models require a different input format
|
||||||
|
# Ref: https://console.cloud.google.com/vertex-ai/model-garden?hl=en&project=adroit-crow-413218&pageState=(%22galleryStateKey%22:(%22f%22:(%22g%22:%5B%5D,%22o%22:%5B%5D),%22s%22:%22%22))
|
||||||
|
class TextEmbeddingFineTunedInput(TypedDict, total=False):
|
||||||
|
inputs: str
|
||||||
|
|
||||||
|
|
||||||
|
class TextEmbeddingFineTunedParameters(TypedDict, total=False):
|
||||||
|
max_new_tokens: Optional[int]
|
||||||
|
temperature: Optional[float]
|
||||||
|
top_p: Optional[float]
|
||||||
|
top_k: Optional[int]
|
||||||
|
|
||||||
|
|
||||||
class EmbeddingParameters(TypedDict, total=False):
|
class EmbeddingParameters(TypedDict, total=False):
|
||||||
auto_truncate: Optional[bool]
|
auto_truncate: Optional[bool]
|
||||||
output_dimensionality: Optional[int]
|
output_dimensionality: Optional[int]
|
||||||
|
|
||||||
|
|
||||||
class VertexEmbeddingRequest(TypedDict, total=False):
|
class VertexEmbeddingRequest(TypedDict, total=False):
|
||||||
instances: List[TextEmbeddingInput]
|
instances: Union[List[TextEmbeddingInput], List[TextEmbeddingFineTunedInput]]
|
||||||
parameters: Optional[EmbeddingParameters]
|
parameters: Optional[Union[EmbeddingParameters, TextEmbeddingFineTunedParameters]]
|
||||||
|
|
||||||
|
|
||||||
# Example usage:
|
# Example usage:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue