feat: Add support for dynamic providers in Astra DB Comp (#4627)
* feat: Add support for dynamic providers in Astra DB Comp * [autofix.ci] apply automated fixes * Make sure we return a default dict * Rename params in starter template * Update test_vector_store_rag.py --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
cd2517f7e2
commit
31885175e5
5 changed files with 129 additions and 82 deletions
|
|
@ -48,7 +48,7 @@ async def test_base(astradb_client: AstraDB):
|
|||
"token": application_token,
|
||||
"api_endpoint": api_endpoint,
|
||||
"collection_name": BASIC_COLLECTION,
|
||||
"embedding": ComponentInputHandle(
|
||||
"embedding_model": ComponentInputHandle(
|
||||
clazz=OpenAIEmbeddingsComponent,
|
||||
inputs={"openai_api_key": get_openai_api_key()},
|
||||
output_name="embeddings",
|
||||
|
|
@ -79,7 +79,7 @@ async def test_astra_embeds_and_search():
|
|||
"ingest_data": ComponentInputHandle(
|
||||
clazz=TextToData, inputs={"text_data": ["test1", "test2"]}, output_name="from_text"
|
||||
),
|
||||
"embedding": ComponentInputHandle(
|
||||
"embedding_model": ComponentInputHandle(
|
||||
clazz=OpenAIEmbeddingsComponent,
|
||||
inputs={"openai_api_key": get_openai_api_key()},
|
||||
output_name="embeddings",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ def ingestion_graph():
|
|||
)
|
||||
vector_store = AstraVectorStoreComponent(_id="vector-store-123")
|
||||
vector_store.set(
|
||||
embedding=openai_embeddings.build_embeddings,
|
||||
embedding_model=openai_embeddings.build_embeddings,
|
||||
ingest_data=text_splitter.split_text,
|
||||
api_endpoint="https://astra.example.com",
|
||||
token="token", # noqa: S106
|
||||
|
|
@ -53,7 +53,7 @@ def rag_graph():
|
|||
search_input=chat_input.message_response,
|
||||
api_endpoint="https://astra.example.com",
|
||||
token="token", # noqa: S106
|
||||
embedding=openai_embeddings.build_embeddings,
|
||||
embedding_model=openai_embeddings.build_embeddings,
|
||||
)
|
||||
# Mock search_documents
|
||||
rag_vector_store.set_on_output(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue