Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
record more openai data
Browse files Browse the repository at this point in the history
  • Loading branch information
vincelwt committed Dec 3, 2024
1 parent 6969d11 commit 25af661
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lunary/openai_utils.py
Original file line number Diff line number Diff line change
@@ -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"
]


Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit 25af661

Please sign in to comment.