Skip to content

Commit

Permalink
Merge pull request #128 from kookmin-sw/feature/01
Browse files Browse the repository at this point in the history
perf: 응답 생성 옵션 temperature을 0으로 변경
  • Loading branch information
SangwonYoon authored May 22, 2024
2 parents c6e4886 + dad7999 commit 37b1e3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/app/utils/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def validate_template(template: dict):
# 254 명령이 성공적으로 구문 분석되고 지정된 서비스에 요청이 전송되었지만, 서비스에서 오류가 반환되었습니다. 일반적으로 이는 잘못된 API 사용 또는 기타 서비스 특정 문제를 나타냅니다.
# 255 일반적인 캐치올 오류입니다. 명령은 구문 분석이 올바르게 되었을 수 있지만, 명령을 실행하는 동안 명시되지 않은 런타임 오류가 발생했습니다. 이는 일반적인 오류 코드이기 때문에 오류가 255에서 더 구체적인 반환 코드로 변경될 수 있습니다. 255의 반환 코드는 특정한 오류 사례를 결정하기 위해 의존되어서는 안 됩니다.


is_valid = result.returncode == 0
error_message = "" if is_valid else result.stderr
return is_valid, error_message
Expand Down Expand Up @@ -88,6 +87,7 @@ def gpt_genereate(instruction: str, retrieved_doc: List[dict]):
response_format={
"type": "json_object",
},
temperature=0,
)

response = completion.choices[0].message.content
Expand Down Expand Up @@ -156,6 +156,7 @@ def gpt_generate_retry(instruction, retrieved_doc, error_message, wrong_template
response_format={
"type": "json_object",
},
temperature=0,
)

response = completion.choices[0].message.content
Expand Down

0 comments on commit 37b1e3d

Please sign in to comment.