mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 21:57:14 +08:00
fix: group voice config and azure model calc support
This commit is contained in:
@@ -59,7 +59,7 @@ def num_tokens_from_messages(messages, model):
|
|||||||
|
|
||||||
if model in ["gpt-3.5-turbo-0301", "gpt-35-turbo"]:
|
if model in ["gpt-3.5-turbo-0301", "gpt-35-turbo"]:
|
||||||
return num_tokens_from_messages(messages, model="gpt-3.5-turbo")
|
return num_tokens_from_messages(messages, model="gpt-3.5-turbo")
|
||||||
elif model in ["gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613"]:
|
elif model in ["gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0613", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613", "gpt-35-turbo-16k"]:
|
||||||
return num_tokens_from_messages(messages, model="gpt-4")
|
return num_tokens_from_messages(messages, model="gpt-4")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class WechatChannel(ChatChannel):
|
|||||||
@_check
|
@_check
|
||||||
def handle_group(self, cmsg: ChatMessage):
|
def handle_group(self, cmsg: ChatMessage):
|
||||||
if cmsg.ctype == ContextType.VOICE:
|
if cmsg.ctype == ContextType.VOICE:
|
||||||
if conf().get("speech_recognition") != True:
|
if conf().get("group_speech_recognition") != True:
|
||||||
return
|
return
|
||||||
logger.debug("[WX]receive voice for group msg: {}".format(cmsg.content))
|
logger.debug("[WX]receive voice for group msg: {}".format(cmsg.content))
|
||||||
elif cmsg.ctype == ContextType.IMAGE:
|
elif cmsg.ctype == ContextType.IMAGE:
|
||||||
|
|||||||
Reference in New Issue
Block a user