community: refactor Baseten integration with new API endpoints & docs (#15017)

- **Description:** In response to user feedback, this PR refactors the
Baseten integration with updated model endpoints, as well as updates
relevant documentation. This PR has been tested by end users in
production and works as expected.
  - **Issue:** N/A
- **Dependencies:** This PR actually removes the dependency on the
`baseten` package!
  - **Twitter handle:** https://twitter.com/basetenco
This commit is contained in:
Philip Kiely - Baseten
2023-12-22 14:46:24 -06:00
committed by GitHub
parent 3fc1b3553b
commit 6342da333a
4 changed files with 172 additions and 114 deletions

View File

@@ -3,12 +3,11 @@ import os
from langchain_community.llms.baseten import Baseten
# This test requires valid BASETEN_MODEL_ID and BASETEN_API_KEY environment variables
def test_baseten_call() -> None:
"""Test valid call to Baseten."""
import baseten
baseten.login(os.environ["BASETEN_API_KEY"])
llm = Baseten(model=os.environ["BASETEN_MODEL_ID"])
output = llm("Say foo:")
output = llm("Test prompt, please respond.")
assert isinstance(output, str)