Skip to content

Commit

Permalink
add complete api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Apr 1, 2024
1 parent acf6127 commit 78a18ad
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ def _embed(
) -> List[List[float]]:
"""Embed a single text entry to either passage or query type"""
# AI Foundation Model API -
# unknown
# input: str | list[str] -- <= 2048 characters, <= 50 inputs
# model: "query" | "passage" -- type of input text to be embedded
# encoding_format: "float" | "base64"
# API Catalog API -
# input: str | list[str]
# model: str
# encoding_format: str
# input: str | list[str] -- char limit depends on model
# model: str -- model name, e.g. NV-Embed-QA
# encoding_format: "float" | "base64"
# input_type: "query" | "passage"
# what about truncation?
# user: str -- ignored
# truncate: "NONE" | "START" | "END" -- default "NONE", error raised if
# an input is too long
payload = {
"input": texts,
"model": self.get_binding_model() or model_type,
Expand Down

0 comments on commit 78a18ad

Please sign in to comment.