Add Together.ai's OpenAI API-compatible inference endpoints (#1947)

This commit is contained in:
Chenhe Gu
2024-01-05 16:36:29 +08:00
committed by GitHub
parent de584807e1
commit 6075fee556
16 changed files with 307 additions and 101 deletions

View File

@@ -39,13 +39,15 @@ def test_invoke_model(setup_openai_mock):
},
texts=[
"hello",
"world"
"world",
" ".join(["long_text"] * 100),
" ".join(["another_long_text"] * 100)
],
user="abc-123"
)
assert isinstance(result, TextEmbeddingResult)
assert len(result.embeddings) == 2
assert len(result.embeddings) == 4
assert result.usage.total_tokens == 2