From 25af6614ed0f83fc3cf8abd7e43dd2ac4693bf7b Mon Sep 17 00:00:00 2001 From: Vince Loewe Date: Tue, 3 Dec 2024 18:33:04 +0800 Subject: [PATCH] record more openai data --- lunary/openai_utils.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lunary/openai_utils.py b/lunary/openai_utils.py index 4c45f46..84dde72 100644 --- a/lunary/openai_utils.py +++ b/lunary/openai_utils.py @@ -1,24 +1,32 @@ import json, logging logger = logging.getLogger(__name__) - MONITORED_KEYS = [ "frequency_penalty", - "function_call", + "function_call", "functions", "logit_bias", "max_tokens", + "max_completion_tokens", "n", - "present_penalty", + "presence_penalty", "response_format", "seed", "stop", "stream", + "audio", + "modalities", "temperature", "tool_choice", "tools", "tool_calls", "top_p", + "top_k", + "top_logprobs", + "logprobs", + "prediction", + "service_tier", + "parallel_tool_calls" ] @@ -51,6 +59,8 @@ def parse_message(message): parsed_message = { "role": OpenAIUtils.get_property(message, "role"), "content": OpenAIUtils.get_property(message, "content"), + "refusal": OpenAIUtils.get_property(message, "refusal"), + "audio": OpenAIUtils.get_property(message, "audio"), "function_call": OpenAIUtils.get_property(message, "function_call"), "tool_calls": tool_calls, }