camel [Feature Request] Tools search

7gs2gvoe  于 23天前  发布在  其他
关注(0)|答案(3)|浏览(29)

必需的先决条件

动机

功能让代理从提供的模式中搜索并选择工具。我们可能可以在具有 json schema / docstring 的任务上使用语义搜索。

def retrieve_tools(query: str, tools: List[OpenAIFunction], k: int = 3) -> List[OpenAIFunction]:
    ...
    # Using semantic search to retrieve relevent tools
    # OpenAI / Open source Embedding models to embed the query and the schemas / docstring of `OpenAIFunction`
    # Find the most relevent ones based on their embedding vectors
    return retrieved_tools

# An example:
retrieved_tools = retrieve_tools('how is the weather today', tools=[get_weather, google_search, send_tweet, create_pull_request], k=2)
# get_weather, google_search

# We can put the implementation here: https://github.com/camel-ai/camel/tree/master/camel/functions

@Hither1 将是这个 PR 的主要开发者。@yiyiyi0817 和 @Wendong-Fan 可以在她的过程中提供帮助。目标截止日期是5月30日。

解决方案

  • 无响应*

替代方案

  • 无响应*

其他上下文

  • 无响应*
zkure5ic

zkure5ic1#

我想知道我们是否假设功能/工具列表总是包含Camel框架中实现的所有其他功能?当没有与查询相关的工具时,函数应该返回什么?

e37o9pze

e37o9pze2#

@lightaime @Wendong-Fan @yiyiyi0817 我在想,我们是否假设功能/工具列表总是包含Camel框架中实现的所有其他功能?当没有与查询相关的工具时,函数应该返回什么?
我的想法是,我们可以对传入的function_list应用一个过滤器(现在可能是所有功能,或者用户选择的一些功能,或者根本不用),但过滤器不应该太严格,只需完全删除无关的功能。只是一个建议

zf9nrax1

zf9nrax13#

@lightaime@Wendong-Fan@yiyiyi0817 我在想,我们是否假设功能/工具列表总是包含Camel框架中实现的所有其他功能?当没有与查询相关的工具时,函数应该返回什么?

  1. 我们可以让用户指定功能/工具。
  2. 我们可以在相似度搜索上应用阈值。如果所有工具都低于阈值,我们可以返回 None

相关问题