update global/spend/end_users

This commit is contained in:
Ishaan Jaff 2024-05-08 17:03:09 -07:00
parent 7bfd02350a
commit faab704d28

View file

@ -11,12 +11,14 @@ from jinja2 import BaseLoader, Template, exceptions, meta
from jinja2.sandbox import ImmutableSandboxedEnvironment from jinja2.sandbox import ImmutableSandboxedEnvironment
import litellm import litellm
from litellm.types.completion import (ChatCompletionFunctionMessageParam, from litellm.types.completion import (
ChatCompletionMessageParam, ChatCompletionFunctionMessageParam,
ChatCompletionMessageToolCallParam, ChatCompletionMessageParam,
ChatCompletionSystemMessageParam, ChatCompletionMessageToolCallParam,
ChatCompletionToolMessageParam, ChatCompletionSystemMessageParam,
ChatCompletionUserMessageParam) ChatCompletionToolMessageParam,
ChatCompletionUserMessageParam,
)
from litellm.types.llms.anthropic import * from litellm.types.llms.anthropic import *
@ -978,7 +980,7 @@ def anthropic_messages_pt(messages: list):
# add role=tool support to allow function call result/error submission # add role=tool support to allow function call result/error submission
user_message_types = {"user", "tool", "function"} user_message_types = {"user", "tool", "function"}
# reformat messages to ensure user/assistant are alternating, if there's either 2 consecutive 'user' messages or 2 consecutive 'assistant' message, merge them. # reformat messages to ensure user/assistant are alternating, if there's either 2 consecutive 'user' messages or 2 consecutive 'assistant' message, merge them.
new_messages = [] new_messages: list = []
msg_i = 0 msg_i = 0
tool_use_param = False tool_use_param = False
merge_with_previous = False merge_with_previous = False