2023-12-20 14:34:31 [显示全部楼层]
36687浏览
查看: 36687|回复: 1

[教程] 使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...

[复制链接]
最近做了一个项目,使用 OpenAI 的GPT(生成式预训练变压器)技术和Azure语音API构建AI桌面助手。OpenAI GPT是一种尖端的自然语言处理模型,可以理解并生成类似人类的文本,从而简化与计算机的通信。再加上Azure Speech API的语音识别功能。


该项目的灵感来自于11月8日发生的科技行业标志性事件——OpenAI 开发者大会会议。会议期间,OpenAI展示了跨模态交互,并介绍了GPT商店(GPTs),这是一系列基于GPT技术的应用程序集合,每个应用程序都在各自的领域提供专家级的服务。跨模态交互和GPT商店的引入为我的AI桌面助手项目开辟了一种新方法,使其能够利用自然语言处理和语音交互来执行更复杂的任务。

为了实现这个项目,我选择了 Unihiker 来实现它的硬件。该设备具有内置触摸屏、Wi-Fi、蓝牙以及用于光、运动和陀螺仪测量的传感器。其协处理器非常适合与外部传感器和执行器交互,并且提供的 Python 库显着简化了设备控制。下面我将介绍这款集成了Microsoft Azure和OpenAI GPT的AI桌面助手的开发过程,并分享一种仅使用OpenAI API创建智能语音桌面代理的替代方法。

项目代码文件可以从github下载:https://github.com/zzzqww/DFRobot/tree/main/Unihiker%2BGPT

第一部分:准备硬件

1. 硬件


对于我们的小型化桌面产品的硬件集成,我选择了10cm的电源延长线,以便于充电口的设计更加合理。同时,我们将功放与双声道扬声器相结合,在小尺寸的情况下也能保证高品质的声音播放。

放大器的连接接口需要直接焊接到Unihiker上的焊点上,如下图所示。

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图1


硬件清单:
  • 行空板 X1
  • 3W迷你音频立体声放大器 X1
  • 扬声器 X2
  • Type-C延长线 X1


2、模型打印
3D 打印文件链接:https://www.thingiverse.com/thing:6307018

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图2


在设计上,我的模型将电源端口与品牌IP的形状融为一体,其中“顶部的圆圈”是一个圆形。用作电源按钮。

在安装过程中,为了最大化内部空间,需要特定的组装顺序。将扬声器固定到位后,应将其从顶部提起,以便将 Unihiker 从底部插入。一旦Unihiker固定在屏幕固定位置,即可将声卡推入,完成成功安装。

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图3

第二部分:软件编程

第一种方法:GPT&天蓝色

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图4

为了实现这个功能,我们需要结合多个库和API来进行语音识别、文本转语音以及与GPT模型的交互。

首先我们需要注册 azure 和 openai,以确保“azure.speech_key”和“openai.api_key”可以使用。

如何注册 Azure 并获取 API 密钥,请查看此教程:https://community.dfrobot.com/makelog-313501.html

如何查找openai的api密钥,请查看此链接:
< i=3>https://help.openai.com/en/artic ... o-i-find-my-api-key

注册完这两个平台的API后,检查Azure的“speech_key”和“service_region”以及OpenAI的“openai.api_key”。这两个设置稍后会用到。

拿到API后,开始编写python程序。

这些功能都是基于网络接口的,所以Unihiker行空板需要先连接网络。如何连接unihiker进行编程,请查看》:
https://www .unihiker.com/wiki/connection


使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图5

1.导入库和模块
- unihiker.Audio:提供音频相关功能。
- unihiker.GUI:创建图形用户界面 (GUI)。
- openai :用于与 OpenAI 模型交互。
- time:提供时间相关的功能。
- os:提供操作系统相关的功能。
- azure.cognitiveservices.speech.SpeechConfig:提供语音相关功能。

上传代码前,请确保Unihiker上已安装OpenAI库。输入“pip install openai”;和“pip install azure.cognitiveservices.speech”在终端中一一进行,等待安装成功完成,如下图所示。

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图6

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图7

代码:
  1. <font face="微软雅黑">
  2. from unihiker import Audio
  3. from unihiker import GUI
  4. import openai
  5. import time
  6. import os
  7. from azure.cognitiveservices.speech import SpeechConfig</font>
