-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncio #31
base: main
Are you sure you want to change the base?
asyncio #31
Conversation
Signed-off-by: bwl <[email protected]>
code = content['header']['code'] | ||
logger.debug(f"sid: {content['header']['sid']}, code: {code}") | ||
if code != 0: | ||
logger.error(content['header']['message']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 如果这里错误不为0,不用continune
- 不要print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 code不为 应该无法走后门的逻辑了,可以本地模拟下错误,比如传一个错误的数据类型看下这里报错如何,测试下
sparkai/llm/llm.py
Outdated
if "usage" in data: | ||
final_frame = True | ||
llm_output["token_usage"] = data['usage']['text'] | ||
if 'text' not in data['choices'] and not final_frame: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usage和text确定是在两帧返回吗?确认下
sparkai/llm/llm.py
Outdated
) | ||
return aws | ||
except websockets.ConnectionClosed as e: | ||
print(f"Connection closed unexpectedly:{e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print...
sparkai/llm/llm.py
Outdated
except websockets.ConnectionClosed as e: | ||
print(f"Connection closed unexpectedly:{e}") | ||
except Exception as e: | ||
print(f"An error occurred: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print..
Signed-off-by: bwl <[email protected]>
No description provided.