Code Monkey home page Code Monkey logo

Comments (5)

mMrBun avatar mMrBun commented on July 21, 2024

你好,我这边在跑官方示例,我这边response一直是str不是dict,你是用的cli_demo的示例代码吗?

from chatglm3.

mMrBun avatar mMrBun commented on July 21, 2024

下面是我自己定的tool测试时模型返回内容

您可以使用以下API来查询北京的天气:

https://api.openweathermap.org/data/2.5/weather?q=Beijing&appid=YOUR_API_KEY


请将`YOUR_API_KEY`替换为您的OpenWeatherMap API密钥。您可以通过购买API密钥或使用免费试用来获得API密钥。

API响应将包括以下信息:

- location: 北京的英文名称
- country: **
- date: 查询当天的日期
- main: 天气主标签,包括温度、降水概率、风速等
- weather: 天气现象的列表
- city: 北京的中文名称
- sunrise: 查询当天的日出时间
- sunset: 查询当天的日落时间
- temperature: 查询当天的最高温度和最低温度
- feel_temp: 查询当天的感觉温度
- wind_direction: 查询当天的风向
- wind_speed: 查询当天的风力大小

您可以根据需要解析这些信息。

from chatglm3.

tanyinyan avatar tanyinyan commented on July 21, 2024

你好,我这边在跑官方示例,我这边response一直是str不是dict,你是用的cli_demo的示例代码吗?

试了一下,应该是stream_chat现在还不支持function calling。
前面截图用的model.stream_chat,返回的是str,所以解析错误。换成model.chat,可以返回dict了。

from chatglm3.

mMrBun avatar mMrBun commented on July 21, 2024

你好,我这边在跑官方示例,我这边response一直是str不是dict,你是用的cli_demo的示例代码吗?

试了一下,应该是stream_chat现在还不支持function calling。 前面截图用的model.stream_chat,返回的是str,所以解析错误。换成model.chat,可以返回dict了。

我之前用的32k的模型,不行,换成8k的就好了

from chatglm3.

duzx16 avatar duzx16 commented on July 21, 2024

因为工具调用的结果需要在生成内容的基础上做一些后处理,所以不能支持流式输出。
32K 模型的主要使用场景是长文档问答,所以没有进行工具调用的训练。

from chatglm3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.