复制代码

2. 设置按键和区域:

使用您的密钥和位置/区域创建实例。

- voice_key:指定 Azure 语音服务的密钥。
- service_region:指定Azure 语音服务的区域/位置。

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图8

代码:
  1. <font face="微软雅黑">
  2. speech_key = "xxxxx" # Fill key
  3. service_region = "xxx" # Enter Location/Region</font>
复制代码

3. 设置 OpenAI API 密钥:

- openai.api_key:设置与 OpenAI GPT 模型交互的 API 密钥。

代码:
  1. <font face="微软雅黑">
  2. openai.api_key = "xxxxxxxxxxx" #input OpenAI api key</font>
复制代码

4.导入Azure语音SDK:

- 代码尝试导入天蓝色。gnitiveservices.speech 模块并在导入失败时打印错误消息。

代码:
  1. <font face="微软雅黑"> try:
  2.     import azure.cognitiveservices.speech as speechsdk
  3. except ImportError:
  4.     print("""
  5.     Importing the Speech SDK for Python failed.
  6.     Refer to
  7.     https://docs.microsoft.com/azure/cognitive-services/speech-service/quickstart-python for
  8.     installation instructions.
  9.     """)
  10.     import sys
  11.     sys.exit(1)</font>
复制代码

5.功能:识别默认麦克风的语音

· 使用默认麦克风合成语音

· recognize_once_async:

以非阻塞(异步)模式进行识别。这将识别单个话语。单个话语的结束是通过监听末尾的静音或直到处理最多 15 秒的音频来确定的。

代码:
  1. <font face="微软雅黑"># speech to text
  2. def recognize_from_microphone():
  3.     # This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
  4.     audio_config = speechsdk.audio.AudioConfig(use_default_microphone=True)
  5.     speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
  6.     speech_recognition_result = speech_recognizer.recognize_once_async().get()
  7.     # Exception reminder
  8.     if speech_recognition_result.reason == speechsdk.ResultReason.RecognizedSpeech:
  9.         return speech_recognition_result.text
  10.     elif speech_recognition_result.reason == speechsdk.ResultReason.NoMatch:
  11.         print("No speech could be recognized: {}".format(speech_recognition_result.no_match_details))
  12.     elif speech_recognition_result.reason == speechsdk.ResultReason.Canceled:
  13.         cancellation_details = speech_recognition_result.cancellation_details
  14.         print("Speech Recognition canceled: {}".format(cancellation_details.reason))
  15.         if cancellation_details.reason == speechsdk.CancellationReason.Error:
  16.             print("Error details: {}".format(cancellation_details.error_details))
  17.             print("Did you set the speech resource key and region values?")</font>
复制代码

6. tts(text):使用Azure Speech SDK将文本转换为语音。

· 使用默认扬声器播放语音

代码:
  1. <font face="微软雅黑"># text to speech
  2. def tts(text):
  3.     speech_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceResponse_RequestSentenceBoundary, value='true')
  4.     audio_config = speechsdk.audio.AudioOutputConfig(use_default_speaker=True)
  5.     speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
  6.     speech_synthesizer.synthesis_word_boundary.connect(speech_synthesizer_word_boundary_cb)
  7.     speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()</font>
复制代码

7.speech_synthesizer_word_boundary_cb(evt):

处理语音合成过程中单词边界的回调函数。达到单词依次出现的效果。

代码:
  1. <font face="微软雅黑"> # display text one by one
  2. def speech_synthesizer_word_boundary_cb(evt: speechsdk.SessionEventArgs):
  3.     global text_display
  4.     if not (evt.boundary_type == speechsdk.SpeechSynthesisBoundaryType.Sentence):
  5.         text_result = evt.text
  6.         text_display = text_display + "   " + text_result
  7.         trans.config(text = text_display)
  8.    
  9.     if evt.text == ".":
  10.         text_display = ""</font>
复制代码

8.askOpenAI(question):向OpenAI GPT模型发送问题并返回生成的答案。(可以选择其他版本的gpt型号)

