V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yazinnnn0
V2EX  ›  程序员

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

  •  
  •   yazinnnn0 · 69 天前 · 893 次点击
    这是一个创建于 69 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如有如下的 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 条回复    2024-07-24 09:57:57 +08:00
    Unboundwill
        1
    Unboundwill  
       68 天前
    OpenAPI spec 转换为 SDK 有标准的工具: https://github.com/OpenAPITools/openapi-generator
    先调用 OpenAPI Generator 生成需要的 SDK ,再让 Agent 调用这个 SDK
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   814 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 21:40 · PVG 05:40 · LAX 14:40 · JFK 17:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.