mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] update to v1.0.0 (#5062)
* updates to final deprecated pieces and versions * fix mypy * fix readme links
This commit is contained in:
committed by
GitHub
Unverified
parent
5f06b68535
commit
3446eb8d5d
@@ -102,7 +102,7 @@ class ThreadItemConverter:
|
||||
|
||||
# If only text and no attachments, use text parameter for simplicity
|
||||
if text_content.strip() and not data_contents:
|
||||
user_message = Message(role="user", text=text_content.strip())
|
||||
user_message = Message(role="user", contents=[text_content.strip()])
|
||||
else:
|
||||
# Build contents list with both text and attachments
|
||||
contents: list[Content] = []
|
||||
@@ -116,7 +116,7 @@ class ThreadItemConverter:
|
||||
if item.quoted_text and is_last_message:
|
||||
quoted_context = Message(
|
||||
role="user",
|
||||
text=f"The user is referring to this in particular:\n{item.quoted_text}",
|
||||
contents=[f"The user is referring to this in particular:\n{item.quoted_text}"],
|
||||
)
|
||||
# Prepend quoted context before the main message
|
||||
messages.insert(0, quoted_context)
|
||||
@@ -211,9 +211,9 @@ class ThreadItemConverter:
|
||||
content="User's email: user@example.com",
|
||||
)
|
||||
message = converter.hidden_context_to_input(hidden_item)
|
||||
# Returns: Message(role=SYSTEM, text="<HIDDEN_CONTEXT>User's email: ...</HIDDEN_CONTEXT>")
|
||||
# Returns: Message(role=SYSTEM, contents=["<HIDDEN_CONTEXT>User's email: ...</HIDDEN_CONTEXT>"])
|
||||
"""
|
||||
return Message(role="system", text=f"<HIDDEN_CONTEXT>{item.content}</HIDDEN_CONTEXT>")
|
||||
return Message(role="system", contents=[f"<HIDDEN_CONTEXT>{item.content}</HIDDEN_CONTEXT>"])
|
||||
|
||||
def tag_to_message_content(self, tag: UserMessageTagContent) -> Content:
|
||||
"""Convert a ChatKit tag (@-mention) to Agent Framework content.
|
||||
@@ -292,7 +292,7 @@ class ThreadItemConverter:
|
||||
f"A message was displayed to the user that the following task was performed:\n<Task>\n{task_text}\n</Task>"
|
||||
)
|
||||
|
||||
return Message(role="user", text=text)
|
||||
return Message(role="user", contents=[text])
|
||||
|
||||
def workflow_to_input(self, item: WorkflowItem) -> Message | list[Message] | None:
|
||||
"""Convert a ChatKit WorkflowItem to Agent Framework Message(s).
|
||||
@@ -347,7 +347,7 @@ class ThreadItemConverter:
|
||||
f"<Task>\n{task_text}\n</Task>"
|
||||
)
|
||||
|
||||
messages.append(Message(role="user", text=text))
|
||||
messages.append(Message(role="user", contents=[text]))
|
||||
|
||||
return messages if messages else None
|
||||
|
||||
@@ -389,7 +389,7 @@ class ThreadItemConverter:
|
||||
try:
|
||||
widget_json = item.widget.model_dump_json(exclude_unset=True, exclude_none=True)
|
||||
text = f"The following graphical UI widget (id: {item.id}) was displayed to the user:{widget_json}"
|
||||
return Message(role="user", text=text)
|
||||
return Message(role="user", contents=[text])
|
||||
except Exception:
|
||||
# If JSON serialization fails, skip the widget
|
||||
return None
|
||||
@@ -415,7 +415,7 @@ class ThreadItemConverter:
|
||||
if not text_parts:
|
||||
return None
|
||||
|
||||
return Message(role="assistant", text="".join(text_parts))
|
||||
return Message(role="assistant", contents=["".join(text_parts)])
|
||||
|
||||
async def client_tool_call_to_input(self, item: ClientToolCallItem) -> Message | list[Message] | None:
|
||||
"""Convert a ChatKit ClientToolCallItem to Agent Framework Message(s).
|
||||
|
||||
@@ -4,7 +4,7 @@ description = "OpenAI ChatKit integration for Microsoft Agent Framework."
|
||||
authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
version = "1.0.0b260330"
|
||||
version = "1.0.0b260402"
|
||||
license-files = ["LICENSE"]
|
||||
urls.homepage = "https://aka.ms/agent-framework"
|
||||
urls.source = "https://github.com/microsoft/agent-framework/tree/main/python"
|
||||
@@ -22,7 +22,7 @@ classifiers = [
|
||||
"Typing :: Typed",
|
||||
]
|
||||
dependencies = [
|
||||
"agent-framework-core>=1.0.0rc6",
|
||||
"agent-framework-core>=1.0.0,<2",
|
||||
"openai-chatkit>=1.4.1,<2.0.0",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user