Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
import asyncio
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
import os
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
import queue
|
|
|
|
import threading
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
import traceback
|
2024-04-05 10:26:06 +08:00
|
|
|
from contextlib import asynccontextmanager
|
2024-05-11 07:31:21 -07:00
|
|
|
from typing import Any
|
2024-04-05 10:26:06 +08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from fastapi.staticfiles import StaticFiles
|
2024-05-11 07:31:21 -07:00
|
|
|
from loguru import logger
|
Autogenstudio Updates [CSV support, Workflow Export, Skill Editing, Windows Testing ] (#1475)
* support groupchat, other QOL fixes
* remove gallery success toast
* Fix #1328. Add CSVLoader component and related support for rendering CSV files. Add download link in the modal for appropriate file types including CSV, Code, and PDF.
* add name and description field to session datamodel
* Update website/blog/2023-12-01-AutoGenStudio/index.mdx
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* sanitize llmconfig, remove additional fields
* improve models UX, only modify models from model tab.
* readme updates
* improve db defaults
* improve ui hover behavior and add note on models
* general qol updats
* add support for returning summary_method
* use ant design tables
* icon and layout updates
* css and layout updates
* readme updates and QOL updates
* fix bug where empty string is used as apikey #1415
* add speaker selection to UI #1373
* Fixed a bug that localAgent updates were not synchronized between GroupChatFlowSpecView and AgentFlowSpecView.
* Fixed a bug in Agent Specification Modal that caused localAgent updates to remain in state when closing a modal other than onOk.
* Fixed a bug that the updated Agent Specification Modal was not saved when the content of FlowConfigViewer Modal was changed after the Agent Specification Modal was updated when an updatedFlowConfig was created using localFlowConfig.
* add version to package
* remove sample key
* early support for versions table and testing models
* Add support for testing model when created #1404
* remove unused imports, qol updates
* fix bug on workflowmanager
* make file_name optional in skills datamodel
* update instructions on models
* fix errors from merge conflict with main
* santize workflow before download
* add support for editing skills in full fledged editor (monaco) #1442
* fix merge artifacts
* Fix build command for windows
Replaced && to & to continue execution when the 'ui' folder doesn't exist and also suppressed error "The system cannot find the file specified."
* Fix setup instructions
The config file starts with a dot (according to gatsby-config.ts).
* Throw error if env file doesn't exist
Otherwise the app will not work (issue very hard to trace)
* version bump
* formattin gupdates
* formatting updates
* Show warning instead of error if env config file doesn't exist
Fix: https://github.com/microsoft/autogen/pull/1475#issuecomment-1918114520
* add rel noopener to a tags
* formating updates
* remove double section in readme.
* update dev readme
* format update
* add default autoreply to agent config datamodel
* add check for empty messages list
* improve groupchat behavior, add sender to list of agents
* update system_message defaults to fit autogen default system message #1474
* simplify response from test_model to only return content, fix serialization issue in #1404
* readme and other formatting updates
* add support for showing temp and default auto reply #1521
* formatting updates
* formating and other updates
---------
Co-authored-by: Paul Retherford <paul@scanpower.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: junkei_okinawa <ceazy.x2.okinawan@gmail.com>
Co-authored-by: Christopher Pereira <kripper@imatronix.com>
2024-02-05 18:45:18 -08:00
|
|
|
from openai import OpenAIError
|
2023-12-01 16:22:02 -08:00
|
|
|
|
2024-04-05 10:26:06 +08:00
|
|
|
from ..chatmanager import AutoGenChatManager, WebSocketConnectionManager
|
2024-05-11 07:31:21 -07:00
|
|
|
from ..database import workflow_from_id
|
|
|
|
from ..database.dbmanager import DBManager
|
|
|
|
from ..datamodel import Agent, Message, Model, Response, Session, Skill, Workflow
|
|
|
|
from ..utils import check_and_cast_datetime_fields, init_app_folders, md5_hash, test_model
|
|
|
|
from ..version import VERSION
|
2023-12-01 16:22:02 -08:00
|
|
|
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
managers = {"chat": None} # manage calls to autogen
|
|
|
|
# Create thread-safe queue for messages between api thread and autogen threads
|
|
|
|
message_queue = queue.Queue()
|
|
|
|
active_connections = []
|
|
|
|
active_connections_lock = asyncio.Lock()
|
|
|
|
websocket_manager = WebSocketConnectionManager(
|
2024-05-11 07:31:21 -07:00
|
|
|
active_connections=active_connections,
|
|
|
|
active_connections_lock=active_connections_lock,
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def message_handler():
|
|
|
|
while True:
|
|
|
|
message = message_queue.get()
|
2024-05-11 07:31:21 -07:00
|
|
|
logger.info(
|
|
|
|
"** Processing Agent Message on Queue: Active Connections: "
|
|
|
|
+ str([client_id for _, client_id in websocket_manager.active_connections])
|
|
|
|
+ " **"
|
|
|
|
)
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
for connection, socket_client_id in websocket_manager.active_connections:
|
|
|
|
if message["connection_id"] == socket_client_id:
|
2024-05-11 07:31:21 -07:00
|
|
|
logger.info(
|
|
|
|
f"Sending message to connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
|
|
|
)
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
asyncio.run(websocket_manager.send_message(message, connection))
|
2024-05-11 07:31:21 -07:00
|
|
|
else:
|
|
|
|
logger.info(
|
|
|
|
f"Skipping message for connection_id: {message['connection_id']}. Connection ID: {socket_client_id}"
|
|
|
|
)
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
message_queue.task_done()
|
|
|
|
|
|
|
|
|
|
|
|
message_handler_thread = threading.Thread(target=message_handler, daemon=True)
|
|
|
|
message_handler_thread.start()
|
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
app_file_path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
folders = init_app_folders(app_file_path)
|
|
|
|
ui_folder_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ui")
|
|
|
|
|
|
|
|
database_engine_uri = folders["database_engine_uri"]
|
|
|
|
dbmanager = DBManager(engine_uri=database_engine_uri)
|
|
|
|
|
|
|
|
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
@asynccontextmanager
|
|
|
|
async def lifespan(app: FastAPI):
|
|
|
|
print("***** App started *****")
|
|
|
|
managers["chat"] = AutoGenChatManager(message_queue=message_queue)
|
2024-05-11 07:31:21 -07:00
|
|
|
dbmanager.create_db_and_tables()
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
|
|
|
|
yield
|
|
|
|
# Close all active connections
|
|
|
|
await websocket_manager.disconnect_all()
|
|
|
|
print("***** App stopped *****")
|
2023-12-01 16:22:02 -08:00
|
|
|
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
|
|
|
|
app = FastAPI(lifespan=lifespan)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
|
|
|
# allow cross origin requests for testing on localhost:800* ports only
|
|
|
|
app.add_middleware(
|
|
|
|
CORSMiddleware,
|
|
|
|
allow_origins=[
|
|
|
|
"http://localhost:8000",
|
|
|
|
"http://127.0.0.1:8000",
|
|
|
|
"http://localhost:8001",
|
|
|
|
"http://localhost:8081",
|
|
|
|
],
|
|
|
|
allow_credentials=True,
|
|
|
|
allow_methods=["*"],
|
|
|
|
allow_headers=["*"],
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
api = FastAPI(root_path="/api")
|
|
|
|
# mount an api route such that the main route serves the ui and the /api
|
|
|
|
app.mount("/api", api)
|
|
|
|
|
2024-01-23 11:59:58 -08:00
|
|
|
app.mount("/", StaticFiles(directory=ui_folder_path, html=True), name="ui")
|
2024-05-11 07:31:21 -07:00
|
|
|
api.mount(
|
|
|
|
"/files",
|
|
|
|
StaticFiles(directory=folders["files_static_root"], html=True),
|
|
|
|
name="files",
|
|
|
|
)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
# manage websocket connections
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
def create_entity(model: Any, model_class: Any, filters: dict = None):
|
|
|
|
"""Create a new entity"""
|
|
|
|
model = check_and_cast_datetime_fields(model)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
try:
|
2024-05-11 07:31:21 -07:00
|
|
|
response: Response = dbmanager.upsert(model)
|
|
|
|
return response.model_dump(mode="json")
|
2023-12-01 16:22:02 -08:00
|
|
|
|
|
|
|
except Exception as ex_error:
|
|
|
|
print(ex_error)
|
|
|
|
return {
|
|
|
|
"status": False,
|
2024-05-11 07:31:21 -07:00
|
|
|
"message": f"Error occurred while creating {model_class.__name__}: " + str(ex_error),
|
2023-12-01 16:22:02 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
def list_entity(
|
|
|
|
model_class: Any,
|
|
|
|
filters: dict = None,
|
|
|
|
return_json: bool = True,
|
|
|
|
order: str = "desc",
|
|
|
|
):
|
|
|
|
"""List all entities for a user"""
|
|
|
|
return dbmanager.get(model_class, filters=filters, return_json=return_json, order=order)
|
2023-12-01 16:22:02 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
def delete_entity(model_class: Any, filters: dict = None):
|
|
|
|
"""Delete an entity"""
|
2023-12-01 16:22:02 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
return dbmanager.delete(filters=filters, model_class=model_class)
|
2023-12-01 16:22:02 -08:00
|
|
|
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/skills")
|
|
|
|
async def list_skills(user_id: str):
|
|
|
|
"""List all skills for a user"""
|
|
|
|
filters = {"user_id": user_id}
|
|
|
|
return list_entity(Skill, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2023-12-24 04:20:59 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/skills")
|
|
|
|
async def create_skill(skill: Skill):
|
|
|
|
"""Create a new skill"""
|
|
|
|
filters = {"user_id": skill.user_id}
|
|
|
|
return create_entity(skill, Skill, filters=filters)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/skills/delete")
|
|
|
|
async def delete_skill(skill_id: int, user_id: str):
|
|
|
|
"""Delete a skill"""
|
|
|
|
filters = {"id": skill_id, "user_id": user_id}
|
|
|
|
return delete_entity(Skill, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/models")
|
|
|
|
async def list_models(user_id: str):
|
|
|
|
"""List all models for a user"""
|
|
|
|
filters = {"user_id": user_id}
|
|
|
|
return list_entity(Model, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/models")
|
|
|
|
async def create_model(model: Model):
|
|
|
|
"""Create a new model"""
|
|
|
|
return create_entity(model, Model)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/models/test")
|
|
|
|
async def test_model_endpoint(model: Model):
|
|
|
|
"""Test a model"""
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
try:
|
2024-05-11 07:31:21 -07:00
|
|
|
response = test_model(model)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
return {
|
|
|
|
"status": True,
|
2024-05-11 07:31:21 -07:00
|
|
|
"message": "Model tested successfully",
|
|
|
|
"data": response,
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
}
|
2024-05-11 07:31:21 -07:00
|
|
|
except (OpenAIError, Exception) as ex_error:
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
return {
|
|
|
|
"status": False,
|
2024-05-11 07:31:21 -07:00
|
|
|
"message": "Error occurred while testing model: " + str(ex_error),
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/models/delete")
|
|
|
|
async def delete_model(model_id: int, user_id: str):
|
|
|
|
"""Delete a model"""
|
|
|
|
filters = {"id": model_id, "user_id": user_id}
|
|
|
|
return delete_entity(Model, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/agents")
|
|
|
|
async def list_agents(user_id: str):
|
|
|
|
"""List all agents for a user"""
|
|
|
|
filters = {"user_id": user_id}
|
|
|
|
return list_entity(Agent, filters=filters)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/agents")
|
|
|
|
async def create_agent(agent: Agent):
|
|
|
|
"""Create a new agent"""
|
|
|
|
return create_entity(agent, Agent)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/agents/delete")
|
|
|
|
async def delete_agent(agent_id: int, user_id: str):
|
|
|
|
"""Delete an agent"""
|
|
|
|
filters = {"id": agent_id, "user_id": user_id}
|
|
|
|
return delete_entity(Agent, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/agents/link/model/{agent_id}/{model_id}")
|
|
|
|
async def link_agent_model(agent_id: int, model_id: int):
|
|
|
|
"""Link a model to an agent"""
|
|
|
|
return dbmanager.link(link_type="agent_model", primary_id=agent_id, secondary_id=model_id)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2023-12-24 04:20:59 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/agents/link/model/{agent_id}/{model_id}")
|
|
|
|
async def unlink_agent_model(agent_id: int, model_id: int):
|
|
|
|
"""Unlink a model from an agent"""
|
|
|
|
return dbmanager.unlink(link_type="agent_model", primary_id=agent_id, secondary_id=model_id)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/agents/link/model/{agent_id}")
|
|
|
|
async def get_agent_models(agent_id: int):
|
|
|
|
"""Get all models linked to an agent"""
|
|
|
|
return dbmanager.get_linked_entities("agent_model", agent_id, return_json=True)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/agents/link/skill/{agent_id}/{skill_id}")
|
|
|
|
async def link_agent_skill(agent_id: int, skill_id: int):
|
|
|
|
"""Link an a skill to an agent"""
|
|
|
|
return dbmanager.link(link_type="agent_skill", primary_id=agent_id, secondary_id=skill_id)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2023-12-24 04:20:59 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/agents/link/skill/{agent_id}/{skill_id}")
|
|
|
|
async def unlink_agent_skill(agent_id: int, skill_id: int):
|
|
|
|
"""Unlink an a skill from an agent"""
|
|
|
|
return dbmanager.unlink(link_type="agent_skill", primary_id=agent_id, secondary_id=skill_id)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/agents/link/skill/{agent_id}")
|
|
|
|
async def get_agent_skills(agent_id: int):
|
|
|
|
"""Get all skills linked to an agent"""
|
|
|
|
return dbmanager.get_linked_entities("agent_skill", agent_id, return_json=True)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/agents/link/agent/{primary_agent_id}/{secondary_agent_id}")
|
|
|
|
async def link_agent_agent(primary_agent_id: int, secondary_agent_id: int):
|
|
|
|
"""Link an agent to another agent"""
|
|
|
|
return dbmanager.link(
|
|
|
|
link_type="agent_agent",
|
|
|
|
primary_id=primary_agent_id,
|
|
|
|
secondary_id=secondary_agent_id,
|
|
|
|
)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/agents/link/agent/{primary_agent_id}/{secondary_agent_id}")
|
|
|
|
async def unlink_agent_agent(primary_agent_id: int, secondary_agent_id: int):
|
|
|
|
"""Unlink an agent from another agent"""
|
|
|
|
return dbmanager.unlink(
|
|
|
|
link_type="agent_agent",
|
|
|
|
primary_id=primary_agent_id,
|
|
|
|
secondary_id=secondary_agent_id,
|
|
|
|
)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/agents/link/agent/{agent_id}")
|
|
|
|
async def get_linked_agents(agent_id: int):
|
|
|
|
"""Get all agents linked to an agent"""
|
|
|
|
return dbmanager.get_linked_entities("agent_agent", agent_id, return_json=True)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/workflows")
|
|
|
|
async def list_workflows(user_id: str):
|
|
|
|
"""List all workflows for a user"""
|
|
|
|
filters = {"user_id": user_id}
|
|
|
|
return list_entity(Workflow, filters=filters)
|
Autogenstudio Updates [CSV support, Workflow Export, Skill Editing, Windows Testing ] (#1475)
* support groupchat, other QOL fixes
* remove gallery success toast
* Fix #1328. Add CSVLoader component and related support for rendering CSV files. Add download link in the modal for appropriate file types including CSV, Code, and PDF.
* add name and description field to session datamodel
* Update website/blog/2023-12-01-AutoGenStudio/index.mdx
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* sanitize llmconfig, remove additional fields
* improve models UX, only modify models from model tab.
* readme updates
* improve db defaults
* improve ui hover behavior and add note on models
* general qol updats
* add support for returning summary_method
* use ant design tables
* icon and layout updates
* css and layout updates
* readme updates and QOL updates
* fix bug where empty string is used as apikey #1415
* add speaker selection to UI #1373
* Fixed a bug that localAgent updates were not synchronized between GroupChatFlowSpecView and AgentFlowSpecView.
* Fixed a bug in Agent Specification Modal that caused localAgent updates to remain in state when closing a modal other than onOk.
* Fixed a bug that the updated Agent Specification Modal was not saved when the content of FlowConfigViewer Modal was changed after the Agent Specification Modal was updated when an updatedFlowConfig was created using localFlowConfig.
* add version to package
* remove sample key
* early support for versions table and testing models
* Add support for testing model when created #1404
* remove unused imports, qol updates
* fix bug on workflowmanager
* make file_name optional in skills datamodel
* update instructions on models
* fix errors from merge conflict with main
* santize workflow before download
* add support for editing skills in full fledged editor (monaco) #1442
* fix merge artifacts
* Fix build command for windows
Replaced && to & to continue execution when the 'ui' folder doesn't exist and also suppressed error "The system cannot find the file specified."
* Fix setup instructions
The config file starts with a dot (according to gatsby-config.ts).
* Throw error if env file doesn't exist
Otherwise the app will not work (issue very hard to trace)
* version bump
* formattin gupdates
* formatting updates
* Show warning instead of error if env config file doesn't exist
Fix: https://github.com/microsoft/autogen/pull/1475#issuecomment-1918114520
* add rel noopener to a tags
* formating updates
* remove double section in readme.
* update dev readme
* format update
* add default autoreply to agent config datamodel
* add check for empty messages list
* improve groupchat behavior, add sender to list of agents
* update system_message defaults to fit autogen default system message #1474
* simplify response from test_model to only return content, fix serialization issue in #1404
* readme and other formatting updates
* add support for showing temp and default auto reply #1521
* formatting updates
* formating and other updates
---------
Co-authored-by: Paul Retherford <paul@scanpower.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: junkei_okinawa <ceazy.x2.okinawan@gmail.com>
Co-authored-by: Christopher Pereira <kripper@imatronix.com>
2024-02-05 18:45:18 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/workflows/{workflow_id}")
|
|
|
|
async def get_workflow(workflow_id: int, user_id: str):
|
|
|
|
"""Get a workflow"""
|
|
|
|
filters = {"id": workflow_id, "user_id": user_id}
|
|
|
|
return list_entity(Workflow, filters=filters)
|
Autogenstudio Updates [CSV support, Workflow Export, Skill Editing, Windows Testing ] (#1475)
* support groupchat, other QOL fixes
* remove gallery success toast
* Fix #1328. Add CSVLoader component and related support for rendering CSV files. Add download link in the modal for appropriate file types including CSV, Code, and PDF.
* add name and description field to session datamodel
* Update website/blog/2023-12-01-AutoGenStudio/index.mdx
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
* sanitize llmconfig, remove additional fields
* improve models UX, only modify models from model tab.
* readme updates
* improve db defaults
* improve ui hover behavior and add note on models
* general qol updats
* add support for returning summary_method
* use ant design tables
* icon and layout updates
* css and layout updates
* readme updates and QOL updates
* fix bug where empty string is used as apikey #1415
* add speaker selection to UI #1373
* Fixed a bug that localAgent updates were not synchronized between GroupChatFlowSpecView and AgentFlowSpecView.
* Fixed a bug in Agent Specification Modal that caused localAgent updates to remain in state when closing a modal other than onOk.
* Fixed a bug that the updated Agent Specification Modal was not saved when the content of FlowConfigViewer Modal was changed after the Agent Specification Modal was updated when an updatedFlowConfig was created using localFlowConfig.
* add version to package
* remove sample key
* early support for versions table and testing models
* Add support for testing model when created #1404
* remove unused imports, qol updates
* fix bug on workflowmanager
* make file_name optional in skills datamodel
* update instructions on models
* fix errors from merge conflict with main
* santize workflow before download
* add support for editing skills in full fledged editor (monaco) #1442
* fix merge artifacts
* Fix build command for windows
Replaced && to & to continue execution when the 'ui' folder doesn't exist and also suppressed error "The system cannot find the file specified."
* Fix setup instructions
The config file starts with a dot (according to gatsby-config.ts).
* Throw error if env file doesn't exist
Otherwise the app will not work (issue very hard to trace)
* version bump
* formattin gupdates
* formatting updates
* Show warning instead of error if env config file doesn't exist
Fix: https://github.com/microsoft/autogen/pull/1475#issuecomment-1918114520
* add rel noopener to a tags
* formating updates
* remove double section in readme.
* update dev readme
* format update
* add default autoreply to agent config datamodel
* add check for empty messages list
* improve groupchat behavior, add sender to list of agents
* update system_message defaults to fit autogen default system message #1474
* simplify response from test_model to only return content, fix serialization issue in #1404
* readme and other formatting updates
* add support for showing temp and default auto reply #1521
* formatting updates
* formating and other updates
---------
Co-authored-by: Paul Retherford <paul@scanpower.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
Co-authored-by: junkei_okinawa <ceazy.x2.okinawan@gmail.com>
Co-authored-by: Christopher Pereira <kripper@imatronix.com>
2024-02-05 18:45:18 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/workflows")
|
|
|
|
async def create_workflow(workflow: Workflow):
|
|
|
|
"""Create a new workflow"""
|
|
|
|
return create_entity(workflow, Workflow)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/workflows/delete")
|
|
|
|
async def delete_workflow(workflow_id: int, user_id: str):
|
|
|
|
"""Delete a workflow"""
|
|
|
|
filters = {"id": workflow_id, "user_id": user_id}
|
|
|
|
return delete_entity(Workflow, filters=filters)
|
|
|
|
|
|
|
|
|
|
|
|
@api.post("/workflows/link/agent/{workflow_id}/{agent_id}/{agent_type}")
|
|
|
|
async def link_workflow_agent(workflow_id: int, agent_id: int, agent_type: str):
|
|
|
|
"""Link an agent to a workflow"""
|
|
|
|
return dbmanager.link(
|
|
|
|
link_type="workflow_agent",
|
|
|
|
primary_id=workflow_id,
|
|
|
|
secondary_id=agent_id,
|
|
|
|
agent_type=agent_type,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@api.delete("/workflows/link/agent/{workflow_id}/{agent_id}/{agent_type}")
|
|
|
|
async def unlink_workflow_agent(workflow_id: int, agent_id: int, agent_type: str):
|
|
|
|
"""Unlink an agent from a workflow"""
|
|
|
|
return dbmanager.unlink(
|
|
|
|
link_type="workflow_agent",
|
|
|
|
primary_id=workflow_id,
|
|
|
|
secondary_id=agent_id,
|
|
|
|
agent_type=agent_type,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
@api.get("/workflows/link/agent/{workflow_id}/{agent_type}")
|
|
|
|
async def get_linked_workflow_agents(workflow_id: int, agent_type: str):
|
|
|
|
"""Get all agents linked to a workflow"""
|
|
|
|
return dbmanager.get_linked_entities(
|
|
|
|
link_type="workflow_agent",
|
|
|
|
primary_id=workflow_id,
|
|
|
|
agent_type=agent_type,
|
|
|
|
return_json=True,
|
|
|
|
)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/sessions")
|
|
|
|
async def list_sessions(user_id: str):
|
|
|
|
"""List all sessions for a user"""
|
|
|
|
filters = {"user_id": user_id}
|
|
|
|
return list_entity(Session, filters=filters)
|
2024-01-23 11:59:58 -08:00
|
|
|
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/sessions")
|
|
|
|
async def create_session(session: Session):
|
|
|
|
"""Create a new session"""
|
|
|
|
return create_entity(session, Session)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.delete("/sessions/delete")
|
|
|
|
async def delete_session(session_id: int, user_id: str):
|
|
|
|
"""Delete a session"""
|
|
|
|
filters = {"id": session_id, "user_id": user_id}
|
|
|
|
return delete_entity(Session, filters=filters)
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
|
2023-12-24 04:20:59 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.get("/sessions/{session_id}/messages")
|
|
|
|
async def list_messages(user_id: str, session_id: int):
|
|
|
|
"""List all messages for a use session"""
|
|
|
|
filters = {"user_id": user_id, "session_id": session_id}
|
|
|
|
return list_entity(Message, filters=filters, order="asc", return_json=True)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
@api.post("/sessions/{session_id}/workflow/{workflow_id}/run")
|
|
|
|
async def run_session_workflow(message: Message, session_id: int, workflow_id: int):
|
|
|
|
"""Runs a workflow on provided message"""
|
2023-12-24 04:20:59 -08:00
|
|
|
try:
|
2024-05-11 07:31:21 -07:00
|
|
|
user_message_history = (
|
|
|
|
dbmanager.get(
|
|
|
|
Message,
|
|
|
|
filters={"user_id": message.user_id, "session_id": message.session_id},
|
|
|
|
return_json=True,
|
|
|
|
).data
|
|
|
|
if session_id is not None
|
|
|
|
else []
|
|
|
|
)
|
|
|
|
# save incoming message
|
|
|
|
dbmanager.upsert(message)
|
|
|
|
user_dir = os.path.join(folders["files_static_root"], "user", md5_hash(message.user_id))
|
|
|
|
os.makedirs(user_dir, exist_ok=True)
|
|
|
|
workflow = workflow_from_id(workflow_id, dbmanager=dbmanager)
|
|
|
|
agent_response: Message = managers["chat"].chat(
|
|
|
|
message=message,
|
|
|
|
history=user_message_history,
|
|
|
|
user_dir=user_dir,
|
|
|
|
workflow=workflow,
|
|
|
|
connection_id=message.connection_id,
|
|
|
|
)
|
2023-12-24 04:20:59 -08:00
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
response: Response = dbmanager.upsert(agent_response)
|
|
|
|
return response.model_dump(mode="json")
|
2023-12-24 04:20:59 -08:00
|
|
|
except Exception as ex_error:
|
2024-05-11 07:31:21 -07:00
|
|
|
print(traceback.format_exc())
|
2023-12-24 04:20:59 -08:00
|
|
|
return {
|
|
|
|
"status": False,
|
2024-05-11 07:31:21 -07:00
|
|
|
"message": "Error occurred while processing message: " + str(ex_error),
|
Sample Web Application Built with AutoGen (#695)
* Adding research assistant code
* Adding research assistant code
* checking in RA files
* Remove used text file
* Update README.md to include Saleema's name to the Contributors list.
* remove extraneous files
* update gitignore
* improve structure on global skills
* fix linting error
* readme update
* readme update
* fix wrong function bug
* readme update
* update ui build
* cleanup, remove unused modules
* readme and docs updates
* set default user
* ui build update
* add screenshot to improve instructions
* remove logout behaviour, replace with note to developers to add their own logout logic
* Create blog and edit ARA README
* Added the stock prices example in the readme for ARA
* Include edits from review with Saleema
* fix format issues
* Cosmetic changes for betting debug messages
* edit authors
* remove references to request_timeout to support autogen v0.0.2
* update bg color for UI
* readme update
* update research assistant blog post
* omit samples folder from codecov
* ui build update + precommit refactor
* formattiing updates fromo pre-commit
* readme update
* remove compiled source files
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* update gitignore
* refactor, file removals
* refactor for improved structure - datamodel, chat and db helper
* refactor skills view
* general refactor
* gitignore update and general refactor
* skills update
* general refactor
* ui folder structure refactor
* improve support for skills loading
* add fetch profile default skill
* refactor chat to autogenchat
* qol refactor
* improve metadata display
* early support for autogenflow in ui
* docs update general refactor
* general refactor
* readme update
* readme update
* readme and cli update
* pre-commit updates
* precommit update
* readme update
* add steup.py for older python build versions
* add manifest.in, update app icon
* in-progress changes to agent specification
* remove use_cache refs
* update datamodel, and fix for default serverurl
* request_timeout
* readme update, fix autogen values
* fix pyautogen version
* precommit formatting and other qol items
* update folder structure
* req update
* readme and docs update
* docs update
* remove duplicate in yaml file
* add support for explicit skills addition
* readme and documentation updates
* general refactor
* remove blog post, schedule for future PR
* readme update, add info on llmconfig
* make use_cache False by default unless set
* minor ui updates
* upgrade ui to use latest uatogen lib version 0.2.0b5
* Ui refactor, support for adding arbitrary model specifications
* formatting/precommit checks
* update readme, utils default skill
---------
Co-authored-by: Piali Choudhury <pialic@microsoft.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
2023-11-20 10:40:30 -08:00
|
|
|
}
|
2024-01-23 11:59:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
@api.get("/version")
|
|
|
|
async def get_version():
|
|
|
|
return {
|
|
|
|
"status": True,
|
|
|
|
"message": "Version retrieved successfully",
|
|
|
|
"data": {"version": VERSION},
|
|
|
|
}
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
|
|
|
|
|
2024-05-11 07:31:21 -07:00
|
|
|
# websockets
|
|
|
|
|
|
|
|
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
async def process_socket_message(data: dict, websocket: WebSocket, client_id: str):
|
|
|
|
print(f"Client says: {data['type']}")
|
|
|
|
if data["type"] == "user_message":
|
2024-05-11 07:31:21 -07:00
|
|
|
user_message = Message(**data["data"])
|
|
|
|
session_id = data["data"].get("session_id", None)
|
|
|
|
workflow_id = data["data"].get("workflow_id", None)
|
|
|
|
response = await run_session_workflow(message=user_message, session_id=session_id, workflow_id=workflow_id)
|
Autogenstudio Updates [Upload/Dowload of Skills/Workflows, Streaming Agent Replies, Agent Message Summarization] (#1801)
* update default agent system message
* session friendly name functionality
* minor formatting
* fix issues with groupchat and version bump
* fix issues with groupchat and version bump. address #1580
* update groupchat system message
* add support for copying message in chatbox
* rewrite how agent history is maintained in workflow manager. Directly extend GroupChat and Conversable agent and override process_message method. Allow passing a message processor.
Fixes bug where the last message from a groupchat manager does not get called via register_reply.
* general qol updates
* add support for downloading + copying skills, models and agents from UI
* add regex check to agent name, address #1507
* add support for uploading workflow files
* refactor, add support for streaming intermediate agent response to ui
* improve streaming ux
* add support for uploading skills, models, agents, workflows
* add datamodel for socket message
* version update
* fix chatbox height bug
* fix csv pagination issue
* improve hidden menu for uploading entities
* fix minor issue with animation timing on chat interface
* version bump, css fixes
* use description field in autogen conversable class for description
* add implementation for llm summarization of agent chat
* support for llm summary of agent history
* formatting fixes
* formatting updates
* add dockerfile to run autogenstudio in a docker contailer
* autogenstudio docker container
* updates to websockets
* update socket connection logic,
* support using socket for passing message requests where a socket is available
* improve command for building frontend
* formatting updates
* remove duplicated code
# overwrite skills.py in work_dir is duplicated
* update description location
as Where the code calls is like config.description
* version bump
* refactor to ensure each session and call within a session has an independent working directory
* support use of socket for sending messages where available
* use rsync to copy built files to ui direction instead of cp -rT
* spelling correctino
* readme update
* fix numpy version
* version bump
* add support for dot env variables and updating default app dir to /home/<user>/.autogenstudio
* formatting update
* update gitignore
* formatting updates
---------
Co-authored-by: James Woffinden-Luey <jluey@microsoft.com>
Co-authored-by: cillyfly <cillyfly@gmail.com>
2024-03-15 19:44:47 -07:00
|
|
|
response_socket_message = {
|
|
|
|
"type": "agent_response",
|
|
|
|
"data": response,
|
|
|
|
"connection_id": client_id,
|
|
|
|
}
|
|
|
|
await websocket_manager.send_message(response_socket_message, websocket)
|
|
|
|
|
|
|
|
|
|
|
|
@api.websocket("/ws/{client_id}")
|
|
|
|
async def websocket_endpoint(websocket: WebSocket, client_id: str):
|
|
|
|
await websocket_manager.connect(websocket, client_id)
|
|
|
|
try:
|
|
|
|
while True:
|
|
|
|
data = await websocket.receive_json()
|
|
|
|
await process_socket_message(data, websocket, client_id)
|
|
|
|
except WebSocketDisconnect:
|
|
|
|
print(f"Client #{client_id} is disconnected")
|
|
|
|
await websocket_manager.disconnect(websocket)
|