This commit is contained in:
Timothy Jaeryang Baek committed 2026-01-22 14:54:00 +04:00
1 parent a3600e8b21
commit 886c12c566
1 file changed
+5 -1
+5 -1
View File
@@ -287,7 +287,11 @@ def convert_payload_openai_to_ollama(openai_payload: dict) -> dict:
Returns: Returns:
dict: A modified payload compatible with the Ollama API. dict: A modified payload compatible with the Ollama API.
""" """
openai_payload = copy.deepcopy(openai_payload) # Shallow copy metadata separately (may contain non-picklable objects)
metadata = openai_payload.get("metadata")
openai_payload = copy.deepcopy({k: v for k, v in openai_payload.items() if k != "metadata"})
if metadata is not None:
openai_payload["metadata"] = dict(metadata)
ollama_payload = {} ollama_payload = {}
# Mapping basic model and message details # Mapping basic model and message details