Skip to content
LlamaIndex 文档版本 跟随上游 源快照 2f681b85 更新于 2026-10-15

随着 LlamaIndex 持续演进,许多类名与 API 已经过调整、改进与弃用。

下面列出一些曾经流行、如今已弃用的术语,并附上其替代品的链接。

GPTSimpleVectorIndex

它已更名为 VectorStoreIndex,同时所有向量索引统一到了同一个接口。要对接各种向量数据库,只需修改底层的 vector_store。

用法细节请见以下链接。

GPTVectorStoreIndex

它已更名为 VectorStoreIndex,不过这只是名称上的变化。用法细节请见以下链接。

LLMPredictor

LLMPredictor 对象已不再供用户直接使用。你应当直接设置一个 LLM,再把它传给 Settings 或使用 LLM 的那个接口。LLM 类本身与 LLMPredictor 拥有相似的属性和方法。

PromptHelper 与 max_input_size/

prompt helper 的 max_input_size 参数已被 context_window 取代。

总体而言,PromptHelper 已弃用,改为直接在 service_context 与 node_parser 中指定相应参数。

更多细节见以下链接。

ServiceContext

ServiceContext 对象已弃用,改用 Settings 对象。

llama-index-legacy

llama-index-legacy 包已弃用并从仓库中移除。最新信息与用法请参见最新的入门指南。

AgentRunner/AgentWorker(及相关类)

AgentRunner 与 AgentWorker 类已弃用,改用 AgentWorkflow 与 Workflows。

其中包括以下已弃用的类:

  • AgentRunner
  • FunctionCallingAgent
  • FunctionCallingAgentWorker
  • llama_index.core.agent.ReActAgent (use llama_index.core.agent.workflow.ReActAgent)
  • ReActAgentWorker
  • LATSAgentWorker
  • CoAAgentWorker
  • FnAgentWorker
  • QueryPipelineAgentWorker
  • MultiModalReActAgentWorker
  • IntrospectiveAgentWorker
  • SelfReflectiveAgentWorker
  • ToolInteractiveReflectionAgentWorker
  • LLMCompilerAgentWorker
  • QueryUnderstandAgentWorker

QueryPipeline(及相关类)

QueryPipeline 已弃用,改用 Workflows。

其中包括以下已弃用的类:

  • AgentFnComponent
  • AgentInputComponent
  • BaseAgentComponent
  • CustomAgentComponent
  • ArgPackComponent
  • FnComponent
  • FunctionComponent
  • InputComponent
  • RouterComponent
  • SelectorComponent
  • ToolRunnerComponent
  • StatefulFnComponent
  • LoopComponent
  • etc.

BytesRouter 是社区翻译站点,所有译文仅供参考,一切以官方英文原文为准。