chatGPT 付費版本的三種Model 選擇分別如下:
可以瞭解在推理、速度與認知上的差異
一、默認的GPT-3.5版
二、舊版的GPT-3.5版
三、新版的GPT-4
大型網站架構..net 架構師.rabbitMQ.redis.行動開發.APP開發教學.PHP Laravel開發..net core C# 開發.架構師之路.Delphi開發.資料庫程式.進銷存.餐飲POS系統
chatGPT 付費版本的三種Model 選擇分別如下:
可以瞭解在推理、速度與認知上的差異
一、默認的GPT-3.5版
二、舊版的GPT-3.5版
三、新版的GPT-4
透過微軟azure上的語音服務,辨識麥克風傳入的聲音後將語音轉成文字
接著再把文字送到open ai api中的chatgpt 模型中取得回應內容
最後再將回應內容透過語音合成送出
參考:
Introducing ChatGPT and Whisper APIs
https://openai.com/blog/introducing-chatgpt-and-whisper-apis
openai api
https://platform.openai.com/docs/guides/chat
Betalgo.OpenAI.GPT3
https://www.nuget.org/packages/Betalgo.OpenAI.GPT3/6.7.0
https://github.com/betalgo/openai
OpenAI設計的ChatGPT問世後,很快的ai的使用人數破億。且chatgpt讓ai整個流行了起來~ 想說台灣最流行的通訊工具line,有沒有機會跟chatgpt串到一起,於是很快的用php以及.net core都串了一次。簡單明瞭~很易懂
分享關鍵的php,有問題歡迎line: superlevin 林壽山
$api_key = 'xxxxxxxxxx';
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.openai.com/v1/completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $api_key
],
CURLOPT_POSTFIELDS => json_encode([
'prompt' => $ask_question,
'model' => 'text-davinci-003',
'max_tokens' => 1000,
'temperature' => 0.3
])
]);
$response = curl_exec($curl);
$json = json_decode($response, true);
看到DJI TELLO有SDK,幾個重點整理
1 使用的是UDP
2 IP是: 192.168.10.1
3 使用的PORT有 8889(指令) 8890(狀態) 11111(取得畫面)
程式碼大概就是
// 定義 IP
string DJIIP = "192.168.10.1";
//定義埠號
int DJIPort = 8889;
// 開啟
UdpClient udpClient = new UdpClient();
udpClient.Connect(DJIIP,DJIPort);
//
Byte[] sendCmdBytes = null;
sendCmdBytes = Encoding.UTF8.GetBytes(“takeoff”);
udpClient.Send(sendCmdBytes, sendCmdBytes.Length);
https://www.ryzerobotics.com/zh-tw
https://www.ryzerobotics.com/zh-tw/tello/downloads
從ChatGPT的api,取得文件後,再透過語音合成轉為base64音檔念出。
台灣雅婷 https://www.yating.tw/zh/api-text-to-speech-zh/
雅婷文字轉語音 https://tts.yating.tw/
文件 https://developer.yating.tw/doc/tts-%E8%AA%9E%E9%9F%B3%E5%90%88%E6%88%90#%E7%AF%84%E4%BE%8B
後台: https://developer.yating.tw/zh-TW/dashboard
其他參考
https://ai.baidu.com/tech/speech/tts
https://aws.amazon.com/tw/polly/
https://tw.piliapp.com/text-to-speech/
https://azure.microsoft.com/zh-tw/products/cognitive-services/text-to-speech/#overview
https://cloud.google.com/text-to-speech?hl=zh-tw
https://azure.microsoft.com/zh-tw/products/cognitive-services/text-to-speech/
https://www.xfyun.cn/services/online_tts
https://everest-ai.ximalaya.com/charm-studio/
static void DecodeBase64ToFile(string Base64String, string filenames)
{
try
{
byte[] bytes = Convert.FromBase64String(Base64String);
using (var fs = new FileStream(filenames, FileMode.Create, FileAccess.Write))
{
fs.Write(bytes, 0, bytes.Length);
fs.Flush();
}
}
catch (Exception e)
{
}
}
使用對的演算法與資料結構,在程式效能上有很大的幫助。常用的資料結構有array、stack、 queue、 linked list、 tree、 graph、 heap、 hash。在c#上常見的是使用array 、arraylist、 list、 dictonary 以及queue可以滿足絕大部份的場景。
以下介紹github上二個高階資料結構與演算法的項目。
一、C Sharp Algorithms
一開始是學習資料結構,在不斷更新以及維護後,可以用在正式環境。
https://github.com/aalhour/C-Sharp-Algorithms
二、Advanced Algorithms