mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-20 19:36:08 +00:00
chore: 删除过时代码
This commit is contained in:
@@ -54,40 +54,6 @@ class OpenAIInteract:
|
|||||||
for resp in request:
|
for resp in request:
|
||||||
yield resp
|
yield resp
|
||||||
|
|
||||||
# 请求OpenAI Completion
|
|
||||||
# def request_completion(self, prompts):
|
|
||||||
# """请求补全接口回复
|
|
||||||
# """
|
|
||||||
|
|
||||||
# config = pkg.utils.context.get_config()
|
|
||||||
|
|
||||||
# # 根据模型选择使用的接口
|
|
||||||
# ai: ModelRequest = create_openai_model_request(
|
|
||||||
# config.completion_api_params['model'],
|
|
||||||
# 'user',
|
|
||||||
# config.openai_config["http_proxy"] if "http_proxy" in config.openai_config else None
|
|
||||||
# )
|
|
||||||
# ai.request(
|
|
||||||
# prompts,
|
|
||||||
# **config.completion_api_params
|
|
||||||
# )
|
|
||||||
# response = ai.get_response()
|
|
||||||
|
|
||||||
# logging.debug("OpenAI response: %s", response)
|
|
||||||
|
|
||||||
# # 记录使用量
|
|
||||||
# current_round_token = 0
|
|
||||||
# if 'model' in config.completion_api_params:
|
|
||||||
# self.audit_mgr.report_text_model_usage(config.completion_api_params['model'],
|
|
||||||
# ai.get_total_tokens())
|
|
||||||
# current_round_token = ai.get_total_tokens()
|
|
||||||
# elif 'engine' in config.completion_api_params:
|
|
||||||
# self.audit_mgr.report_text_model_usage(config.completion_api_params['engine'],
|
|
||||||
# response['usage']['total_tokens'])
|
|
||||||
# current_round_token = response['usage']['total_tokens']
|
|
||||||
|
|
||||||
# return ai.get_message(), current_round_token
|
|
||||||
|
|
||||||
def request_image(self, prompt) -> dict:
|
def request_image(self, prompt) -> dict:
|
||||||
"""请求图片接口回复
|
"""请求图片接口回复
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user