Skip to content

Commit fc2f734

Browse files
committed
Remove unnecessary changes
1 parent c79bdf0 commit fc2f734

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/neo4j_graphrag/llm/openai_llm.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,8 @@ def invoke(
115115
try:
116116
if isinstance(message_history, MessageHistory):
117117
message_history = message_history.messages
118-
# We know these are compatible with OpenAI's API at runtime
119-
messages = self.get_messages(input, message_history, system_instruction)
120118
response = self.client.chat.completions.create(
121-
messages=messages,
119+
messages=self.get_messages(input, message_history, system_instruction),
122120
model=self.model_name,
123121
**self.model_params,
124122
)
@@ -158,15 +156,13 @@ def invoke_with_tools(
158156
if "temperature" not in params:
159157
params["temperature"] = 0.0
160158

161-
# We know these are compatible with OpenAI's API at runtime
162-
messages = self.get_messages(input, message_history, system_instruction)
163159
# Convert tools to OpenAI's expected type
164160
openai_tools: List[ChatCompletionToolParam] = []
165161
for tool in tools:
166162
openai_tools.append(cast(ChatCompletionToolParam, tool))
167163

168164
response = self.client.chat.completions.create(
169-
messages=messages,
165+
messages=self.get_messages(input, message_history, system_instruction),
170166
model=self.model_name,
171167
tools=openai_tools,
172168
tool_choice="auto",

0 commit comments

Comments
 (0)