代码:
  1. <font face="微软雅黑">
  2. # openai
  3. def askOpenAI(question):
  4.     completion = openai.ChatCompletion.create(
  5.         model="gpt-3.5-turbo",
  6.         messages = question
  7.     )
  8.     return completion['choices'][0]['message']['content']</font>
复制代码

9.事件回调函数:

-button_click1():将flag变量设置为1。
-button_click2():将flag变量设置为3。

代码:
  1. <font face="微软雅黑">
  2. def button_click1():
  3.     global flag
  4.     flag = 1
  5. def button_click2():
  6.     global flag
  7.     flag = 3</font>
复制代码

10.语音服务配置:
  • voice_config:使用提供的语音键、区域、语言和语音设置配置 Azure 语音 SDK。
  • 图形用户界面初始化:
  • 语音服务中的文本转语音功能支持 400 多种语音和 140 多种语言及其变体。您可以获取完整列表或在语音库中尝试 (


https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)。

代码:
  1. <font face="微软雅黑">
  2. # speech service configuration
  3. speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)
  4. speech_config.speech_synthesis_language = 'en-US'
  5. speech_config.speech_synthesis_voice_name = "en-US-JennyNeural"</font>
复制代码

(语音按优先级顺序确定,如下:
  • 如果未设置 SpeechSynthesisVoiceName 或 SpeechSynthesisLanguage,则默认声音为 en-US。
  • 如果仅设置了 SpeechSynthesisLanguage,则朗读指定语言环境的默认语音。
  • 如果同时设置了 SpeechSynthesisVoiceName 和 SpeechSynthesisLanguage,则 SpeechSynthesisLanguage 会忽略此设置。您将使用 SpeechSynthesisVoiceName 指定的语音进行朗读.
  • 如果您使用语音合成标记语言 (SSML) 设置语音元素,则 SpeechSynthesisVoiceName 和 SpeechSynthesisLanguage 设置将被忽略。)


11.初始化 GUI 和音频对象:

- u_gui:从 unihiker 库创建 GUI 类的实例。
- u_audio:从 unihiker 库创建 Audio 类的实例unihiker 库。
- 创建和配置各种 GUI 元素,例如图像、按钮和文本。
- 屏幕分辨率为 240x320,因此 unihiker 库分辨率为也是 240x320。坐标原点为屏幕左上角,x轴正方向向右,y轴正方向向下。坐标原点为屏幕左上角,x轴正方向向右,y轴正方向向下。一个>

代码:
  1. <font face="微软雅黑">u_gui=GUI()
  2. u_audio = Audio()
  3. # GUI initialization
  4. img1=u_gui.draw_image(image="background.jpg",x=0,y=0,w=240)
  5. button=u_gui.draw_image(image="mic.jpg",x=13,y=240,h=60,onclick=button_click1)
  6. refresh=u_gui.draw_image(image="refresh.jpg",x=157,y=240,h=60,onclick=button_click2)
  7. init=u_gui.draw_text(text="Tap to speak",x=27,y=50,font_size=15, color="#00CCCC")
  8. trans=u_gui.draw_text(text="",x=2,y=0,font_size=12, color="#000000")
  9. trans.config(w=230)
  10. result = ""
  11. flag = 0
  12. text_display = ""
  13. message = [{"role": "system", "content": "You are a helpful assistant."}]
  14. user = {"role": "user", "content": ""}
  15. assistant = {"role": "assistant", "content": ""}</font>
复制代码

12.主循环:代码进入无限循环,不断检查flag变量的值,并根据其值执行相应的操作。

当flag为0时,GUI按钮启用。当flag为3时,消息列表被清空,并添加系统消息。当flag为2时,代码通过发送消息列表并生成响应来与OpenAI模型交互。然后将响应合成为语音。

当标志为 1 时,代码侦听来自麦克风的语音输入,将用户的消息添加到消息列表,并使用识别的文本更新 GUI。

