Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改善function call的使用体验 #5

Open
wgzesg-bd opened this issue Feb 6, 2025 · 3 comments
Open

改善function call的使用体验 #5

wgzesg-bd opened this issue Feb 6, 2025 · 3 comments
Assignees

Comments

@wgzesg-bd
Copy link
Collaborator

  1. 支持ChatCompletionTool 和ToolManifest 直接转换
  2. 如果不设置apikey 或者aksk的环境变量就不能创建 ToolManifest 体验很奇怪
  3. 支持更pythonic的function call,用法大概如下
def add_two_number(a,b):
    return a+b

parameters = ArkChatParameters(**request.__dict__)
  parameters.tools = [
      add_two_number,
  ]

llm = BaseChatLanguageModel(
    endpoint_id=endpoint_id,
    messages=["what is 7234234 + 12312"],
    parameters=parameters,
)

resp = llm.arun()

参数类型可以支持基础数据类型,pydantic BaseModel, enum 等

@senw512
Copy link
Collaborator

senw512 commented Feb 7, 2025

赞呀,还有一个事儿想讨论一下 BaseChatLanguageModel 和 ark.chat_completions.create 有可能整合一下嘛,比如类似 automatic tool execute 功能组合的方法附着上来

优势:

  • 和 arkruntime 是一个渐进式的体验
  • 和 arkruntime 可以复用绝大部分 BaseModel

@wgzesg-bd
Copy link
Collaborator Author

长期来看arkitect 和volcengine-python-sdk这两个库会慢慢合并吗?目前感觉这两个库有挺多重复的结构体定义,比如里面message,tool 定义等等都大差不差,但还又有点不同,用起来还是有点confusing。

不过就automatic tool execute 那个功能我觉得可能得带上human in the loop 的设计 再想一下怎么实现

@senw512
Copy link
Collaborator

senw512 commented Feb 7, 2025

长期来看arkitect 和volcengine-python-sdk这两个库会慢慢合并吗?目前感觉这两个库有挺多重复的结构体定义,

长期会,最可行的方案还是把 volcengine-python-sdk 当作 arkitect 的依赖,然后尽可能的复用结构体,如果有区别地方应该是可以尽可能合并的,比如 ToolOutput

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants