test:添加GPT检测测试用例
Some checks are pending
Python application test / build (pull_request) Waiting to run
Some checks are pending
Python application test / build (pull_request) Waiting to run
This commit is contained in:
@@ -7,8 +7,12 @@ import openai
|
||||
|
||||
|
||||
def detect_gpt(filename: str):
|
||||
content = read_file_content(filename)
|
||||
return detectGPT(content)
|
||||
|
||||
def detectGPT(content: str):
|
||||
client = openai.OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
||||
text = read_file_content(filename)
|
||||
text = content
|
||||
# client = openai.OpenAI(api_key="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") #测试用key
|
||||
response = client.chat.completions.create(
|
||||
messages=[
|
||||
|
||||
Reference in New Issue
Block a user