代码:
  1. <font face="微软雅黑">
  2. while True:
  3.     if (flag == 0):
  4.         button.config(image="mic.jpg",state="normal")
  5.         refresh.config(image="refresh.jpg",state="normal")
  6.         
  7.     if (flag == 3):
  8.         message.clear()
  9.         message = [{"role": "system", "content": "You are a helpful assistant."}]
  10.     if (flag == 2):
  11.         azure_synthesis_result = askOpenAI(message)
  12.         assistant["content"] = azure_synthesis_result
  13.         message.append(assistant.copy())
  14.         tts(azure_synthesis_result)
  15.         time.sleep(1)
  16.         
  17.         flag = 0
  18.         trans.config(text="      ")
  19.         button.config(image="",state="normal")
  20.         refresh.config(image="",state="normal")
  21.         init.config(x=15)
  22.    
  23.     if (flag == 1):
  24.         init.config(x=600)
  25.         trans .config(text="Listening。。。")
  26.         button.config(image="",state="disable")
  27.         refresh.config(image="",state="disable")
  28.         result = recognize_from_microphone()
  29.         user["content"] = result
  30.         message.append(user.copy())
  31.         trans .config(text=result)
  32.         time.sleep(2)
  33.         trans .config(text="Thinking。。。")
  34.         flag = 2</font>
复制代码

第一种方法中的完整代码:GPT &天蓝色

代码:
  1. <font face="微软雅黑"> from unihiker import Audio
  2. from unihiker import GUI
  3. import openai
  4. import time
  5. import os
  6. from azure.cognitiveservices.speech import SpeechConfig
  7. speech_key = "xxxxxxxxx" # Fill key
  8. service_region = "xxxxx" # Enter Location/Region
  9. openai.api_key = "xxxxxxxxxx" # inputOpenAI api key
  10. try:
  11.     import azure.cognitiveservices.speech as speechsdk
  12. except ImportError:
  13.    
  14.     print("""
  15.     Importing the Speech SDK for Python failed.
  16.     Refer to
  17.     https://docs.microsoft.com/azure/cognitive-services/speech-service/quickstart-python for
  18.     installation instructions.
  19.     """)
  20.     import sys
  21.     sys.exit(1)
  22. # Set up the subscription info for the Speech Service:
  23. # Replace with your own subscription key and service region (e.g., "japaneast").
  24. # speech to text
  25. def recognize_from_microphone():
  26.     # This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
  27.     audio_config = speechsdk.audio.AudioConfig(use_default_microphone=True)
  28.     speech_recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)
  29.     speech_recognition_result = speech_recognizer.recognize_once_async().get()
  30.     # Exception reminder
  31.     if speech_recognition_result.reason == speechsdk.ResultReason.RecognizedSpeech:
  32.         # print("Recognized: {}".format(speech_recognition_result.text))
  33.         return speech_recognition_result.text
  34.     elif speech_recognition_result.reason == speechsdk.ResultReason.NoMatch:
  35.         print("No speech could be recognized: {}".format(speech_recognition_result.no_match_details))
  36.     elif speech_recognition_result.reason == speechsdk.ResultReason.Canceled:
  37.         cancellation_details = speech_recognition_result.cancellation_details
  38.         print("Speech Recognition canceled: {}".format(cancellation_details.reason))
  39.         if cancellation_details.reason == speechsdk.CancellationReason.Error:
  40.             print("Error details: {}".format(cancellation_details.error_details))
  41.             print("Did you set the speech resource key and region values?")
  42. # text to speech
  43. def tts(text):
  44.     speech_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceResponse_RequestSentenceBoundary, value='true')
  45.     audio_config = speechsdk.audio.AudioOutputConfig(use_default_speaker=True)
  46.     speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
  47.     speech_synthesizer.synthesis_word_boundary.connect(speech_synthesizer_word_boundary_cb)
  48.     speech_synthesis_result = speech_synthesizer.speak_text_async(text).get()
  49. # display text one by one
  50. def speech_synthesizer_word_boundary_cb(evt: speechsdk.SessionEventArgs):
  51.     global text_display
  52.     if not (evt.boundary_type == speechsdk.SpeechSynthesisBoundaryType.Sentence):
  53.         text_result = evt.text
  54.         text_display = text_display + "   " + text_result
  55.         trans.config(text = text_display)
  56.    
  57.     if evt.text == ".":
  58.         text_display = ""
  59. # openai
  60. def askOpenAI(question):
  61.     completion = openai.ChatCompletion.create(
  62.         model="gpt-3.5-turbo",
  63.         messages = question
  64.     )
  65.     return completion['choices'][0]['message']['content']
  66. # speech service configuration
  67. def button_click1():
  68.     global flag
  69.     flag = 1
  70. def button_click2():
  71.     global flag
  72.     flag = 3
  73. u_gui=GUI()
  74. u_audio = Audio()
  75. # speech service configuration
  76. speech_config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)
  77. speech_config.speech_synthesis_language = 'en-US'
  78. speech_config.speech_synthesis_voice_name = "en-US-JennyNeural"
  79. # GUI initialization
  80. img1=u_gui.draw_image(image="background.jpg",x=0,y=0,w=240)
  81. button=u_gui.draw_image(image="mic.jpg",x=13,y=240,h=60,onclick=button_click1)
  82. refresh=u_gui.draw_image(image="refresh.jpg",x=157,y=240,h=60,onclick=button_click2)
  83. init=u_gui.draw_text(text="Tap to speak",x=27,y=50,font_size=15, color="#00CCCC")
  84. trans=u_gui.draw_text(text="",x=2,y=0,font_size=12, color="#000000")
  85. trans.config(w=230)
  86. result = ""
  87. flag = 0
  88. text_display = ""
  89. message = [{"role": "system", "content": "You are a helpful assistant."}]
  90. user = {"role": "user", "content": ""}
  91. assistant = {"role": "assistant", "content": ""}
  92. while True:
  93.     if (flag == 0):
  94.         button.config(image="mic.jpg",state="normal")
  95.         refresh.config(image="refresh.jpg",state="normal")
  96.         
  97.     if (flag == 3):
  98.         message.clear()
  99.         message = [{"role": "system", "content": "You are a helpful assistant."}]
  100.     if (flag == 2):
  101.         azure_synthesis_result = askOpenAI(message)
  102.         assistant["content"] = azure_synthesis_result
  103.         message.append(assistant.copy())
  104.         tts(azure_synthesis_result)
  105.         time.sleep(1)
  106.         
  107.         flag = 0
  108.         trans.config(text="      ")
  109.         button.config(image="",state="normal")
  110.         refresh.config(image="",state="normal")
  111.         init.config(x=15)
  112.    
  113.     if (flag == 1):
  114.         init.config(x=600)
  115.         trans .config(text="Listening。。。")
  116.         button.config(image="",state="disable")
  117.         refresh.config(image="",state="disable")
  118.         result = recognize_from_microphone()
  119.         user["content"] = result
  120.         message.append(user.copy())
  121.         trans .config(text=result)
  122.         time.sleep(2)
  123.         trans .config(text="Thinking。。。")
  124.         flag = 2</font>
