From 9e03df983e780233ee47866b426fed735ca97f7d Mon Sep 17 00:00:00 2001 From: Alessandro Sangiorgi Date: Wed, 19 Feb 2025 17:37:25 -0600 Subject: [PATCH] fix(rag-example): add provider_id to avoid llama_stack_client 400 error (#1114) # What does this PR do? Add provider_id to avoid errors using the rag example with llama_stack_client `llama_stack_client.BadRequestError: Error code: 400 - {'detail': 'Invalid value: No provider specified and multiple providers available. Please specify a provider_id.'}` [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan [Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.*] [//]: # (## Documentation) --------- Co-authored-by: Xi Yan --- docs/source/getting_started/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/getting_started/index.md b/docs/source/getting_started/index.md index b28b9afa3..554f4354a 100644 --- a/docs/source/getting_started/index.md +++ b/docs/source/getting_started/index.md @@ -214,10 +214,16 @@ documents = [ for i, url in enumerate(urls) ] +vector_providers = [ + provider for provider in client.providers.list() if provider.api == "vector_io" +] +provider_id = vector_providers[0].provider_id # Use the first available vector provider + # Register a vector database vector_db_id = f"test-vector-db-{uuid.uuid4().hex}" client.vector_dbs.register( vector_db_id=vector_db_id, + provider_id=provider_id, embedding_model="all-MiniLM-L6-v2", embedding_dimension=384, )