tool_runtime.rag_tool.insert not working

未关闭
#307 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

Reproduce the call through llama_stack_client.resources.tool_runtime.rag_tool.RagToolResource.insert and inspect the request failure reported at _base_client.py line 1054. Compare the generated request fields with the server's required vector_store_id field; done means the documented insert call no longer returns the 400 missing-field error.

由索引模型根据 Issue 内容生成。

描述

Hello,

I'm experiencing some incompatibility issues with the interaction between client and server, both installed from PyPy, version 0.3.2

An example of such is the following call:

client.tool_runtime.rag_tool.insert( documents=documents, vector_db_id=vs.id, chunk_size_in_tokens=512, )

which raises the error:

lib/python3.12/site-packages/llama_stack_client/_base_client.py", line 1054, in request raise self._make_status_error_from_response(err.response) from None llama_stack_client.BadRequestError: Error code: 400 - {'error': {'detail': {'errors': [{'loc': ['body', 'vector_store_id'], 'msg': 'Field required', 'type': 'missing'}]}}}

By looking at the API, the arguments passed to the client should be correct:

`insert(*, chunk_size_in_tokens: 'int', documents: 'Iterable[Document]', vector_db_id: 'str', extra_headers: 'Headers | None' = None, extra_query: 'Query | None' = None, extra_body: 'Body | None' = None, timeout: 'float | httpx.Timeout | None | NotGiven' = NOT_GIVEN) -> 'None' method of llama_stack_client.resources.tool_runtime.rag_tool.RagToolResource instance
Index documents so they can be used by the RAG system.

Args:
  chunk_size_in_tokens: (Optional) Size in tokens for document chunking during indexing

  documents: List of documents to index in the RAG system

  vector_db_id: ID of the vector database to store the document embeddings

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds

~`

System:
Linux ai 6.14.0-36-generic #36~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 15 15:45:17 UTC 2 x86_64 x86_64 x86_64 GNU/Linux Python 3.12.3

主要语言
Python
星标
197
派生
102
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ogx-ai/ogx-client-python 的其他 Issue

查看 ogx-ai/ogx-client-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。