复制代码

在上述技术路径的基础上,OpenAI的跨模态能力进一步强化了其生态系统,让开发者能够更快地开发基于OpenAI的应用。就单一模式的表现而言,最近更新的DALL·E 3在视觉效果上并不逊于之前领先的Midjourney和Stable Diffusion。与微软合作,将视觉功能、GPT-4以及文本到语音转换技术TTS和Co-pilot相结合,这种跨模态集成将大大简化通过自然语言通信实现复杂逻辑和任务执行的过程。与此同时,GPT-4也得到了重大更新。新的GPT-4 Turbo版本支持用户上传外部数据库或文件,处理上下文长度可达128k(相当于一本300页的书),知识库已更新至2023年4月,API价格也都大打折扣。

第二种方法:OpenAI全部处理(gpt+whisper+tts)

使用ChatGPT API和Azure Speech API在行空板单板计算机上构建...图9


通过这个接口集成,我们可以尝试使用openai的所有API来实现这个功能。使用openai的“whisper + gpt + tts”也可以实现以上功能。优点是只需注册openai并获取实现功能的密钥,并且可以自动识别语言类别。不过openai的whisper暂时无法支持实时转换,所以在代码编写和程序响应上还存在差异。

  • 初始化并录制音频
  • 使用耳语模型录制语音并将其转换为文本:转录 API 将您要转录的音频文件和所需的输出文件作为输入音频转录的格式。我们目前支持多种输入和输出文件格式。文件上传目前限制为 25 MB,并且支持以下输入文件类型:mp3、mp4、mpeg、mpga、m4a、wav 和 webm。
  • 使用 gpt-3.5-turbo 模型生成答案。
  • 使用 tts-1 模型将文本转换为语音并输出音频文件。
  • 播放音频文件


