mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 10:55:17 +00:00
langchain: move model and temperature to chat_completion
This commit is contained in:
parent
506eafc0c5
commit
0c66554d50
1 changed files with 2 additions and 2 deletions
|
|
@ -12,7 +12,7 @@ from pr_agent.config_loader import get_settings
|
|||
from pr_agent.log import get_logger
|
||||
|
||||
OPENAI_RETRIES = 5
|
||||
chat = ChatOpenAI(openai_api_key = get_settings().openai.key, model="gpt-4")
|
||||
chat = ChatOpenAI(openai_api_key = get_settings().openai.key)
|
||||
|
||||
class LangChainAIHandler(BaseAiHandler):
|
||||
def __init__(self):
|
||||
|
|
@ -35,7 +35,7 @@ class LangChainAIHandler(BaseAiHandler):
|
|||
messages=[SystemMessage(content=system), HumanMessage(content=user)]
|
||||
|
||||
# get a chat completion from the formatted messages
|
||||
resp = chat(messages)
|
||||
resp = chat(messages, model=model, temperature=temperature)
|
||||
get_logger().info("AI response: ", resp.content)
|
||||
finish_reason="completed"
|
||||
return resp.content, finish_reason
|
||||
|
|
|
|||
Loading…
Reference in a new issue