把時(shí)間推回到250萬年前,舊石器時(shí)代見證了人類從簡單工具的使用者到復(fù)雜技術(shù)創(chuàng)造者的轉(zhuǎn)變。我們的祖先南方古猿、直立人等,逐步發(fā)展出更高級的工具,如手斧和刮刀,以適應(yīng)狩獵和生活的需求。大約4萬年前,現(xiàn)代人類——智人——的出現(xiàn)標(biāo)志著技術(shù)和文化的飛躍,工具進(jìn)一步精致化如骨針、魚鉤,藝術(shù)創(chuàng)作如洞穴壁畫和雕塑也隨之興起。這一時(shí)期,火的利用、語言和社會(huì)結(jié)構(gòu)的形成,為人類文明的后續(xù)發(fā)展奠定了堅(jiān)實(shí)的基礎(chǔ)。

我們無法保證大模型的“進(jìn)化”和人類的進(jìn)化史必定存在強(qiáng)相關(guān)性,不過,若以歷史作為教科書,解決問題的答案或許已在書中沉淀萬年。我們相信,大模型調(diào)用工具的能力(或稱作智能體能力)是解決前文問題的一種有效方法。

GLM-4-AllTools – 革新大模型API調(diào)用體驗(yàn)

我們在 bigmodel.cn[1]對最新的GLM-4-AllTools API進(jìn)行了評測。

GLM-4-AllTools: Chat API,集成了調(diào)用工具的能力,能夠自主使用多種工具組合和多輪對話來達(dá)成用戶任務(wù)。和傳統(tǒng)LLM API相比,GLM-4-AllTools API集成了五大核心功能,包括智能編程助手,安全代碼沙盒,實(shí)時(shí)聯(lián)網(wǎng)搜索,繪圖設(shè)計(jì)工具,函數(shù)調(diào)用能力。其中函數(shù)調(diào)用功能支持用戶自定義函數(shù),為進(jìn)階開發(fā)者提供了便利。當(dāng)模型識別到解決用戶輸入的請求需要搜索引擎時(shí),它會(huì)自動(dòng)激活內(nèi)置的聯(lián)網(wǎng)搜索功能,以提供實(shí)時(shí)且全面的搜索結(jié)果。搜索完成后,內(nèi)置的網(wǎng)頁瀏覽工具能夠打開并細(xì)致查看網(wǎng)頁內(nèi)容,從而進(jìn)行更深入的分析。此外,借助卓越的自我規(guī)劃能力和內(nèi)置的代碼沙盒、繪圖設(shè)計(jì)等工具,API能夠僅通過一次互動(dòng)就高效地處理復(fù)雜的任務(wù)。

下面請跟隨我們的腳步,我們將一步一步組合這些工具,測試GLM-4-AllTools的真正實(shí)力:

Case1: 實(shí)時(shí)查詢歐洲杯淘汰賽對陣

Tools: Web Search

代碼:

from zhipuai import ZhipuAI
client = ZhipuAI(api_key="Zhipu API Key") # 請?zhí)顚懩约旱腁PIKey

response = client.chat.completions.create(
model="glm-4-alltools", # 填寫需要調(diào)用的模型名稱
stream=True,
messages=[
{
"role": "user",
"content":[
{
"type":"text",
"text":"幫我查詢本屆歐洲杯淘汰賽對陣情況。"
}
]
}
],
tools=[
{
"type": "web_browser" #聯(lián)網(wǎng)搜索
},
]
)

for trunk in response:
if trunk.choices[0].delta.content is not None:
print(trunk.choices[0].delta.content, end="")

回復(fù):

2024年歐洲杯淘汰賽的對陣情況如下:

- 6月30日:
- 瑞士 vs 意大利(00:00)
- 德國 vs 丹麥(03:00)

- 7月1日:
- 英格蘭 vs 斯洛伐克(00:00)
- 西班牙 vs 格魯吉亞(03:00)

- 7月2日:
- 法國 vs 比利時(shí)(00:00)
- 葡萄牙 vs 斯洛文尼亞(03:00)

- 7月3日:
- 荷蘭 vs 羅馬尼亞(00:00)
- 奧地利 vs 土耳其(03:00)

請注意,以上時(shí)間均為北京時(shí)間。

Case2: 查詢慕尼黑天氣,自動(dòng)繪畫天氣曲線

Tools: Web Search, Code Interpreter, Sandbox

from zhipuai import ZhipuAI
client = ZhipuAI(api_key="") # 請?zhí)顚懩约旱腁PIKey

response = client.chat.completions.create(
model="glm-4-alltools", # 填寫需要調(diào)用的模型名稱
stream=True,
messages=[
{
"role": "user",
"content":[
{
"type":"text",
"text":"幫我查詢慕尼黑07/05至07/15的日平均氣溫。并將所有平均氣溫?cái)?shù)值組成數(shù)列,繪出折線圖顯示趨勢。"
}
]
}
],
tools=[
{
"type": "web_browser"
},
{
"type": "code_interpreter", #智能編程助手
},
]
)

for trunk in response:
print(trunk)
if trunk.choices[0].delta.content is not None:
print(trunk.choices[0].delta.content, end="")

回復(fù):這次我們進(jìn)入到GLM-4-AllTools API的工作流中,看看模型為了解決Case2執(zhí)行了哪些步驟:

#search
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': 'search'})]), finish_reason=None, index=0)], created=1720460600, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': '("'})]), finish_reason=None, index=0)], created=1720460600, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': 'M'})]), finish_reason=None, index=0)], created=1720460600, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': 'un'})]), finish_reason=None, index=0)], created=1720460600, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': 'ich'})]), finish_reason=None, index=0)], created=1720460600, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' average'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' temperature'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' July'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' '})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': '5'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' to'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ' July'})]), finish_reason=None, index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
...
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_bwN-_DC2XvXuP2meMxKzd', function=None, type='web_browser', web_browser={'input': ''})]), finish_reason='tool_calls', index=0)], created=1720460601, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='tool', tool_calls=[ChoiceDeltaToolCall(index=None, id=None, function=None, type='web_browser', web_browser={'outputs': [{'title': 'Weather in Munich in July 2024', 'link': 'https://world-weather.info/forecast/germany/munich/july-2024/', 'content': 'Detailed ? Munich Weather Forecast for July 2024 – day/night ??? temperatures, precipitations – World-Weather.info'}, {'title': 'Munich, Bavaria, Germany Monthly Weather | AccuWeather', 'link': 'https://www.accuweather.com/en/de/munich/80331/july-weather/178086', 'content': 'Get the monthly weather forecast for Munich, Bavaria, Germany, including daily high/low, historical averages, to help you plan ahead.'}, {'title': 'Munich, Bavaria Weather Forecast July 2024: Daily Highs/Lows & Rain Trends', 'link': 'https://www.weathertab.com/en/c/e/07/federal-republic-of-germany/bavaria/munich/', 'content': 'Explore comprehensive July 2024 weather forecasts for Munich, including daily high and low temperatures, precipitation risks, and monthly temperature trends. Featuring detailed day-by-day forecasts, dynamic graphs of daily rain probabilities, and temperature trends to help you plan ahead.'}, {'title': 'Yearly & Monthly weather - Munich, Germany', 'link': 'https://www.weather-atlas.com/en/germany/munich-climate', 'content': 'Detailed climate information with charts - average monthly weather with temperature, pressure, humidity, precipitation, wind, daylight, sunshine, visibility, and UV index data. Munich sees longer daylight hours from 15.2 hours up to 16 hours from May to July, while the shortest daylight hours ranging from 8.5 hours to 8.9 hours happens between ...'}, {'title': 'Munich climate: weather by month, temperature, rain - Climates to Travel', 'link': 'https://www.climatestotravel.com/climate/germany/munich', 'content': 'At the former Munich-Riem airport, the daily average temperature ranges from -0.4 °C (31.4 °F) in January to 18.6 °C (65.5 °F) in July. Here are the average temperatures. Precipitation is quite abundant, around 950 millimeters (37.5 inches) per year.'}, {'title': 'July weather - Summer 2024 - Munich, Germany', 'link': 'https://www.weather-atlas.com/en/germany/munich-weather-july', 'content': 'Average high temperature in July: 23.1°C; The warmest month (with the highest average high temperature) is July (23.1°C). The month with the lowest average high temperature is January (2.7°C). Average low temperature in July: 12.6°C; The month with the highest average low temperature is July (12.6°C).'}, {'title': 'Munich weather in July 2024 | Sunheron', 'link': 'https://www.sunheron.com/europe/germany/bavaria/munich-weather-july/', 'content': 'The average daily temperature in July in Munich is 25 °C (78 °F). The ideal temperature for enjoying sunbathing by the water and a good temperature for other activities. For some people, it will be too hot in the direct sunlight and the stay may not be so pleasant.'}, {'title': 'Munich in july: average Weather, Temperature and Climate', 'link': 'https://www.whereandwhen.net/when/europe/germany/munich/july/', 'content': 'The weather in july in Munich is wet (with 6.9in of precipitation over 10 days). This is better than the previous month since in june it receives an average of 7.8in of precipitation over 12 days. The climate comfortable in that locality this month. Temperatures are up to 76°F. The seasonal minimum is 63°F.'}, {'title': 'Munich weather in July 2024 | Germany: How hot? - Weather2Travel.com', 'link': 'https://www.weather2travel.com/germany/munich/july/', 'content': 'Munich weather in July 2024. Expect 23°C daytime maximum temperatures in the shade with on average 8 hours of sunshine per day in Munich in July. Check more long-term weather averages for Munich in July before you book your next holiday to Germany in 2024/2025.'}]})]), finish_reason=None, index=0)], created=1720460602, model='glm-4-alltools', usage=None, extra_json=None)
...
...
#code interpreter, simulate in sandbox
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '\n'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': 'plt'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '.'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': 'grid'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '('})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': 'True'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': ')'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '\n'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': 'plt'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '.'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': 'show'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': '()'})]), finish_reason=None, index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_ByzIxpcobsFBHhonh9UgI', function=None, type='code_interpreter', code_interpreter={'input': ''})]), finish_reason='tool_calls', index=0)], created=1720460616, model='glm-4-alltools', usage=None, extra_json=None)
ChatCompletionChunk(id='8822098568301210663', choices=[Choice(delta=ChoiceDelta(content=None, role='tool', tool_calls=[ChoiceDeltaToolCall(index=None, id=None, function=None, type='code_interpreter', code_interpreter={'outputs': [{'type': 'file', 'file': 'http://all-tool-interpreter.cn-wlcb.ufileos.com/3776fa6a-c175-457b-8911-0a697383fb03_fig.png?UCloudPublicKey=TOKEN_69f58d9b-ddb3-4bd0-9b29-5a4fe422c720&Expires=1720467819&Signature=dEJgDv6+/HkQokVWmJidf39WxpU='}]})]), finish_reason=None, index=0)], created=1720460619, model='glm-4-alltools', usage=None, extra_json=None)

最后返圖:

Case3: Function Calling

Tools: Code Interpreter, Sandbox

#完整代碼
from zhipuai import ZhipuAI
client = ZhipuAI(api_key="") # 請?zhí)顚懩约旱腁PIKey

response = client.chat.completions.create(
model="glm-4-alltools", # 填寫需要調(diào)用的模型名稱
stream=True,
messages=[
{
"role": "user",
"content":[
{
"type":"text",
"text":"幫我查詢慕尼黑07/05至07/15的日平均氣溫。并用日平均氣溫?cái)?shù)列繪出折線圖顯示趨勢。"
}
]
}
],
tools=[
{
"type": "function",
"function": {
"name": "get_average_temperature_data_by_date",
"description": "用于匯總某地某段時(shí)間內(nèi)的日平均氣溫,輸入地點(diǎn)(city),日期范圍(from_day,to_day),返回對應(yīng)的日平均氣溫?cái)?shù)列。",
"parameters": {
"type": "object",
"properties": {
"from_day": {
"description": "開始日期,格式為mm/dd",
"type": "string"
},
"to_day": {
"description": "截止日期,格式為mm/dd",
"type": "string"
},
"avg_temperature": {
"description": "平均氣溫",
"type": "string"
},
"required": ["city","from_day","to_day"]
},
}
}
},

{
"type": "code_interpreter",
},
]
)

for trunk in response:
print(trunk)
if trunk.choices[0].delta.content is not None:
print(trunk.choices[0].delta.content, end="")

需要調(diào)用函數(shù) Function Call,模型會(huì)返回 status=’requires_action’

ChatCompletionChunk(id='8822109666497191178', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=[ChoiceDeltaToolCall(index=None, id='call_cPf6NnnlWzSB0Fm7ZpgUF', function=ChoiceDeltaToolCallFunction(arguments='{"city":"慕尼黑"," from_day":"07/05"," to_day":"07/15"}', name='get_average_temperature_data_by_date'), type='function')]), finish_reason='tool_calls', index=0)], created=1720463116, model='glm-4-alltools', usage=CompletionUsage(prompt_tokens=435, completion_tokens=50, total_tokens=485), extra_json=None, status='requires_action')

添加函數(shù)調(diào)用的執(zhí)行結(jié)果(Tool Message),以及模型生成的函數(shù)參數(shù)(Assistant Message)。

messages=[
{
"role": "user",
"content":[
{
"type":"text",
"text":"幫我查詢慕尼黑07/05至07/15的日平均氣溫。并用日平均氣溫?cái)?shù)列繪出折線圖顯示趨勢。"
}
]
},
{
"role": "assistant",
"content":"arguments='{city\":\"慕尼黑\", \"from_day\":\"07/05\",\" to_day\":\"07/15\"}', name='get_average_temperature_data_by_date'"
},
{
"role": "tool",
"content": "[21.7, 16.6, 29.2, 25.0, 22.2, 25.9, 18.8, 22.2, 26.2, 26.1, 19.6]"
}
],
#執(zhí)行
ChatCompletionChunk(id='8822109666497168900', choices=[Choice(delta=ChoiceDelta(content=None, role='tool', tool_calls=[ChoiceDeltaToolCall(index=None, id=None, function=None, type='code_interpreter', code_interpreter={'outputs': [{'type': 'file', 'file': 'http://all-tool-interpreter.cn-wlcb.ufileos.com/b9200b5b-73ed-4893-8187-1f7a1ab1c7d1_fig.png?UCloudPublicKey=TOKEN_69f58d9b-ddb3-4bd0-9b29-5a4fe422c720&Expires=1720470579&Signature=oSMDBUI6hDdZboES85CZUxgAZRc='}]})]), finish_reason=None, index=0)], created=1720463379, model='glm-4-alltools', usage=None, extra_json=None)

每次GLM-4-AllTools API調(diào)用結(jié)束,都會(huì)在最后的ChatCompletionChunk返回此次調(diào)用的Token使用情況,幫助用戶進(jìn)行及時(shí)快速監(jiān)測。

#計(jì)費(fèi)
ChatCompletionChunk(id='8822109735216674822', choices=[Choice(delta=ChoiceDelta(content=None, role='assistant', tool_calls=None), finish_reason='stop', index=0)], created=1720462433, model='glm-4-alltools', usage=CompletionUsage(prompt_tokens=1518, completion_tokens=313, total_tokens=1831), extra_json=None, status='completed'

總結(jié):一番體驗(yàn)下來我對 GLM-4-AllTools API 是越用越喜歡,它主要有以下幾個(gè)優(yōu)點(diǎn):

不過也存在一些小缺點(diǎn):

關(guān)于MaaS平臺

大模型MaaS開放平臺(bigmodel.cn)目前提供了GLM系列模型的API調(diào)用支持,包括通用模型、圖像模型、embedding模型等。可以在文檔中查看相關(guān)說明,并在體驗(yàn)中心進(jìn)行快速體驗(yàn)。

通過這次體驗(yàn),我確確實(shí)實(shí)感受到了 GLM-4-AllTools API 給用戶體驗(yàn)帶來的提升,以及為開發(fā)者帶來的便利,希望國內(nèi)大模型廠商不斷推出更強(qiáng)大的產(chǎn)品,共同助力中國大模型以及大模型產(chǎn)業(yè)的發(fā)展。

參考資料

[1]Maas 開放平臺:http://bigmodel.cn/

文章轉(zhuǎn)自微信公眾號@深度學(xué)習(xí)自然語言處理

上一篇:

如何在MindSearch中集成新的搜索API,全面提升智能搜索能力!

下一篇:

Mem0 AI:開源一天斬獲萬星!超越 RAG、為LLM、Agent加上超強(qiáng)個(gè)性記憶
#你可能也喜歡這些API文章!

我們有何不同?

API服務(wù)商零注冊

多API并行試用

數(shù)據(jù)驅(qū)動(dòng)選型,提升決策效率

查看全部API→
??

熱門場景實(shí)測,選對API

#AI文本生成大模型API

對比大模型API的內(nèi)容創(chuàng)意新穎性、情感共鳴力、商業(yè)轉(zhuǎn)化潛力

25個(gè)渠道
一鍵對比試用API 限時(shí)免費(fèi)

#AI深度推理大模型API

對比大模型API的邏輯推理準(zhǔn)確性、分析深度、可視化建議合理性

10個(gè)渠道
一鍵對比試用API 限時(shí)免費(fèi)