Skip to content

Commit bfd6777

Browse files
fix(http_llm): drop invalid payload keys (#3)
1 parent 60f9b3f commit bfd6777

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

oxygent/oxy/llms/http_llm.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,18 @@ async def _execute(self, oxy_request: OxyRequest) -> OxyResponse:
4545
headers["Authorization"] = f"Bearer {self.api_key}"
4646

4747
# Construct payload for the API request
48-
llm_config = Config.get_llm_config()
48+
llm_config = {
49+
k: v
50+
for k, v in Config.get_llm_config().items()
51+
if k
52+
not in {
53+
"cls",
54+
"base_url",
55+
"api_key",
56+
"name",
57+
"model_name",
58+
}
59+
}
4960
payload = {
5061
"messages": await self._get_messages(oxy_request),
5162
"model": self.model_name,

oxygent/oxy/llms/openai_llm.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,18 @@ async def _execute(self, oxy_request: OxyRequest) -> OxyResponse:
3838
OxyResponse: The response containing the model's output with COMPLETED state.
3939
"""
4040
# Construct payload for OpenAI API request
41-
llm_config = Config.get_llm_config()
41+
llm_config = {
42+
k: v
43+
for k, v in Config.get_llm_config().items()
44+
if k
45+
not in {
46+
"cls",
47+
"base_url",
48+
"api_key",
49+
"name",
50+
"model_name",
51+
}
52+
}
4253
payload = {
4354
"messages": await self._get_messages(oxy_request),
4455
"model": self.model_name,

0 commit comments

Comments
 (0)