mirror of
https://github.com/microsoft/autogen.git
synced 2025-06-26 22:30:10 +00:00
feat: bump ags version, minor fixes (#6603)
<!-- Thank you for your contribution! Please review https://microsoft.github.io/autogen/docs/Contribute before opening a pull request. --> Update autogenstudio version. <!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. --> ## Why are these changes needed? <!-- Please give a short summary of the change and the problem this solves. --> ## Related issue number Closes #6580 <!-- For example: "Closes #1234" --> ## Checks - [ ] I've included any doc changes needed for <https://microsoft.github.io/autogen/>. See <https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md> to build and test documentation locally. - [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR. - [ ] I've made sure all auto checks have passed.
This commit is contained in:
parent
955f4f9b9f
commit
6cadc7dc17
@ -14,10 +14,18 @@ from .schema_manager import SchemaManager
|
|||||||
|
|
||||||
|
|
||||||
class CustomJSONEncoder(json.JSONEncoder):
|
class CustomJSONEncoder(json.JSONEncoder):
|
||||||
def default(self, obj):
|
def default(self, o):
|
||||||
if hasattr(obj, "get_secret_value") and callable(obj.get_secret_value):
|
if hasattr(o, "get_secret_value") and callable(o.get_secret_value):
|
||||||
return obj.get_secret_value()
|
return o.get_secret_value()
|
||||||
return super().default(obj)
|
# Handle datetime objects
|
||||||
|
if isinstance(o, datetime):
|
||||||
|
return o.isoformat()
|
||||||
|
# Handle Enum objects
|
||||||
|
import enum
|
||||||
|
|
||||||
|
if isinstance(o, enum.Enum):
|
||||||
|
return o.value
|
||||||
|
return super().default(o)
|
||||||
|
|
||||||
|
|
||||||
class DatabaseManager:
|
class DatabaseManager:
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
VERSION = "0.4.2"
|
VERSION = "0.4.2.2"
|
||||||
__version__ = VERSION
|
__version__ = VERSION
|
||||||
APP_NAME = "autogenstudio"
|
APP_NAME = "autogenstudio"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
import trace
|
||||||
import traceback
|
import traceback
|
||||||
from datetime import datetime, timezone
|
from datetime import date, datetime, time, timezone
|
||||||
from typing import Any, Callable, Dict, Optional, Sequence, Union
|
from typing import Any, Callable, Dict, Optional, Sequence, Union
|
||||||
|
|
||||||
from autogen_agentchat.base import TaskResult
|
from autogen_agentchat.base import TaskResult
|
||||||
@ -87,12 +88,12 @@ class WebSocketManager:
|
|||||||
"""Start streaming task execution with proper run management"""
|
"""Start streaming task execution with proper run management"""
|
||||||
if run_id not in self._connections or run_id in self._closed_connections:
|
if run_id not in self._connections or run_id in self._closed_connections:
|
||||||
raise ValueError(f"No active connection for run {run_id}")
|
raise ValueError(f"No active connection for run {run_id}")
|
||||||
|
|
||||||
with RunContext.populate_context(run_id=run_id):
|
with RunContext.populate_context(run_id=run_id):
|
||||||
team_manager = TeamManager()
|
team_manager = TeamManager()
|
||||||
cancellation_token = CancellationToken()
|
cancellation_token = CancellationToken()
|
||||||
self._cancellation_tokens[run_id] = cancellation_token
|
self._cancellation_tokens[run_id] = cancellation_token
|
||||||
final_result = None
|
final_result = None
|
||||||
|
env_vars = None # Ensure env_vars is always defined
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Update run with task and status
|
# Update run with task and status
|
||||||
@ -276,14 +277,15 @@ class WebSocketManager:
|
|||||||
self._input_responses.pop(run_id, None)
|
self._input_responses.pop(run_id, None)
|
||||||
|
|
||||||
def _convert_images_in_dict(self, obj: Any) -> Any:
|
def _convert_images_in_dict(self, obj: Any) -> Any:
|
||||||
"""Recursively find and convert Image objects in dictionaries and lists"""
|
"""Recursively find and convert Image and datetime objects in dictionaries and lists"""
|
||||||
if isinstance(obj, dict):
|
if isinstance(obj, dict):
|
||||||
return {k: self._convert_images_in_dict(v) for k, v in obj.items()}
|
return {k: self._convert_images_in_dict(v) for k, v in obj.items()}
|
||||||
elif isinstance(obj, list):
|
elif isinstance(obj, list):
|
||||||
return [self._convert_images_in_dict(item) for item in obj]
|
return [self._convert_images_in_dict(item) for item in obj]
|
||||||
elif isinstance(obj, AGImage): # Assuming you've imported AGImage
|
elif isinstance(obj, AGImage):
|
||||||
# Convert the Image object to a serializable format
|
|
||||||
return {"type": "image", "url": f"data:image/png;base64,{obj.to_base64()}", "alt": "Image"}
|
return {"type": "image", "url": f"data:image/png;base64,{obj.to_base64()}", "alt": "Image"}
|
||||||
|
elif isinstance(obj, (datetime, date, time)):
|
||||||
|
return obj.isoformat()
|
||||||
else:
|
else:
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
@ -306,6 +308,7 @@ class WebSocketManager:
|
|||||||
logger.warning(f"WebSocket disconnected while sending message for run {run_id}")
|
logger.warning(f"WebSocket disconnected while sending message for run {run_id}")
|
||||||
await self.disconnect(run_id)
|
await self.disconnect(run_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
traceback.print_exc()
|
||||||
logger.error(f"Error sending message for run {run_id}: {e}, {message}")
|
logger.error(f"Error sending message for run {run_id}: {e}, {message}")
|
||||||
# Don't try to send error message here to avoid potential recursive loop
|
# Don't try to send error message here to avoid potential recursive loop
|
||||||
await self._update_run_status(run_id, RunStatus.ERROR, str(e))
|
await self._update_run_status(run_id, RunStatus.ERROR, str(e))
|
||||||
|
@ -76,6 +76,7 @@ async def run_websocket(
|
|||||||
|
|
||||||
logger.info(f"WebSocket connection established for run {run_id}")
|
logger.info(f"WebSocket connection established for run {run_id}")
|
||||||
|
|
||||||
|
raw_message = None # Initialize to avoid possibly unbound variable
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
raw_message = await websocket.receive_text()
|
raw_message = await websocket.receive_text()
|
||||||
|
@ -48,12 +48,12 @@ const navigation: INavItem[] = [
|
|||||||
icon: GalleryHorizontalEnd,
|
icon: GalleryHorizontalEnd,
|
||||||
breadcrumbs: [{ name: "Gallery", href: "/gallery", current: true }],
|
breadcrumbs: [{ name: "Gallery", href: "/gallery", current: true }],
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
name: "Labs",
|
// name: "Labs",
|
||||||
href: "/labs",
|
// href: "/labs",
|
||||||
icon: FlaskConical,
|
// icon: FlaskConical,
|
||||||
breadcrumbs: [{ name: "Labs", href: "/labs", current: true }],
|
// breadcrumbs: [{ name: "Labs", href: "/labs", current: true }],
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: "Deploy",
|
name: "Deploy",
|
||||||
href: "/deploy",
|
href: "/deploy",
|
||||||
|
2
python/uv.lock
generated
2
python/uv.lock
generated
@ -829,7 +829,7 @@ requires-dist = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autogenstudio"
|
name = "autogenstudio"
|
||||||
version = "0.4.2"
|
version = "0.4.2.2"
|
||||||
source = { editable = "packages/autogen-studio" }
|
source = { editable = "packages/autogen-studio" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "aiofiles" },
|
{ name = "aiofiles" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user