mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-10 20:19:22 +00:00
Fixes
This commit is contained in:
parent
cab3d1d8cc
commit
3ce518322a
1 changed files with 9 additions and 12 deletions
|
@ -199,7 +199,8 @@ def create_library_client(template="ollama"):
|
||||||
|
|
||||||
|
|
||||||
client = (
|
client = (
|
||||||
create_library_client()
|
#create_library_client()
|
||||||
|
create_http_client()
|
||||||
) # or create_http_client() depending on the environment you picked
|
) # or create_http_client() depending on the environment you picked
|
||||||
|
|
||||||
# Documents to be used for RAG
|
# Documents to be used for RAG
|
||||||
|
@ -214,10 +215,17 @@ documents = [
|
||||||
for i, url in enumerate(urls)
|
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 first available vector provider
|
||||||
|
|
||||||
# Register a vector database
|
# Register a vector database
|
||||||
vector_db_id = f"test-vector-db-{uuid.uuid4().hex}"
|
vector_db_id = f"test-vector-db-{uuid.uuid4().hex}"
|
||||||
client.vector_dbs.register(
|
client.vector_dbs.register(
|
||||||
vector_db_id=vector_db_id,
|
vector_db_id=vector_db_id,
|
||||||
|
provider_id=provider_id,
|
||||||
embedding_model="all-MiniLM-L6-v2",
|
embedding_model="all-MiniLM-L6-v2",
|
||||||
embedding_dimension=384,
|
embedding_dimension=384,
|
||||||
)
|
)
|
||||||
|
@ -227,17 +235,6 @@ client.tool_runtime.rag_tool.insert(
|
||||||
documents=documents,
|
documents=documents,
|
||||||
vector_db_id=vector_db_id,
|
vector_db_id=vector_db_id,
|
||||||
chunk_size_in_tokens=512,
|
chunk_size_in_tokens=512,
|
||||||
vector_providers = [
|
|
||||||
provider for provider in client.providers.list() if provider.api == "vector_io"
|
|
||||||
]
|
|
||||||
|
|
||||||
vector_db_id = uuid.uuid4().hex
|
|
||||||
vector_db_register_response = client.vector_dbs.register(
|
|
||||||
vector_db_id=vector_db_id,
|
|
||||||
embedding_model="all-MiniLM-L6-v2",
|
|
||||||
embedding_dimension=384,
|
|
||||||
provider_id=vector_providers[0].provider_id,
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
agent_config = AgentConfig(
|
agent_config = AgentConfig(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue