中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

wordpress對應國家語言百度站長工具seo查詢

wordpress對應國家語言,百度站長工具seo查詢,產(chǎn)品做推廣都有那些網(wǎng)站,海外網(wǎng)站seo一、什么是智譜AI 智譜AI成立于2019年,由?清華大學計算機系知識工程實驗室的技術(shù)成果轉(zhuǎn)化而來,是一家致力于人工智能技術(shù)研發(fā)和應用的公司。智譜致力于打造新一代認知智能大模型,專注于做大模型的中國創(chuàng)新。 二、智譜開放平臺API調(diào)用 官方文…

一、什么是智譜AI

智譜AI成立于2019年,由?清華大學計算機系知識工程實驗室的技術(shù)成果轉(zhuǎn)化而來,是一家致力于人工智能技術(shù)研發(fā)和應用的公司。智譜致力于打造新一代認知智能大模型,專注于做大模型的中國創(chuàng)新。

?

二、智譜開放平臺API調(diào)用

官方文檔
https://open.bigmodel.cn/dev/api#http_para

?

創(chuàng)建應用
https://open.bigmodel.cn/usercenter/apikeys

?

?

Nodejs Http調(diào)用示例?

cnpm i request --save
const request = require('request')
async function main() {
let url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
let body = {
"model": "glm-4", // 模型選擇
"temperature": 0.9, //核采樣閾值,用于決定結(jié)果隨機性,取值越高隨機性越強,即相同
的問題得到的不同答案的可能性越高。取值范圍 (0,1)
"top-k": 4, //平衡生成文本的質(zhì)量和多樣性,較小的 k 值會減少隨機性,使得輸
出更加穩(wěn)定;而較大的 k 值會增加隨機性,產(chǎn)生更多新穎的輸出。取值范圍[1, 6],默認為4
"max_tokens": 1000, //模型回答的tokens的最大長度
"messages": [
{
"role": "system", //用于設(shè)置對話背景,角色設(shè)定
"content": "你是一個聰明且富有創(chuàng)造力的小說作家"
},
{
"role": "user",
"content": "你是誰"
}
],
}
header = {
"Authorization": "Bearer
8e67b3159ae070a71d71fe97fceb733b.Bf7fRh7Yy7uWxdDp", // 注意此處替換自己的key和
secret
'Content-Type': 'application/json'
}
var options = {
'method': 'POST',
'url': url,
'headers': header,
body: JSON.stringify(body)
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
}
main();

Golang Http調(diào)用示例?

package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://open.bigmodel.cn/api/paas/v4/chat/completions"
body := map[string]interface{}{
"model": "glm-4",
"temperature": 0.9,
"top-k": 4,
"max_tokens": 100,
"messages": []map[string]interface{}{
{
"role": "system",
"content": "你是一個聰明且富有創(chuàng)造力的小說作家",
},
{
"role": "user",
"content": "你是誰",
},
},
}
jsonBody, err := json.Marshal(body)
if err != nil {
fmt.Println("Error marshalling JSON:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Authorization", "Bearer
8e67b3159ae070a71d71fe97fceb733b.Bf7fRh7Yy7uWxdDp")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
var result map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&result)
if err != nil {
fmt.Println("Error decoding response:", err)
return
}
fmt.Println(result)
}

?Python Http調(diào)用示例

import requests
import json
# 定義請求的URL
url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
# 定義請求的body
body = {
"model": "glm-4",
"temperature": 0.9,
"top-k": 4,
"max_tokens": 100,
"messages": [
{
"role": "system",
"content": "你是一個聰明且富有創(chuàng)造力的小說作家"
},
{
"role": "user",
"content": "你是誰"
}
],
}
# 定義請求的headers
headers = {
"Authorization": "Bearer
8e67b3159ae070a71d71fe97fceb733b.Bf7fRh7Yy7uWxdDp",
'Content-Type': 'application/json'
}
# 發(fā)送POST請求
response = requests.post(url, headers=headers, data=json.dumps(body))
# 打印響應結(jié)果
print(response.json())

OpenAi調(diào)用示例 ?

https://github.com/openai/openai-node

?

https://github.com/openai/openai-python

?

https://github.com/sashabaranov/go-openai

?

官方文檔 調(diào)用示例:

?

https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_7
-%E4%BD%BF%E7%94%A8openai-sdk%E8%AF%B7%E6%B1%82%E7%A4%BA%E4%BE%8B

?

Python openAi

?

https://github.com/openai/openai-python

?

1、安裝依賴?

pip install openai

2、請求?

# https://github.com/openai/openai-python
# pip install openai
from openai import OpenAI
client = OpenAI(
api_key="8e67b3159ae070a71d71fe97fceb733b.Bf7fRh7Yy7uWxdDp",
base_url="https://open.bigmodel.cn/api/paas/v4/"
)
completion = client.chat.completions.create(
model="glm-4",
messages=[
{"role": "system", "content": "你是一個聰明且富有創(chuàng)造力的小說作家"},
{"role": "user", "content": "請你作為童話故事大王,寫一篇短篇童話故事,故事的主
題是要永遠保持一顆善良的心,要能夠激發(fā)兒童的學習興趣和想象力,同時也能夠幫助兒童更好地理解和接
受故事中所蘊含的道理和價值觀。"}
],
top_p=0.7,
temperature=0.9
)
print(completion.choices[0].message)
Nodejs openAi

?

https://github.com/openai/openai-node

?

安裝依賴

?

npm install openai --save
cnpm install openai --save

使用import 需要在package.json里面需要配置"type":"module", ?

{
"type": "module",
"dependencies": {
}
}

配置代碼 ?

import OpenAI from 'openai';
const client = new OpenAI({
apiKey: "8e67b3159ae070a71d71fe97fceb733b.Bf7fRh7Yy7uWxdDp",
baseURL: "https://open.bigmodel.cn/api/paas/v4/"
});
async function main() {
const chatCompletion = await client.chat.completions.create({
messages: [{ role: 'user', content: '你好' }],
model: 'GLM-4-Flash',
});
console.log(chatCompletion.choices[0].message.content);
}
main();

?

智譜開放平臺API調(diào)用視頻詳解:

【應用開發(fā)】分別用nodejs python golang Opne Ai調(diào)用 ChatGLM 智譜AI大模型的Api

?

?

?

?

?

?

?

?

?

?

?

?

?

http://www.risenshineclean.com/news/8005.html

相關(guān)文章:

  • 泰安網(wǎng)絡(luò)推廣長沙seo招聘
  • 網(wǎng)站建設(shè)官網(wǎng)怎么收費網(wǎng)址查詢域名解析
  • 管理咨詢網(wǎng)站網(wǎng)絡(luò)做推廣廣告公司
  • 多用戶商城系統(tǒng)網(wǎng)站建設(shè)上海seo顧問
  • 無錫哪家做網(wǎng)站好seo搜索引擎優(yōu)化課后答案
  • 長沙從寒網(wǎng)絡(luò)科技有限公司網(wǎng)站推廣與優(yōu)化平臺
  • 企業(yè)網(wǎng)站中( )是第一位的。惠州百度seo哪家好
  • 如何快速找到做網(wǎng)站的客戶站長素材網(wǎng)
  • 用wordpress做外貿(mào)網(wǎng)站b站推廣網(wǎng)站2024年
  • 企業(yè)對電子商務網(wǎng)站的建設(shè)網(wǎng)頁設(shè)計制作網(wǎng)站代碼
  • 做動圖的網(wǎng)站在哪里推廣自己的產(chǎn)品
  • 網(wǎng)站搭建素材百度總部電話
  • 網(wǎng)站建設(shè)叫什么軟件網(wǎng)絡(luò)營銷方式有哪些
  • 境外公司在國內(nèi)建網(wǎng)站黑馬it培訓班出來現(xiàn)狀
  • 音樂網(wǎng)站開發(fā)畢業(yè)論文創(chuàng)建網(wǎng)站需要多少資金
  • 網(wǎng)站建設(shè)初步認識的實訓體會行業(yè)網(wǎng)站有哪些平臺
  • 中山制作網(wǎng)站的公司西安網(wǎng)站推廣慧創(chuàng)科技
  • 互聯(lián)網(wǎng)下的網(wǎng)絡(luò)營銷前端seo是什么意思
  • 網(wǎng)站建設(shè)營銷方案整站外包優(yōu)化公司
  • 泉州北京網(wǎng)站建設(shè)如何制作app軟件
  • phpcms學校網(wǎng)站模板如何制作微信小程序店鋪
  • wordpress 社交分享肇慶seo排名外包
  • 網(wǎng)站倒計時代碼資源企業(yè)網(wǎng)站排名優(yōu)化價格
  • html制作網(wǎng)站的步驟網(wǎng)絡(luò)服務包括
  • 企業(yè)域名是什么網(wǎng)站seo關(guān)鍵詞設(shè)置
  • 網(wǎng)站設(shè)計營銷網(wǎng)站出租三級域名費用
  • 做視頻網(wǎng)站視頻的軟件企業(yè)營銷培訓課程
  • 女性時尚網(wǎng)站源碼客戶關(guān)系管理
  • 有沒有免費的微網(wǎng)站視頻營銷模式有哪些
  • 昭通網(wǎng)站建設(shè)如何提高網(wǎng)站排名的方法