From 854d613a813a49b6ecd7eb5a9b4c83e4a83521e2 Mon Sep 17 00:00:00 2001 From: Clivia <132346501+Yanyutin753@users.noreply.github.com> Date: Sat, 9 Sep 2023 12:25:40 +0800 Subject: [PATCH 1/3] Update source.json --- plugins/source.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/source.json b/plugins/source.json index 003d391..8b1984f 100644 --- a/plugins/source.json +++ b/plugins/source.json @@ -16,5 +16,9 @@ "url": "https://github.com/haikerapples/timetask.git", "desc": "一款定时任务系统的插件" } + "pictureChange": { + "url": "https://github.com/Yanyutin753/pictureChange.git", + "desc": "利用stable-diffusion和百度Ai进行图生图或者画图的插件" + } } } From 977d3bc02eb73dfc13d7f5c5b3730f55d6389480 Mon Sep 17 00:00:00 2001 From: FMStereo Date: Thu, 18 Jan 2024 12:46:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=99=BE=E5=BA=A6=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E8=BD=AC=E5=86=99=E6=94=AF=E6=8C=818000=E9=87=87=E6=A0=B7?= =?UTF-8?q?=E7=8E=87,=20pcm=5Fs16le=E7=BC=96=E7=A0=81,=20=E5=8D=95?= =?UTF-8?q?=E9=80=9A=E9=81=93=E8=AF=AD=E9=9F=B3=E7=9A=84=E7=BB=84=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- voice/audio_convert.py | 4 +++- voice/baidu/baidu_voice.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/voice/audio_convert.py b/voice/audio_convert.py index 18fe3c2..5c80528 100644 --- a/voice/audio_convert.py +++ b/voice/audio_convert.py @@ -64,7 +64,9 @@ def any_to_wav(any_path, wav_path): if any_path.endswith(".sil") or any_path.endswith(".silk") or any_path.endswith(".slk"): return sil_to_wav(any_path, wav_path) audio = AudioSegment.from_file(any_path) - audio.export(wav_path, format="wav") + audio.set_frame_rate(8000) # 百度语音转写支持8000采样率, pcm_s16le, 单通道语音识别 + audio.set_channels(1) + audio.export(wav_path, format="wav", codec='pcm_s16le') def any_to_sil(any_path, sil_path): diff --git a/voice/baidu/baidu_voice.py b/voice/baidu/baidu_voice.py index fbf53ce..66ba4d8 100644 --- a/voice/baidu/baidu_voice.py +++ b/voice/baidu/baidu_voice.py @@ -62,7 +62,7 @@ class BaiduVoice(Voice): # 识别本地文件 logger.debug("[Baidu] voice file name={}".format(voice_file)) pcm = get_pcm_from_wav(voice_file) - res = self.client.asr(pcm, "pcm", 16000, {"dev_pid": self.dev_id}) + res = self.client.asr(pcm, "pcm", 8000, {"dev_pid": self.dev_id}) if res["err_no"] == 0: logger.info("百度语音识别到了:{}".format(res["result"])) text = "".join(res["result"]) From 800419e7cc79c558c201872e555f12bb91d7ecfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E4=BC=9F=2810007228=29?= Date: Thu, 14 Mar 2024 13:44:14 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A6=82=E4=B8=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A=201.=E8=B0=83=E7=94=A8gemini=20api?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=90=91=E4=B8=8B=E6=B8=B8=E8=BF=94=E5=9B=9E=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=90=8E=E7=BB=AD=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=AF=E8=83=BD=E8=A6=81=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E5=81=9A=E7=9B=B8=E5=BA=94?= =?UTF-8?q?=E8=A1=A5=E5=81=BF=E6=9C=BA=E5=88=B6=202.=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=9C=BA=E6=99=AF=E4=B8=AD=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E8=B6=8A=E7=95=8C=E5=AF=BC=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/gemini/google_gemini_bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot/gemini/google_gemini_bot.py b/bot/gemini/google_gemini_bot.py index 1a49d60..e63f1cb 100644 --- a/bot/gemini/google_gemini_bot.py +++ b/bot/gemini/google_gemini_bot.py @@ -44,6 +44,7 @@ class GoogleGeminiBot(Bot): except Exception as e: logger.error("[Gemini] fetch reply error, may contain unsafe content") logger.error(e) + return Reply(ReplyType.ERROR, "invoke [Gemini] api failed!") def _convert_to_gemini_messages(self, messages: list): res = [] @@ -63,6 +64,8 @@ class GoogleGeminiBot(Bot): def _filter_messages(self, messages: list): res = [] turn = "user" + if not messages: + return res for i in range(len(messages) - 1, -1, -1): message = messages[i] if message.get("role") != turn: