• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yazinnnn0
V2EX  ›  程序员

求助, 大模型框架(llamaindex, langchain 等)如何读取 openapi spec, 生成相应 tool, 然后供的相关 agent 调用?

  •  
  •   yazinnnn0 · Jul 23, 2024 · 2113 views
    This topic created in 661 days ago, the information mentioned may be changed or developed.

    例如有如下的 spec, 该怎么将其转化为能够发送 http 请求的 tool, 然后给相应的 agent 去使用呢...

    ---
    openapi: 3.0.3
    info:
      title: openapi-server API
      version: "1.0"
    servers:
    - url: http://localhost:8080
    paths:
      /hello:
        get:
          tags:
          - Greeting Resource
          responses:
            "200":
              description: OK
              content:
                text/plain:
                  schema:
                    type: string
    
    
    1 replies    2024-07-24 09:57:57 +08:00
    Unboundwill
        1
    Unboundwill  
       Jul 24, 2024
    OpenAPI spec 转换为 SDK 有标准的工具: https://github.com/OpenAPITools/openapi-generator
    先调用 OpenAPI Generator 生成需要的 SDK ,再让 Agent 调用这个 SDK
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2902 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:39 · PVG 21:39 · LAX 06:39 · JFK 09:39
    ♥ Do have faith in what you're doing.