UserImageRequestFrame: don't deprecate function call related fields
This commit is contained in:
@@ -1461,29 +1461,29 @@ class UserImageRequestFrame(SystemFrame):
|
||||
text: An optional text associated to the image request.
|
||||
append_to_context: Whether the requested image should be appended to the LLM context.
|
||||
video_source: Specific video source to capture from.
|
||||
function_name: Name of function that generated this request (if any).
|
||||
tool_call_id: Tool call ID if generated by function call (if any).
|
||||
context: [DEPRECATED] Optional context for the image request.
|
||||
function_name: [DEPRECATED] Name of function that generated this request (if any).
|
||||
tool_call_id: [DEPRECATED] Tool call ID if generated by function call.
|
||||
"""
|
||||
|
||||
user_id: str
|
||||
text: Optional[str] = None
|
||||
append_to_context: Optional[bool] = None
|
||||
video_source: Optional[str] = None
|
||||
context: Optional[Any] = None
|
||||
function_name: Optional[str] = None
|
||||
tool_call_id: Optional[str] = None
|
||||
context: Optional[Any] = None
|
||||
|
||||
def __post_init__(self):
|
||||
super().__post_init__()
|
||||
|
||||
if self.context or self.function_name or self.tool_call_id:
|
||||
if self.context:
|
||||
import warnings
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("always")
|
||||
warnings.warn(
|
||||
"`UserImageRequestFrame` fields `context`, `function_name` and `tool_call_id` are deprecated.",
|
||||
"`UserImageRequestFrame` field `context` is deprecated.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
@@ -520,9 +520,9 @@ class LLMService(AIService):
|
||||
user_id=user_id,
|
||||
text=text_content,
|
||||
append_to_context=True,
|
||||
# Deprecated fields below.
|
||||
function_name=function_name,
|
||||
tool_call_id=tool_call_id,
|
||||
# Deprecated fields below.
|
||||
context=text_content,
|
||||
),
|
||||
FrameDirection.UPSTREAM,
|
||||
|
||||
Reference in New Issue
Block a user