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:
Victor Dibia 2025-05-28 15:49:28 -07:00 committed by GitHub
parent 955f4f9b9f
commit 6cadc7dc17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 17 deletions

View File

@ -14,10 +14,18 @@ from .schema_manager import SchemaManager
class CustomJSONEncoder(json.JSONEncoder):
def default(self, obj):
if hasattr(obj, "get_secret_value") and callable(obj.get_secret_value):
return obj.get_secret_value()
return super().default(obj)
def default(self, o):
if hasattr(o, "get_secret_value") and callable(o.get_secret_value):
return o.get_secret_value()
# 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:

View File

@ -1,3 +1,3 @@
VERSION = "0.4.2"
VERSION = "0.4.2.2"
__version__ = VERSION
APP_NAME = "autogenstudio"

View File

@ -1,7 +1,8 @@
import asyncio
import logging
import trace
import traceback
from datetime import datetime, timezone
from datetime import date, datetime, time, timezone
from typing import Any, Callable, Dict, Optional, Sequence, Union
from autogen_agentchat.base import TaskResult
@ -87,12 +88,12 @@ class WebSocketManager:
"""Start streaming task execution with proper run management"""
if run_id not in self._connections or run_id in self._closed_connections:
raise ValueError(f"No active connection for run {run_id}")
with RunContext.populate_context(run_id=run_id):
team_manager = TeamManager()
cancellation_token = CancellationToken()
self._cancellation_tokens[run_id] = cancellation_token
final_result = None
env_vars = None # Ensure env_vars is always defined
try:
# Update run with task and status
@ -276,14 +277,15 @@ class WebSocketManager:
self._input_responses.pop(run_id, None)
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):
return {k: self._convert_images_in_dict(v) for k, v in obj.items()}
elif isinstance(obj, list):
return [self._convert_images_in_dict(item) for item in obj]
elif isinstance(obj, AGImage): # Assuming you've imported AGImage
# Convert the Image object to a serializable format
elif isinstance(obj, AGImage):
return {"type": "image", "url": f"data:image/png;base64,{obj.to_base64()}", "alt": "Image"}
elif isinstance(obj, (datetime, date, time)):
return obj.isoformat()
else:
return obj
@ -306,6 +308,7 @@ class WebSocketManager:
logger.warning(f"WebSocket disconnected while sending message for run {run_id}")
await self.disconnect(run_id)
except Exception as e:
traceback.print_exc()
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
await self._update_run_status(run_id, RunStatus.ERROR, str(e))

View File

@ -76,6 +76,7 @@ async def run_websocket(
logger.info(f"WebSocket connection established for run {run_id}")
raw_message = None # Initialize to avoid possibly unbound variable
while True:
try:
raw_message = await websocket.receive_text()

View File

@ -48,12 +48,12 @@ const navigation: INavItem[] = [
icon: GalleryHorizontalEnd,
breadcrumbs: [{ name: "Gallery", href: "/gallery", current: true }],
},
{
name: "Labs",
href: "/labs",
icon: FlaskConical,
breadcrumbs: [{ name: "Labs", href: "/labs", current: true }],
},
// {
// name: "Labs",
// href: "/labs",
// icon: FlaskConical,
// breadcrumbs: [{ name: "Labs", href: "/labs", current: true }],
// },
{
name: "Deploy",
href: "/deploy",

2
python/uv.lock generated
View File

@ -829,7 +829,7 @@ requires-dist = [
[[package]]
name = "autogenstudio"
version = "0.4.2"
version = "0.4.2.2"
source = { editable = "packages/autogen-studio" }
dependencies = [
{ name = "aiofiles" },