代码:
  1. <font face="微软雅黑">import openai
  2. import pyaudio
  3. import wave
  4. import time
  5. import os
  6. openai.api_key="xxxxxxxx"  # input your openai key
  7. def record_and_convert():
  8.         # Define recording parameters
  9.          CHUNK = 1024 # Number of frames per buffer
  10.          FORMAT = pyaudio.paInt16 #Data format
  11.          CHANNELS = 1 # Number of channels
  12.          RATE = 44100 # sampling rate
  13.          RECORD_SECONDS = 10 # Recording time
  14.          WAVE_OUTPUT_FILENAME = "output.wav" # Output file name
  15.         # initialization pyaudio
  16.         p = pyaudio.PyAudio()
  17.         # Open recording stream
  18.         stream = p.open(format=FORMAT,
  19.                                         channels=CHANNELS,
  20.                                         rate=RATE,
  21.                                         input=True,
  22.                                         frames_per_buffer=CHUNK)
  23.         print("Start recording, please speak...")
  24.         frames = []
  25.         # Record audio data
  26.         for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
  27.                 data = stream.read(CHUNK)
  28.                 frames.append(data)
  29.         print("Recording ends!")
  30.         # Stop recording
  31.         stream.stop_stream()
  32.         stream.close()
  33.         p.terminate()
  34.         # Save recording data to file
  35.         wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
  36.         wf.setnchannels(CHANNELS)
  37.         wf.setsampwidth(p.get_sample_size(FORMAT))
  38.         wf.setframerate(RATE)
  39.         wf.writeframes(b''.join(frames))
  40.         wf.close()
  41.         audio_file= open("output.wav", "rb")
  42.         transcript = openai.audio.transcriptions.create(
  43.             model="whisper-1",
  44.             file=audio_file,
  45.             response_format="text"
  46.         )
  47.         print("transform completed")
  48.         input_txt = transcript
  49.         response_text = openai.chat.completions.create(
  50.             model="gpt-3.5-turbo",
  51.             messages=[
  52.                 {"role": "user",
  53.                  "content": input_txt}
  54.             ]
  55.         )
  56.         #print(response_text.choices[0].message)
  57.         input_tts = response_text.choices[0].message.content
  58.         #Convert to speech
  59.         print("Start converting speech")
  60.         response = openai.audio.speech.create(
  61.                 model="tts-1",
  62.                 voice="shimmer",
  63.                 input=input_tts,
  64.         )
  65.         response.stream_to_file("output2.mp3")
  66.         #Play the speech
  67.         os.system("play output2.mp3")
  68. if __name__ == "__main__":
  69.     while True:
  70.         record_and_convert()
  71.         time.sleep(1)</font>
复制代码

通过以上两种方法,我们实现了gpt语音座席助手功能。Azure Speech API 与 OpenAI GPT 的集成为开发智能桌面助手开辟了新领域。自然语言处理和语音识别技术的进步使我们与计算机的交互更加自然和高效。通过利用这些技术的力量,我们可以构建能够执行复杂任务并在各自领域提供专家级服务的应用程序。在接下来的文章中,我将继续分享这个智能助手的开发过程,并探索这种集成可以带来的更多可能性。

GPT和丰富的API使我们能够轻松开发和实现个性化智能代理。智能代理可以理解为与外部环境交互时能够模拟人类智能行为的程序。例如,自动驾驶汽车的控制系统就是一个智能代理。在开发者大会上,OpenAI员工展示了一个例子:一秒上传一份航班信息的PDF,智能代理就能整理出机票信息并显示在网页上。如果结合更多不同的硬件接口,我们可以尝试在没有电脑或手机接口的情况下定制更多自己的gpt应用。就像这款智能桌面助手的应用案例一样,未来还可以扩展更多物理层面的智能控制,实现更自然的“智能代理”。

我们曾经设想的人工智能代理的未来现已成为现实。

达拉斯  高级技师

发表于 2024-3-8 15:33:39

66666,学习一下,感谢分享。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail