From 0b9cf0e3dc8d0f60ebcd8d71e325355a6d8824d6 Mon Sep 17 00:00:00 2001 From: Kumaran Rajendhiran Date: Thu, 12 Sep 2024 13:26:26 +0530 Subject: [PATCH 1/8] Update tests to support both pydantic v2.8 and v2.9 (#185) * Update tests to support pydantic v2.9 * Update tests to support both pydantic v2.8 and v2.9 * wip * Use jsondiff to reduce duplicates in tests --------- Co-authored-by: Davor Runje --- pyproject.toml | 3 +- tests/api/openapi/test_end2end.py | 306 +++++++++++++++++- tests/conftest.py | 6 + .../models/deployments/test_deployment.py | 14 +- tests/studio/models/llms/test_anthropic.py | 10 +- tests/studio/models/llms/test_azure.py | 10 +- tests/studio/models/llms/test_openai.py | 10 +- tests/studio/models/llms/test_together.py | 10 +- 8 files changed, 340 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 09d5e0f4c..86e7a77f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ openapi = [ studio = [ "faststream[nats]>=0.5.10,<0.6", - "pydantic>=2.3,<2.9", + "pydantic>=2.3,<3", "fastapi==0.114.0", "prisma>=0.13.1,<0.15", "asyncer==0.0.7", @@ -131,6 +131,7 @@ test-core = [ "pytest-asyncio==0.24.0", "dirty-equals==0.8.0", "pytest-rerunfailures==14.0", + "jsondiff==2.2.1", ] testing = [ diff --git a/tests/api/openapi/test_end2end.py b/tests/api/openapi/test_end2end.py index ac414a20f..2faeb1195 100644 --- a/tests/api/openapi/test_end2end.py +++ b/tests/api/openapi/test_end2end.py @@ -5,6 +5,7 @@ from typing import Annotated, Any, Optional import fastapi +import jsondiff import pytest from autogen.agentchat import ConversableAgent from fastapi import Body, FastAPI, Query @@ -85,7 +86,9 @@ def test_openapi_app(self, fastapi_app: FastAPI) -> None: def openapi_schema(self, fastapi_app: FastAPI) -> dict[str, Any]: return fastapi_app.openapi() - def test_openapi_schema(self, openapi_schema: dict[str, Any]) -> None: + def test_openapi_schema( + self, openapi_schema: dict[str, Any], pydantic_version: float + ) -> None: expected = { "openapi": "3.1.0", "info": { @@ -179,11 +182,8 @@ def test_openapi_schema(self, openapi_schema: dict[str, Any]) -> None: "content": { "application/json": { "schema": { - "allOf": [ - {"$ref": "#/components/schemas/Item"} - ], + "$ref": "#/components/schemas/Item", "description": "The item to update", - "title": "Item", } } }, @@ -262,10 +262,7 @@ def test_openapi_schema(self, openapi_schema: dict[str, Any]) -> None: "content": { "application/json": { "schema": { - "allOf": [ - {"$ref": "#/components/schemas/Item"} - ], - "title": "Item", + "$ref": "#/components/schemas/Item", "description": "The item to create", } } @@ -354,6 +351,10 @@ def test_openapi_schema(self, openapi_schema: dict[str, Any]) -> None: } }, } + pydantic28_delta = '{"paths": {"/items/{item_id}": {"put": {"requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$$ref": "#/components/schemas/Item"}], "title": "Item", "$delete": ["$$ref"]}}}}}}, "/items/": {"post": {"requestBody": {"content": {"application/json": {"schema": {"allOf": [{"$$ref": "#/components/schemas/Item"}], "title": "Item", "$delete": ["$$ref"]}}}}}}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, openapi_schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) # print(openapi_schema) assert openapi_schema == expected @@ -366,8 +367,10 @@ def generated_code_path(self, openapi_schema: dict[str, Any]) -> Iterator[Path]: ) yield td - def test_generated_code_main(self, generated_code_path: Path) -> None: - expected = '''# generated by fastapi-codegen: + def test_generated_code_main( + self, generated_code_path: Path, pydantic_version: float + ) -> None: + expected_pydantic_v28 = '''# generated by fastapi-codegen: # filename: openapi.json from __future__ import annotations @@ -458,6 +461,98 @@ def delete_item_items__item_id__delete( """ pass ''' + expected_pydantic_v29 = '''# generated by fastapi-codegen: +# filename: openapi.json + +from __future__ import annotations + +from typing import * +from typing import Optional, Union + +from fastagency.api.openapi import OpenAPI + +from models_tmp61z6vu75 import ( + HTTPValidationError, + Item, + ItemsItemIdDeleteResponse, + ItemsItemIdGetResponse, + ItemsItemIdPutResponse, + ItemsPostResponse, +) + +app = OpenAPI( + title='My FastAPI app', + description='Test FastAPI app to check OpenAPI schema generation.', + version='0.1.0', + servers=[ + {'url': 'https://stag.example.com', 'description': 'Staging environment'}, + {'url': 'https://prod.example.com', 'description': 'Production environment'}, + ], +) + + +@app.post( + '/items/', + response_model=ItemsPostResponse, + responses={'422': {'model': HTTPValidationError}}, +) +def create_item_items__post( + body: Item, +) -> Union[ItemsPostResponse, HTTPValidationError]: + """ + Create Item + """ + pass + + +@app.get( + '/items/{item_id}', + response_model=ItemsItemIdGetResponse, + description="Read an item by ID", + responses={'422': {'model': HTTPValidationError}}, +) +def read_item_items__item_id__get( + item_id: Annotated[int, """The ID of the item to get"""], + q: Annotated[Optional[str], """some extra query parameter"""] = None, +) -> Union[ItemsItemIdGetResponse, HTTPValidationError]: + """ + Read Item + """ + pass + + +@app.put( + '/items/{item_id}', + response_model=ItemsItemIdPutResponse, + description="Update an item by ID", + responses={'422': {'model': HTTPValidationError}}, +) +def update_item_items__item_id__put( + item_id: Annotated[int, """The ID of the item to update"""], body: Item = ... +) -> Union[ItemsItemIdPutResponse, HTTPValidationError]: + """ + Update Item + """ + pass + + +@app.delete( + '/items/{item_id}', + response_model=ItemsItemIdDeleteResponse, + description="Delete an item by ID", + responses={'422': {'model': HTTPValidationError}}, +) +def delete_item_items__item_id__delete( + item_id: Annotated[int, """The ID of the item to delete"""] +) -> Union[ItemsItemIdDeleteResponse, HTTPValidationError]: + """ + Delete Item + """ + pass +''' + expected = ( + expected_pydantic_v28 if pydantic_version < 2.9 else expected_pydantic_v29 + ) suffix = generated_code_path.name expected = expected.replace("tmp61z6vu75", suffix) @@ -472,8 +567,10 @@ def delete_item_items__item_id__delete( # print(main) assert main == expected - def test_generated_code_models(self, generated_code_path: Path) -> None: - expected = """# generated by fastapi-codegen: + def test_generated_code_models( + self, generated_code_path: Path, pydantic_version: float + ) -> None: + expected_pydantic_v28 = """# generated by fastapi-codegen: # filename: openapi.json from __future__ import annotations @@ -525,6 +622,54 @@ class ItemsPostResponse(BaseModel): class HTTPValidationError(BaseModel): detail: Optional[List[ValidationError]] = Field(None, title='Detail') """ + expected_pydantic_v29 = """# generated by fastapi-codegen: +# filename: openapi.json + +from __future__ import annotations + +from typing import List, Optional, Union + +from pydantic import BaseModel, Field + + +class Item(BaseModel): + name: str = Field(..., description='The name of the item', title='Name') + description: Optional[str] = Field( + None, description='The description of the item', title='Description' + ) + price: float = Field(..., title='Price') + tax: Optional[float] = Field(None, title='Tax') + + +class ValidationError(BaseModel): + loc: List[Union[str, int]] = Field(..., title='Location') + msg: str = Field(..., title='Message') + type: str = Field(..., title='Error Type') + + +class ItemsItemIdGetResponse(BaseModel): + pass + + +class ItemsItemIdPutResponse(BaseModel): + pass + + +class ItemsItemIdDeleteResponse(BaseModel): + pass + + +class ItemsPostResponse(BaseModel): + pass + + +class HTTPValidationError(BaseModel): + detail: Optional[List[ValidationError]] = Field(None, title='Detail') +""" + + expected = ( + expected_pydantic_v28 if pydantic_version < 2.9 else expected_pydantic_v29 + ) assert generated_code_path.exists() assert generated_code_path.is_dir() suffix = generated_code_path.name @@ -561,9 +706,12 @@ def test_client(self, client: OpenAPI) -> None: assert func_desc == expected_func_desc def test_register_for_llm( - self, client: OpenAPI, azure_gpt35_turbo_16k_llm_config: dict[str, Any] + self, + client: OpenAPI, + azure_gpt35_turbo_16k_llm_config: dict[str, Any], + pydantic_version: float, ) -> None: - expected_tools = [ + expected_tools_pydantic_v28 = [ { "type": "function", "function": { @@ -685,7 +833,133 @@ def test_register_for_llm( }, }, ] - + expected_tools_pydantic_v29 = [ + { + "type": "function", + "function": { + "description": "Create Item", + "name": "create_item_items__post", + "parameters": { + "type": "object", + "properties": { + "body": { + "properties": { + "name": { + "description": "The name of the item", + "title": "Name", + "type": "string", + }, + "description": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "The description of the item", + "title": "Description", + }, + "price": {"title": "Price", "type": "number"}, + "tax": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "title": "Tax", + }, + }, + "required": ["name", "price"], + "title": "Item", + "type": "object", + "description": "body", + } + }, + "required": ["body"], + }, + }, + }, + { + "type": "function", + "function": { + "description": "Read an item by ID", + "name": "read_item_items__item_id__get", + "parameters": { + "type": "object", + "properties": { + "item_id": { + "type": "integer", + "description": "The ID of the item to get", + }, + "q": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "some extra query parameter", + }, + }, + "required": ["item_id"], + }, + }, + }, + { + "type": "function", + "function": { + "description": "Update an item by ID", + "name": "update_item_items__item_id__put", + "parameters": { + "type": "object", + "properties": { + "item_id": { + "type": "integer", + "description": "The ID of the item to update", + }, + "body": { + "properties": { + "name": { + "description": "The name of the item", + "title": "Name", + "type": "string", + }, + "description": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "The description of the item", + "title": "Description", + }, + "price": {"title": "Price", "type": "number"}, + "tax": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "title": "Tax", + }, + }, + "required": ["name", "price"], + "title": "Item", + "type": "object", + "default": Ellipsis, + "description": "body", + }, + }, + "required": ["item_id"], + }, + }, + }, + { + "type": "function", + "function": { + "description": "Delete an item by ID", + "name": "delete_item_items__item_id__delete", + "parameters": { + "type": "object", + "properties": { + "item_id": { + "type": "integer", + "description": "The ID of the item to delete", + } + }, + "required": ["item_id"], + }, + }, + }, + ] + expected_tools = ( + expected_tools_pydantic_v28 + if pydantic_version < 2.9 + else expected_tools_pydantic_v29 + ) agent = ConversableAgent( name="agent", llm_config=azure_gpt35_turbo_16k_llm_config ) diff --git a/tests/conftest.py b/tests/conftest.py index 0197c47ca..91b2844f9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,6 +22,7 @@ import uvicorn from fastapi import FastAPI, Path from pydantic import BaseModel +from pydantic import __version__ as version_of_pydantic from fastagency.studio.db.base import DefaultDB from fastagency.studio.db.inmemory import InMemoryBackendDB, InMemoryFrontendDB @@ -559,6 +560,11 @@ async def weather_toolbox_ref( return toolbox +@pytest.fixture +def pydantic_version() -> float: + return float(".".join(version_of_pydantic.split(".")[:2])) + + ################################################################################ ### # Fixtures for Agents diff --git a/tests/studio/models/deployments/test_deployment.py b/tests/studio/models/deployments/test_deployment.py index 9bd8c78fc..c3fbc21a0 100644 --- a/tests/studio/models/deployments/test_deployment.py +++ b/tests/studio/models/deployments/test_deployment.py @@ -1,5 +1,7 @@ +import json import uuid +import jsondiff import pytest from pydantic import ValidationError @@ -45,7 +47,7 @@ def test_deployment_constructor( assert deployment.team == team - def test_deployment_model_schema(self) -> None: + def test_deployment_model_schema(self, pydantic_version: float) -> None: schema = Deployment.model_json_schema() expected = { "$defs": { @@ -158,17 +160,17 @@ def test_deployment_model_schema(self) -> None: "type": "string", }, "team": { - "allOf": [{"$ref": "#/$defs/TwoAgentTeamRef"}], + "$ref": "#/$defs/TwoAgentTeamRef", "description": "The team that is used in the deployment", "title": "Team Name", }, "gh_token": { - "allOf": [{"$ref": "#/$defs/GitHubTokenRef"}], + "$ref": "#/$defs/GitHubTokenRef", "description": "The GitHub token to use for creating a new repository", "title": "GH Token", }, "fly_token": { - "allOf": [{"$ref": "#/$defs/FlyTokenRef"}], + "$ref": "#/$defs/FlyTokenRef", "description": "The Fly.io token to use for deploying the deployment", "title": "Fly Token", }, @@ -185,6 +187,10 @@ def test_deployment_model_schema(self) -> None: "type": "object", } # print(schema) + pydantic28_delta = '{"properties": {"team": {"allOf": [{"$$ref": "#/$defs/TwoAgentTeamRef"}], "$delete": ["$$ref"]}, "gh_token": {"allOf": [{"$$ref": "#/$defs/GitHubTokenRef"}], "$delete": ["$$ref"]}, "fly_token": {"allOf": [{"$$ref": "#/$defs/FlyTokenRef"}], "$delete": ["$$ref"]}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) assert schema == expected @pytest.mark.parametrize( diff --git a/tests/studio/models/llms/test_anthropic.py b/tests/studio/models/llms/test_anthropic.py index dc1443a20..df1622dd3 100644 --- a/tests/studio/models/llms/test_anthropic.py +++ b/tests/studio/models/llms/test_anthropic.py @@ -1,5 +1,7 @@ +import json import uuid +import jsondiff import pytest from fastagency.studio.helpers import get_model_by_ref @@ -49,7 +51,7 @@ def test_anthropic_constructor_failure(self) -> None: name="Hello World!", ) - def test_anthropic_model_schema(self) -> None: + def test_anthropic_model_schema(self, pydantic_version: float) -> None: schema = Anthropic.model_json_schema() expected = { "$defs": { @@ -103,7 +105,7 @@ def test_anthropic_model_schema(self) -> None: "type": "string", }, "api_key": { - "allOf": [{"$ref": "#/$defs/AnthropicAPIKeyRef"}], + "$ref": "#/$defs/AnthropicAPIKeyRef", "description": "The API Key from Anthropic", "title": "API Key", }, @@ -138,6 +140,10 @@ def test_anthropic_model_schema(self) -> None: "type": "object", } # print(schema) + pydantic28_delta = '{"properties": {"api_key": {"allOf": [{"$$ref": "#/$defs/AnthropicAPIKeyRef"}], "$delete": ["$$ref"]}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) assert schema == expected @pytest.mark.asyncio diff --git a/tests/studio/models/llms/test_azure.py b/tests/studio/models/llms/test_azure.py index d1cda9a25..c6f4ddd56 100644 --- a/tests/studio/models/llms/test_azure.py +++ b/tests/studio/models/llms/test_azure.py @@ -1,5 +1,7 @@ +import json from typing import Any +import jsondiff import pytest from pydantic import ValidationError @@ -80,7 +82,7 @@ async def test_azure_constructor_with_invalid_base_url( temperature=model.temperature, ) - def test_azure_model_schema(self) -> None: + def test_azure_model_schema(self, pydantic_version: float) -> None: schema = AzureOAI.model_json_schema() expected = { "$defs": { @@ -128,7 +130,7 @@ def test_azure_model_schema(self) -> None: "type": "string", }, "api_key": { - "allOf": [{"$ref": "#/$defs/AzureOAIAPIKeyRef"}], + "$ref": "#/$defs/AzureOAIAPIKeyRef", "description": "The API Key from Azure OpenAI", "title": "API Key", }, @@ -179,6 +181,10 @@ def test_azure_model_schema(self) -> None: "type": "object", } # print(schema) + pydantic28_delta = '{"properties": {"api_key": {"allOf": [{"$$ref": "#/$defs/AzureOAIAPIKeyRef"}], "$delete": ["$$ref"]}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) assert schema == expected @pytest.mark.asyncio diff --git a/tests/studio/models/llms/test_openai.py b/tests/studio/models/llms/test_openai.py index 7110f2059..29fec5edd 100644 --- a/tests/studio/models/llms/test_openai.py +++ b/tests/studio/models/llms/test_openai.py @@ -1,5 +1,7 @@ +import json import uuid +import jsondiff import openai import pytest @@ -83,7 +85,7 @@ def test_openai_model_list(self) -> None: assert set(model_list) == set(OpenAIModels.__args__), OpenAIModels.__args__ # type: ignore[attr-defined] - def test_openai_schema(self) -> None: + def test_openai_schema(self, pydantic_version: float) -> None: schema = OpenAI.model_json_schema() expected = { "$defs": { @@ -152,7 +154,7 @@ def test_openai_schema(self) -> None: "type": "string", }, "api_key": { - "allOf": [{"$ref": "#/$defs/OpenAIAPIKeyRef"}], + "$ref": "#/$defs/OpenAIAPIKeyRef", "description": "The API Key from OpenAI", "title": "API Key", }, @@ -187,6 +189,10 @@ def test_openai_schema(self) -> None: "type": "object", } # print(schema) + pydantic28_delta = '{"properties": {"api_key": {"allOf": [{"$$ref": "#/$defs/OpenAIAPIKeyRef"}], "$delete": ["$$ref"]}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) assert schema == expected @pytest.mark.asyncio diff --git a/tests/studio/models/llms/test_together.py b/tests/studio/models/llms/test_together.py index f311c51e2..a051e3d33 100644 --- a/tests/studio/models/llms/test_together.py +++ b/tests/studio/models/llms/test_together.py @@ -1,5 +1,7 @@ +import json import uuid +import jsondiff import pytest import together @@ -84,7 +86,7 @@ async def test_togetherai_constructor( } assert model.model_dump() == expected - def test_togetherai_schema(self) -> None: + def test_togetherai_schema(self, pydantic_version: float) -> None: schema = TogetherAI.model_json_schema() expected = { "$defs": { @@ -132,7 +134,7 @@ def test_togetherai_schema(self) -> None: "type": "string", }, "api_key": { - "allOf": [{"$ref": "#/$defs/TogetherAIAPIKeyRef"}], + "$ref": "#/$defs/TogetherAIAPIKeyRef", "description": "The API Key from Together.ai", "title": "API Key", }, @@ -172,6 +174,10 @@ def test_togetherai_schema(self) -> None: ) schema["properties"]["model"].pop("enum") # print(schema) + pydantic28_delta = '{"properties": {"api_key": {"allOf": [{"$$ref": "#/$defs/TogetherAIAPIKeyRef"}], "$delete": ["$$ref"]}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected, schema, dump=True)}'") + expected = jsondiff.patch(json.dumps(expected), pydantic28_delta, load=True) assert schema == expected @pytest.mark.asyncio From bb8ce5147d417324c93c73ce9ef27eca5779e80d Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 12 Sep 2024 10:04:24 +0200 Subject: [PATCH 2/8] Refactoring submodules (#188) * wip * tests fixed * UI classes renamed --- docs/docs/SUMMARY.md | 138 +++++++++--------- .../en/api/fastagency/{core => }/Chatable.md | 2 +- .../api/fastagency/FunctionCallExecution.md | 11 ++ .../en/api/fastagency/{core => }/IOMessage.md | 2 +- docs/docs/en/api/fastagency/MultipleChoice.md | 11 ++ .../api/fastagency/SuggestedFunctionCall.md | 11 ++ .../en/api/fastagency/{core => }/TextInput.md | 2 +- docs/docs/en/api/fastagency/TextMessage.md | 11 ++ .../en/api/fastagency/{core => }/Workflows.md | 2 +- docs/docs/en/api/fastagency/app/FastAgency.md | 11 ++ .../en/api/fastagency/base/AskingMessage.md | 11 ++ docs/docs/en/api/fastagency/base/Chatable.md | 11 ++ .../{core => base}/FunctionCallExecution.md | 2 +- docs/docs/en/api/fastagency/base/IOMessage.md | 11 ++ .../api/fastagency/base/IOMessageVisitor.md | 11 ++ .../{core => base}/MultipleChoice.md | 2 +- .../fastagency/{core => }/base/Runnable.md | 2 +- .../{core => base}/SuggestedFunctionCall.md | 2 +- .../en/api/fastagency/base/SystemMessage.md | 11 ++ docs/docs/en/api/fastagency/base/TextInput.md | 11 ++ .../fastagency/{core => base}/TextMessage.md | 2 +- .../api/fastagency/base/WorkflowCompleted.md | 11 ++ docs/docs/en/api/fastagency/base/Workflows.md | 11 ++ .../en/api/fastagency/base/run_workflow.md | 11 ++ .../en/api/fastagency/core/app/FastAgency.md | 11 -- .../api/fastagency/core/base/AskingMessage.md | 11 -- .../en/api/fastagency/core/base/Chatable.md | 11 -- .../core/base/FunctionCallExecution.md | 11 -- .../en/api/fastagency/core/base/IOMessage.md | 11 -- .../fastagency/core/base/IOMessageVisitor.md | 11 -- .../fastagency/core/base/MultipleChoice.md | 11 -- .../core/base/SuggestedFunctionCall.md | 11 -- .../api/fastagency/core/base/SystemMessage.md | 11 -- .../en/api/fastagency/core/base/TextInput.md | 11 -- .../api/fastagency/core/base/TextMessage.md | 11 -- .../fastagency/core/base/WorkflowCompleted.md | 11 -- .../en/api/fastagency/core/base/Workflows.md | 11 -- .../fastagency/core/io/console/ConsoleIO.md | 11 -- .../core/io/console/base/ConsoleIO.md | 11 -- .../api/fastagency/core/io/mesop/MesopIO.md | 11 -- .../fastagency/core/io/mesop/base/MesopIO.md | 11 -- .../core/io/mesop/base/MesopMessage.md | 11 -- .../core/io/mesop/base/run_workflow.md | 11 -- .../mesop/components/inputs/input_prompt.md | 11 -- .../components/inputs/input_user_feedback.md | 11 -- .../components/ui_common/darken_hex_color.md | 11 -- .../io/mesop/components/ui_common/header.md | 11 -- .../core/io/mesop/data_model/Conversation.md | 11 -- .../core/io/mesop/data_model/State.md | 11 -- .../core/io/mesop/main/conversation_box.md | 11 -- .../io/mesop/main/conversation_starter_box.md | 11 -- .../core/io/mesop/main/get_workflows.md | 11 -- .../core/io/mesop/main/home_page.md | 11 -- .../core/io/mesop/main/on_user_feedback.md | 11 -- .../io/mesop/main/past_conversations_box.md | 11 -- .../core/io/mesop/main/send_prompt.md | 11 -- .../mesop/message/MesopGUIMessageVisitor.md | 11 -- .../core/io/mesop/message/message_box.md | 11 -- .../send_prompt/send_prompt_to_autogen.md | 11 -- .../send_user_feedback_to_autogen.md | 11 -- .../runtimes/autogen/base/AutoGenWorkflows.md | 11 -- .../runtimes/autogen/base/CurrentMessage.md | 11 -- .../runtimes/autogen/base/IOStreamAdapter.md | 11 -- .../runtimes/autogen/AutoGenWorkflows.md | 11 ++ .../runtimes/autogen/IOStreamAdapter.md | 11 ++ .../autogen/base}/AutoGenWorkflows.md | 2 +- .../runtimes/autogen/base/CurrentMessage.md | 11 ++ .../autogen/base}/IOStreamAdapter.md | 2 +- .../en/api/fastagency/ui/console/ConsoleUI.md | 11 ++ .../fastagency/ui/console/base/ConsoleUI.md | 11 ++ .../FastAgency.md => ui/mesop/MesopUI.md} | 2 +- .../fastagency/ui/mesop/base/MesopMessage.md | 11 ++ .../api/fastagency/ui/mesop/base/MesopUI.md | 11 ++ .../{core => ui/mesop}/base/run_workflow.md | 2 +- .../mesop/components/inputs/input_prompt.md | 11 ++ .../components/inputs/input_user_feedback.md | 11 ++ .../components/ui_common/darken_hex_color.md | 11 ++ .../ui/mesop/components/ui_common/header.md | 11 ++ .../ui/mesop/data_model/Conversation.md | 11 ++ .../fastagency/ui/mesop/data_model/State.md | 11 ++ .../ui/mesop/main/conversation_box.md | 11 ++ .../ui/mesop/main/conversation_starter_box.md | 11 ++ .../fastagency/ui/mesop/main/get_workflows.md | 11 ++ .../api/fastagency/ui/mesop/main/home_page.md | 11 ++ .../ui/mesop/main/on_user_feedback.md | 11 ++ .../ui/mesop/main/past_conversations_box.md | 11 ++ .../fastagency/ui/mesop/main/send_prompt.md | 11 ++ .../mesop/message/MesopGUIMessageVisitor.md | 11 ++ .../ui/mesop/message/message_box.md | 11 ++ .../send_prompt/send_prompt_to_autogen.md | 11 ++ .../send_user_feedback_to_autogen.md | 11 ++ .../tutorial/custom_user_interactions/main.py | 10 +- .../tutorial/external_rest_apis/main.py | 8 +- .../tutorial/external_rest_apis/security.py | 8 +- .../docs_src/tutorial/getting_started/main.py | 8 +- examples/cli/main_console.py | 8 +- examples/cli/main_mesop.py | 8 +- examples/cli/main_user_proxy.py | 8 +- fastagency/__init__.py | 29 +++- fastagency/{core => }/app.py | 0 fastagency/{core => }/base.py | 0 fastagency/core/__init__.py | 27 ---- fastagency/core/io/console/__init__.py | 3 - fastagency/core/io/mesop/__init__.py | 3 - fastagency/{core/io => runtimes}/__init__.py | 0 .../{core => }/runtimes/autogen/__init__.py | 0 .../{core => }/runtimes/autogen/base.py | 2 +- .../io/mesop/components => ui}/__init__.py | 0 fastagency/ui/console/__init__.py | 3 + fastagency/{core/io => ui}/console/base.py | 18 +-- fastagency/ui/mesop/__init__.py | 3 + fastagency/{core/io => ui}/mesop/base.py | 32 ++-- .../mesop/components}/__init__.py | 0 .../io => ui}/mesop/components/inputs.py | 0 .../io => ui}/mesop/components/ui_common.py | 0 .../{core/io => ui}/mesop/data_model.py | 0 fastagency/{core/io => ui}/mesop/main.py | 18 +-- fastagency/{core/io => ui}/mesop/message.py | 0 .../{core/io => ui}/mesop/send_prompt.py | 4 +- fastagency/{core/io => ui}/mesop/styles.py | 0 tests/cli/test_discover.py | 9 +- tests/core/io/console/__init__.py | 0 tests/{core => }/test_autogen.py | 12 +- tests/{core => }/test_base.py | 0 tests/{core => ui}/__init__.py | 0 tests/{core/io => ui/console}/__init__.py | 0 tests/{core/io => ui}/console/test_base.py | 10 +- 127 files changed, 614 insertions(+), 628 deletions(-) rename docs/docs/en/api/fastagency/{core => }/Chatable.md (79%) create mode 100644 docs/docs/en/api/fastagency/FunctionCallExecution.md rename docs/docs/en/api/fastagency/{core => }/IOMessage.md (78%) create mode 100644 docs/docs/en/api/fastagency/MultipleChoice.md create mode 100644 docs/docs/en/api/fastagency/SuggestedFunctionCall.md rename docs/docs/en/api/fastagency/{core => }/TextInput.md (78%) create mode 100644 docs/docs/en/api/fastagency/TextMessage.md rename docs/docs/en/api/fastagency/{core => }/Workflows.md (78%) create mode 100644 docs/docs/en/api/fastagency/app/FastAgency.md create mode 100644 docs/docs/en/api/fastagency/base/AskingMessage.md create mode 100644 docs/docs/en/api/fastagency/base/Chatable.md rename docs/docs/en/api/fastagency/{core => base}/FunctionCallExecution.md (72%) create mode 100644 docs/docs/en/api/fastagency/base/IOMessage.md create mode 100644 docs/docs/en/api/fastagency/base/IOMessageVisitor.md rename docs/docs/en/api/fastagency/{core => base}/MultipleChoice.md (75%) rename docs/docs/en/api/fastagency/{core => }/base/Runnable.md (76%) rename docs/docs/en/api/fastagency/{core => base}/SuggestedFunctionCall.md (72%) create mode 100644 docs/docs/en/api/fastagency/base/SystemMessage.md create mode 100644 docs/docs/en/api/fastagency/base/TextInput.md rename docs/docs/en/api/fastagency/{core => base}/TextMessage.md (77%) create mode 100644 docs/docs/en/api/fastagency/base/WorkflowCompleted.md create mode 100644 docs/docs/en/api/fastagency/base/Workflows.md create mode 100644 docs/docs/en/api/fastagency/base/run_workflow.md delete mode 100644 docs/docs/en/api/fastagency/core/app/FastAgency.md delete mode 100644 docs/docs/en/api/fastagency/core/base/AskingMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/base/Chatable.md delete mode 100644 docs/docs/en/api/fastagency/core/base/FunctionCallExecution.md delete mode 100644 docs/docs/en/api/fastagency/core/base/IOMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/base/IOMessageVisitor.md delete mode 100644 docs/docs/en/api/fastagency/core/base/MultipleChoice.md delete mode 100644 docs/docs/en/api/fastagency/core/base/SuggestedFunctionCall.md delete mode 100644 docs/docs/en/api/fastagency/core/base/SystemMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/base/TextInput.md delete mode 100644 docs/docs/en/api/fastagency/core/base/TextMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/base/WorkflowCompleted.md delete mode 100644 docs/docs/en/api/fastagency/core/base/Workflows.md delete mode 100644 docs/docs/en/api/fastagency/core/io/console/ConsoleIO.md delete mode 100644 docs/docs/en/api/fastagency/core/io/console/base/ConsoleIO.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/MesopIO.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/base/MesopIO.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/base/MesopMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/base/run_workflow.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_prompt.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_user_feedback.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/darken_hex_color.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/header.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/data_model/Conversation.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/data_model/State.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/conversation_box.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/conversation_starter_box.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/get_workflows.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/home_page.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/on_user_feedback.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/past_conversations_box.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/main/send_prompt.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/message/MesopGUIMessageVisitor.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/message/message_box.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_prompt_to_autogen.md delete mode 100644 docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_user_feedback_to_autogen.md delete mode 100644 docs/docs/en/api/fastagency/core/runtimes/autogen/base/AutoGenWorkflows.md delete mode 100644 docs/docs/en/api/fastagency/core/runtimes/autogen/base/CurrentMessage.md delete mode 100644 docs/docs/en/api/fastagency/core/runtimes/autogen/base/IOStreamAdapter.md create mode 100644 docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md create mode 100644 docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md rename docs/docs/en/api/fastagency/{core/runtimes/autogen => runtimes/autogen/base}/AutoGenWorkflows.md (67%) create mode 100644 docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md rename docs/docs/en/api/fastagency/{core/runtimes/autogen => runtimes/autogen/base}/IOStreamAdapter.md (67%) create mode 100644 docs/docs/en/api/fastagency/ui/console/ConsoleUI.md create mode 100644 docs/docs/en/api/fastagency/ui/console/base/ConsoleUI.md rename docs/docs/en/api/fastagency/{core/FastAgency.md => ui/mesop/MesopUI.md} (77%) create mode 100644 docs/docs/en/api/fastagency/ui/mesop/base/MesopMessage.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/base/MesopUI.md rename docs/docs/en/api/fastagency/{core => ui/mesop}/base/run_workflow.md (72%) create mode 100644 docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_prompt.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_user_feedback.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/components/ui_common/darken_hex_color.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/components/ui_common/header.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/data_model/Conversation.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/data_model/State.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/conversation_box.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/conversation_starter_box.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/home_page.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/on_user_feedback.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/past_conversations_box.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/main/send_prompt.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/message/message_box.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md create mode 100644 docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md rename fastagency/{core => }/app.py (100%) rename fastagency/{core => }/base.py (100%) delete mode 100644 fastagency/core/__init__.py delete mode 100644 fastagency/core/io/console/__init__.py delete mode 100644 fastagency/core/io/mesop/__init__.py rename fastagency/{core/io => runtimes}/__init__.py (100%) rename fastagency/{core => }/runtimes/autogen/__init__.py (100%) rename fastagency/{core => }/runtimes/autogen/base.py (99%) rename fastagency/{core/io/mesop/components => ui}/__init__.py (100%) create mode 100644 fastagency/ui/console/__init__.py rename fastagency/{core/io => ui}/console/base.py (91%) create mode 100644 fastagency/ui/mesop/__init__.py rename fastagency/{core/io => ui}/mesop/base.py (90%) rename fastagency/{core/runtimes => ui/mesop/components}/__init__.py (100%) rename fastagency/{core/io => ui}/mesop/components/inputs.py (100%) rename fastagency/{core/io => ui}/mesop/components/ui_common.py (100%) rename fastagency/{core/io => ui}/mesop/data_model.py (100%) rename fastagency/{core/io => ui}/mesop/main.py (92%) rename fastagency/{core/io => ui}/mesop/message.py (100%) rename fastagency/{core/io => ui}/mesop/send_prompt.py (85%) rename fastagency/{core/io => ui}/mesop/styles.py (100%) delete mode 100644 tests/core/io/console/__init__.py rename tests/{core => }/test_autogen.py (96%) rename tests/{core => }/test_base.py (100%) rename tests/{core => ui}/__init__.py (100%) rename tests/{core/io => ui/console}/__init__.py (100%) rename tests/{core/io => ui}/console/test_base.py (71%) diff --git a/docs/docs/SUMMARY.md b/docs/docs/SUMMARY.md index ff5f24e9f..223b103c4 100644 --- a/docs/docs/SUMMARY.md +++ b/docs/docs/SUMMARY.md @@ -11,7 +11,15 @@ search: - [Custom User Interactions](tutorial/custom-user-interactions/index.md) - Reference - fastagency + - [Chatable](api/fastagency/Chatable.md) - [FastAgency](api/fastagency/FastAgency.md) + - [FunctionCallExecution](api/fastagency/FunctionCallExecution.md) + - [IOMessage](api/fastagency/IOMessage.md) + - [MultipleChoice](api/fastagency/MultipleChoice.md) + - [SuggestedFunctionCall](api/fastagency/SuggestedFunctionCall.md) + - [TextInput](api/fastagency/TextInput.md) + - [TextMessage](api/fastagency/TextMessage.md) + - [Workflows](api/fastagency/Workflows.md) - api - openapi - [OpenAPI](api/fastagency/api/openapi/OpenAPI.md) @@ -30,6 +38,23 @@ search: - [HTTPBearer](api/fastagency/api/openapi/security/HTTPBearer.md) - security_schema_visitor - [custom_visitor](api/fastagency/api/openapi/security_schema_visitor/custom_visitor.md) + - app + - [FastAgency](api/fastagency/app/FastAgency.md) + - base + - [AskingMessage](api/fastagency/base/AskingMessage.md) + - [Chatable](api/fastagency/base/Chatable.md) + - [FunctionCallExecution](api/fastagency/base/FunctionCallExecution.md) + - [IOMessage](api/fastagency/base/IOMessage.md) + - [IOMessageVisitor](api/fastagency/base/IOMessageVisitor.md) + - [MultipleChoice](api/fastagency/base/MultipleChoice.md) + - [Runnable](api/fastagency/base/Runnable.md) + - [SuggestedFunctionCall](api/fastagency/base/SuggestedFunctionCall.md) + - [SystemMessage](api/fastagency/base/SystemMessage.md) + - [TextInput](api/fastagency/base/TextInput.md) + - [TextMessage](api/fastagency/base/TextMessage.md) + - [WorkflowCompleted](api/fastagency/base/WorkflowCompleted.md) + - [Workflows](api/fastagency/base/Workflows.md) + - [run_workflow](api/fastagency/base/run_workflow.md) - cli - cli - [callback](api/fastagency/cli/cli/callback.md) @@ -49,78 +74,16 @@ search: - [FastAgencyCLIError](api/fastagency/cli/exceptions/FastAgencyCLIError.md) - logging - [setup_logging](api/fastagency/cli/logging/setup_logging.md) - - core - - [Chatable](api/fastagency/core/Chatable.md) - - [FastAgency](api/fastagency/core/FastAgency.md) - - [FunctionCallExecution](api/fastagency/core/FunctionCallExecution.md) - - [IOMessage](api/fastagency/core/IOMessage.md) - - [MultipleChoice](api/fastagency/core/MultipleChoice.md) - - [SuggestedFunctionCall](api/fastagency/core/SuggestedFunctionCall.md) - - [TextInput](api/fastagency/core/TextInput.md) - - [TextMessage](api/fastagency/core/TextMessage.md) - - [Workflows](api/fastagency/core/Workflows.md) - - app - - [FastAgency](api/fastagency/core/app/FastAgency.md) - - base - - [AskingMessage](api/fastagency/core/base/AskingMessage.md) - - [Chatable](api/fastagency/core/base/Chatable.md) - - [FunctionCallExecution](api/fastagency/core/base/FunctionCallExecution.md) - - [IOMessage](api/fastagency/core/base/IOMessage.md) - - [IOMessageVisitor](api/fastagency/core/base/IOMessageVisitor.md) - - [MultipleChoice](api/fastagency/core/base/MultipleChoice.md) - - [Runnable](api/fastagency/core/base/Runnable.md) - - [SuggestedFunctionCall](api/fastagency/core/base/SuggestedFunctionCall.md) - - [SystemMessage](api/fastagency/core/base/SystemMessage.md) - - [TextInput](api/fastagency/core/base/TextInput.md) - - [TextMessage](api/fastagency/core/base/TextMessage.md) - - [WorkflowCompleted](api/fastagency/core/base/WorkflowCompleted.md) - - [Workflows](api/fastagency/core/base/Workflows.md) - - [run_workflow](api/fastagency/core/base/run_workflow.md) - - io - - console - - [ConsoleIO](api/fastagency/core/io/console/ConsoleIO.md) - - base - - [ConsoleIO](api/fastagency/core/io/console/base/ConsoleIO.md) - - mesop - - [MesopIO](api/fastagency/core/io/mesop/MesopIO.md) - - base - - [MesopIO](api/fastagency/core/io/mesop/base/MesopIO.md) - - [MesopMessage](api/fastagency/core/io/mesop/base/MesopMessage.md) - - [run_workflow](api/fastagency/core/io/mesop/base/run_workflow.md) - - components - - inputs - - [input_prompt](api/fastagency/core/io/mesop/components/inputs/input_prompt.md) - - [input_user_feedback](api/fastagency/core/io/mesop/components/inputs/input_user_feedback.md) - - ui_common - - [darken_hex_color](api/fastagency/core/io/mesop/components/ui_common/darken_hex_color.md) - - [header](api/fastagency/core/io/mesop/components/ui_common/header.md) - - data_model - - [Conversation](api/fastagency/core/io/mesop/data_model/Conversation.md) - - [State](api/fastagency/core/io/mesop/data_model/State.md) - - main - - [conversation_box](api/fastagency/core/io/mesop/main/conversation_box.md) - - [conversation_starter_box](api/fastagency/core/io/mesop/main/conversation_starter_box.md) - - [get_workflows](api/fastagency/core/io/mesop/main/get_workflows.md) - - [home_page](api/fastagency/core/io/mesop/main/home_page.md) - - [on_user_feedback](api/fastagency/core/io/mesop/main/on_user_feedback.md) - - [past_conversations_box](api/fastagency/core/io/mesop/main/past_conversations_box.md) - - [send_prompt](api/fastagency/core/io/mesop/main/send_prompt.md) - - message - - [MesopGUIMessageVisitor](api/fastagency/core/io/mesop/message/MesopGUIMessageVisitor.md) - - [message_box](api/fastagency/core/io/mesop/message/message_box.md) - - send_prompt - - [send_prompt_to_autogen](api/fastagency/core/io/mesop/send_prompt/send_prompt_to_autogen.md) - - [send_user_feedback_to_autogen](api/fastagency/core/io/mesop/send_prompt/send_user_feedback_to_autogen.md) - - runtimes - - autogen - - [AutoGenWorkflows](api/fastagency/core/runtimes/autogen/AutoGenWorkflows.md) - - [IOStreamAdapter](api/fastagency/core/runtimes/autogen/IOStreamAdapter.md) - - base - - [AutoGenWorkflows](api/fastagency/core/runtimes/autogen/base/AutoGenWorkflows.md) - - [CurrentMessage](api/fastagency/core/runtimes/autogen/base/CurrentMessage.md) - - [IOStreamAdapter](api/fastagency/core/runtimes/autogen/base/IOStreamAdapter.md) - logging - [get_logger](api/fastagency/logging/get_logger.md) + - runtimes + - autogen + - [AutoGenWorkflows](api/fastagency/runtimes/autogen/AutoGenWorkflows.md) + - [IOStreamAdapter](api/fastagency/runtimes/autogen/IOStreamAdapter.md) + - base + - [AutoGenWorkflows](api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md) + - [CurrentMessage](api/fastagency/runtimes/autogen/base/CurrentMessage.md) + - [IOStreamAdapter](api/fastagency/runtimes/autogen/base/IOStreamAdapter.md) - studio - app - [ChatRequest](api/fastagency/studio/app/ChatRequest.md) @@ -264,6 +227,41 @@ search: - [InvalidGHTokenError](api/fastagency/studio/saas_app_generator/InvalidGHTokenError.md) - [SaasAppGenerator](api/fastagency/studio/saas_app_generator/SaasAppGenerator.md) - [main](api/fastagency/studio/saas_app_generator/main.md) + - ui + - console + - [ConsoleUI](api/fastagency/ui/console/ConsoleUI.md) + - base + - [ConsoleUI](api/fastagency/ui/console/base/ConsoleUI.md) + - mesop + - [MesopUI](api/fastagency/ui/mesop/MesopUI.md) + - base + - [MesopMessage](api/fastagency/ui/mesop/base/MesopMessage.md) + - [MesopUI](api/fastagency/ui/mesop/base/MesopUI.md) + - [run_workflow](api/fastagency/ui/mesop/base/run_workflow.md) + - components + - inputs + - [input_prompt](api/fastagency/ui/mesop/components/inputs/input_prompt.md) + - [input_user_feedback](api/fastagency/ui/mesop/components/inputs/input_user_feedback.md) + - ui_common + - [darken_hex_color](api/fastagency/ui/mesop/components/ui_common/darken_hex_color.md) + - [header](api/fastagency/ui/mesop/components/ui_common/header.md) + - data_model + - [Conversation](api/fastagency/ui/mesop/data_model/Conversation.md) + - [State](api/fastagency/ui/mesop/data_model/State.md) + - main + - [conversation_box](api/fastagency/ui/mesop/main/conversation_box.md) + - [conversation_starter_box](api/fastagency/ui/mesop/main/conversation_starter_box.md) + - [get_workflows](api/fastagency/ui/mesop/main/get_workflows.md) + - [home_page](api/fastagency/ui/mesop/main/home_page.md) + - [on_user_feedback](api/fastagency/ui/mesop/main/on_user_feedback.md) + - [past_conversations_box](api/fastagency/ui/mesop/main/past_conversations_box.md) + - [send_prompt](api/fastagency/ui/mesop/main/send_prompt.md) + - message + - [MesopGUIMessageVisitor](api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md) + - [message_box](api/fastagency/ui/mesop/message/message_box.md) + - send_prompt + - [send_prompt_to_autogen](api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md) + - [send_user_feedback_to_autogen](api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md) - Contributing - [Development](getting-started/contributing/CONTRIBUTING.md) - [Documentation](getting-started/contributing/docs.md) diff --git a/docs/docs/en/api/fastagency/core/Chatable.md b/docs/docs/en/api/fastagency/Chatable.md similarity index 79% rename from docs/docs/en/api/fastagency/core/Chatable.md rename to docs/docs/en/api/fastagency/Chatable.md index a69df6627..e3633ab6d 100644 --- a/docs/docs/en/api/fastagency/core/Chatable.md +++ b/docs/docs/en/api/fastagency/Chatable.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.Chatable +::: fastagency.Chatable diff --git a/docs/docs/en/api/fastagency/FunctionCallExecution.md b/docs/docs/en/api/fastagency/FunctionCallExecution.md new file mode 100644 index 000000000..7528a95ad --- /dev/null +++ b/docs/docs/en/api/fastagency/FunctionCallExecution.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.FunctionCallExecution diff --git a/docs/docs/en/api/fastagency/core/IOMessage.md b/docs/docs/en/api/fastagency/IOMessage.md similarity index 78% rename from docs/docs/en/api/fastagency/core/IOMessage.md rename to docs/docs/en/api/fastagency/IOMessage.md index 5d4f3554b..324ed4a64 100644 --- a/docs/docs/en/api/fastagency/core/IOMessage.md +++ b/docs/docs/en/api/fastagency/IOMessage.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.IOMessage +::: fastagency.IOMessage diff --git a/docs/docs/en/api/fastagency/MultipleChoice.md b/docs/docs/en/api/fastagency/MultipleChoice.md new file mode 100644 index 000000000..b90e7c46d --- /dev/null +++ b/docs/docs/en/api/fastagency/MultipleChoice.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.MultipleChoice diff --git a/docs/docs/en/api/fastagency/SuggestedFunctionCall.md b/docs/docs/en/api/fastagency/SuggestedFunctionCall.md new file mode 100644 index 000000000..ff4198c6b --- /dev/null +++ b/docs/docs/en/api/fastagency/SuggestedFunctionCall.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.SuggestedFunctionCall diff --git a/docs/docs/en/api/fastagency/core/TextInput.md b/docs/docs/en/api/fastagency/TextInput.md similarity index 78% rename from docs/docs/en/api/fastagency/core/TextInput.md rename to docs/docs/en/api/fastagency/TextInput.md index a85c4978b..2fc6c28ef 100644 --- a/docs/docs/en/api/fastagency/core/TextInput.md +++ b/docs/docs/en/api/fastagency/TextInput.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.TextInput +::: fastagency.TextInput diff --git a/docs/docs/en/api/fastagency/TextMessage.md b/docs/docs/en/api/fastagency/TextMessage.md new file mode 100644 index 000000000..099d8d057 --- /dev/null +++ b/docs/docs/en/api/fastagency/TextMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.TextMessage diff --git a/docs/docs/en/api/fastagency/core/Workflows.md b/docs/docs/en/api/fastagency/Workflows.md similarity index 78% rename from docs/docs/en/api/fastagency/core/Workflows.md rename to docs/docs/en/api/fastagency/Workflows.md index c4d4fe7df..7ae0ecc8e 100644 --- a/docs/docs/en/api/fastagency/core/Workflows.md +++ b/docs/docs/en/api/fastagency/Workflows.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.Workflows +::: fastagency.Workflows diff --git a/docs/docs/en/api/fastagency/app/FastAgency.md b/docs/docs/en/api/fastagency/app/FastAgency.md new file mode 100644 index 000000000..0df55cf72 --- /dev/null +++ b/docs/docs/en/api/fastagency/app/FastAgency.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.app.FastAgency diff --git a/docs/docs/en/api/fastagency/base/AskingMessage.md b/docs/docs/en/api/fastagency/base/AskingMessage.md new file mode 100644 index 000000000..e219a8bb9 --- /dev/null +++ b/docs/docs/en/api/fastagency/base/AskingMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.AskingMessage diff --git a/docs/docs/en/api/fastagency/base/Chatable.md b/docs/docs/en/api/fastagency/base/Chatable.md new file mode 100644 index 000000000..8b54965c9 --- /dev/null +++ b/docs/docs/en/api/fastagency/base/Chatable.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.Chatable diff --git a/docs/docs/en/api/fastagency/core/FunctionCallExecution.md b/docs/docs/en/api/fastagency/base/FunctionCallExecution.md similarity index 72% rename from docs/docs/en/api/fastagency/core/FunctionCallExecution.md rename to docs/docs/en/api/fastagency/base/FunctionCallExecution.md index 421cabf9b..032d46b97 100644 --- a/docs/docs/en/api/fastagency/core/FunctionCallExecution.md +++ b/docs/docs/en/api/fastagency/base/FunctionCallExecution.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.FunctionCallExecution +::: fastagency.base.FunctionCallExecution diff --git a/docs/docs/en/api/fastagency/base/IOMessage.md b/docs/docs/en/api/fastagency/base/IOMessage.md new file mode 100644 index 000000000..61e169d27 --- /dev/null +++ b/docs/docs/en/api/fastagency/base/IOMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.IOMessage diff --git a/docs/docs/en/api/fastagency/base/IOMessageVisitor.md b/docs/docs/en/api/fastagency/base/IOMessageVisitor.md new file mode 100644 index 000000000..f7ca8138e --- /dev/null +++ b/docs/docs/en/api/fastagency/base/IOMessageVisitor.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.IOMessageVisitor diff --git a/docs/docs/en/api/fastagency/core/MultipleChoice.md b/docs/docs/en/api/fastagency/base/MultipleChoice.md similarity index 75% rename from docs/docs/en/api/fastagency/core/MultipleChoice.md rename to docs/docs/en/api/fastagency/base/MultipleChoice.md index 4f1e71d76..a9d35b0db 100644 --- a/docs/docs/en/api/fastagency/core/MultipleChoice.md +++ b/docs/docs/en/api/fastagency/base/MultipleChoice.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.MultipleChoice +::: fastagency.base.MultipleChoice diff --git a/docs/docs/en/api/fastagency/core/base/Runnable.md b/docs/docs/en/api/fastagency/base/Runnable.md similarity index 76% rename from docs/docs/en/api/fastagency/core/base/Runnable.md rename to docs/docs/en/api/fastagency/base/Runnable.md index d1cfd1011..de05005a6 100644 --- a/docs/docs/en/api/fastagency/core/base/Runnable.md +++ b/docs/docs/en/api/fastagency/base/Runnable.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.base.Runnable +::: fastagency.base.Runnable diff --git a/docs/docs/en/api/fastagency/core/SuggestedFunctionCall.md b/docs/docs/en/api/fastagency/base/SuggestedFunctionCall.md similarity index 72% rename from docs/docs/en/api/fastagency/core/SuggestedFunctionCall.md rename to docs/docs/en/api/fastagency/base/SuggestedFunctionCall.md index 840102117..24e2895a2 100644 --- a/docs/docs/en/api/fastagency/core/SuggestedFunctionCall.md +++ b/docs/docs/en/api/fastagency/base/SuggestedFunctionCall.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.SuggestedFunctionCall +::: fastagency.base.SuggestedFunctionCall diff --git a/docs/docs/en/api/fastagency/base/SystemMessage.md b/docs/docs/en/api/fastagency/base/SystemMessage.md new file mode 100644 index 000000000..7546ee08d --- /dev/null +++ b/docs/docs/en/api/fastagency/base/SystemMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.SystemMessage diff --git a/docs/docs/en/api/fastagency/base/TextInput.md b/docs/docs/en/api/fastagency/base/TextInput.md new file mode 100644 index 000000000..705263280 --- /dev/null +++ b/docs/docs/en/api/fastagency/base/TextInput.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.TextInput diff --git a/docs/docs/en/api/fastagency/core/TextMessage.md b/docs/docs/en/api/fastagency/base/TextMessage.md similarity index 77% rename from docs/docs/en/api/fastagency/core/TextMessage.md rename to docs/docs/en/api/fastagency/base/TextMessage.md index d5bf62dad..7fee196a9 100644 --- a/docs/docs/en/api/fastagency/core/TextMessage.md +++ b/docs/docs/en/api/fastagency/base/TextMessage.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.TextMessage +::: fastagency.base.TextMessage diff --git a/docs/docs/en/api/fastagency/base/WorkflowCompleted.md b/docs/docs/en/api/fastagency/base/WorkflowCompleted.md new file mode 100644 index 000000000..6c60e0801 --- /dev/null +++ b/docs/docs/en/api/fastagency/base/WorkflowCompleted.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.WorkflowCompleted diff --git a/docs/docs/en/api/fastagency/base/Workflows.md b/docs/docs/en/api/fastagency/base/Workflows.md new file mode 100644 index 000000000..5ba7c0f1f --- /dev/null +++ b/docs/docs/en/api/fastagency/base/Workflows.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.Workflows diff --git a/docs/docs/en/api/fastagency/base/run_workflow.md b/docs/docs/en/api/fastagency/base/run_workflow.md new file mode 100644 index 000000000..6963fccdd --- /dev/null +++ b/docs/docs/en/api/fastagency/base/run_workflow.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.base.run_workflow diff --git a/docs/docs/en/api/fastagency/core/app/FastAgency.md b/docs/docs/en/api/fastagency/core/app/FastAgency.md deleted file mode 100644 index b2b0daec9..000000000 --- a/docs/docs/en/api/fastagency/core/app/FastAgency.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.app.FastAgency diff --git a/docs/docs/en/api/fastagency/core/base/AskingMessage.md b/docs/docs/en/api/fastagency/core/base/AskingMessage.md deleted file mode 100644 index 9aeafb9d4..000000000 --- a/docs/docs/en/api/fastagency/core/base/AskingMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.AskingMessage diff --git a/docs/docs/en/api/fastagency/core/base/Chatable.md b/docs/docs/en/api/fastagency/core/base/Chatable.md deleted file mode 100644 index 3e1e0a8d4..000000000 --- a/docs/docs/en/api/fastagency/core/base/Chatable.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.Chatable diff --git a/docs/docs/en/api/fastagency/core/base/FunctionCallExecution.md b/docs/docs/en/api/fastagency/core/base/FunctionCallExecution.md deleted file mode 100644 index 854a7f4bf..000000000 --- a/docs/docs/en/api/fastagency/core/base/FunctionCallExecution.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.FunctionCallExecution diff --git a/docs/docs/en/api/fastagency/core/base/IOMessage.md b/docs/docs/en/api/fastagency/core/base/IOMessage.md deleted file mode 100644 index c8657e1c4..000000000 --- a/docs/docs/en/api/fastagency/core/base/IOMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.IOMessage diff --git a/docs/docs/en/api/fastagency/core/base/IOMessageVisitor.md b/docs/docs/en/api/fastagency/core/base/IOMessageVisitor.md deleted file mode 100644 index 69cc37389..000000000 --- a/docs/docs/en/api/fastagency/core/base/IOMessageVisitor.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.IOMessageVisitor diff --git a/docs/docs/en/api/fastagency/core/base/MultipleChoice.md b/docs/docs/en/api/fastagency/core/base/MultipleChoice.md deleted file mode 100644 index 843a26636..000000000 --- a/docs/docs/en/api/fastagency/core/base/MultipleChoice.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.MultipleChoice diff --git a/docs/docs/en/api/fastagency/core/base/SuggestedFunctionCall.md b/docs/docs/en/api/fastagency/core/base/SuggestedFunctionCall.md deleted file mode 100644 index d50595cc6..000000000 --- a/docs/docs/en/api/fastagency/core/base/SuggestedFunctionCall.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.SuggestedFunctionCall diff --git a/docs/docs/en/api/fastagency/core/base/SystemMessage.md b/docs/docs/en/api/fastagency/core/base/SystemMessage.md deleted file mode 100644 index 809996258..000000000 --- a/docs/docs/en/api/fastagency/core/base/SystemMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.SystemMessage diff --git a/docs/docs/en/api/fastagency/core/base/TextInput.md b/docs/docs/en/api/fastagency/core/base/TextInput.md deleted file mode 100644 index 080714f66..000000000 --- a/docs/docs/en/api/fastagency/core/base/TextInput.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.TextInput diff --git a/docs/docs/en/api/fastagency/core/base/TextMessage.md b/docs/docs/en/api/fastagency/core/base/TextMessage.md deleted file mode 100644 index 957c74966..000000000 --- a/docs/docs/en/api/fastagency/core/base/TextMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.TextMessage diff --git a/docs/docs/en/api/fastagency/core/base/WorkflowCompleted.md b/docs/docs/en/api/fastagency/core/base/WorkflowCompleted.md deleted file mode 100644 index 5f9ade7d6..000000000 --- a/docs/docs/en/api/fastagency/core/base/WorkflowCompleted.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.WorkflowCompleted diff --git a/docs/docs/en/api/fastagency/core/base/Workflows.md b/docs/docs/en/api/fastagency/core/base/Workflows.md deleted file mode 100644 index 882c87f91..000000000 --- a/docs/docs/en/api/fastagency/core/base/Workflows.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.base.Workflows diff --git a/docs/docs/en/api/fastagency/core/io/console/ConsoleIO.md b/docs/docs/en/api/fastagency/core/io/console/ConsoleIO.md deleted file mode 100644 index 2fbd12f3e..000000000 --- a/docs/docs/en/api/fastagency/core/io/console/ConsoleIO.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.console.ConsoleIO diff --git a/docs/docs/en/api/fastagency/core/io/console/base/ConsoleIO.md b/docs/docs/en/api/fastagency/core/io/console/base/ConsoleIO.md deleted file mode 100644 index f4142d32a..000000000 --- a/docs/docs/en/api/fastagency/core/io/console/base/ConsoleIO.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.console.base.ConsoleIO diff --git a/docs/docs/en/api/fastagency/core/io/mesop/MesopIO.md b/docs/docs/en/api/fastagency/core/io/mesop/MesopIO.md deleted file mode 100644 index c3ba7c115..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/MesopIO.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.MesopIO diff --git a/docs/docs/en/api/fastagency/core/io/mesop/base/MesopIO.md b/docs/docs/en/api/fastagency/core/io/mesop/base/MesopIO.md deleted file mode 100644 index ea8a73de5..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/base/MesopIO.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.base.MesopIO diff --git a/docs/docs/en/api/fastagency/core/io/mesop/base/MesopMessage.md b/docs/docs/en/api/fastagency/core/io/mesop/base/MesopMessage.md deleted file mode 100644 index 8bd5edda7..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/base/MesopMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.base.MesopMessage diff --git a/docs/docs/en/api/fastagency/core/io/mesop/base/run_workflow.md b/docs/docs/en/api/fastagency/core/io/mesop/base/run_workflow.md deleted file mode 100644 index b55529b54..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/base/run_workflow.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.base.run_workflow diff --git a/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_prompt.md b/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_prompt.md deleted file mode 100644 index f74b56388..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_prompt.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.components.inputs.input_prompt diff --git a/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_user_feedback.md b/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_user_feedback.md deleted file mode 100644 index dfe2d1a56..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/components/inputs/input_user_feedback.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.components.inputs.input_user_feedback diff --git a/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/darken_hex_color.md b/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/darken_hex_color.md deleted file mode 100644 index 540bd69c7..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/darken_hex_color.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.components.ui_common.darken_hex_color diff --git a/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/header.md b/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/header.md deleted file mode 100644 index 0e57dfc21..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/components/ui_common/header.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.components.ui_common.header diff --git a/docs/docs/en/api/fastagency/core/io/mesop/data_model/Conversation.md b/docs/docs/en/api/fastagency/core/io/mesop/data_model/Conversation.md deleted file mode 100644 index 3b0cb7643..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/data_model/Conversation.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.data_model.Conversation diff --git a/docs/docs/en/api/fastagency/core/io/mesop/data_model/State.md b/docs/docs/en/api/fastagency/core/io/mesop/data_model/State.md deleted file mode 100644 index 946f79911..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/data_model/State.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.data_model.State diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_box.md b/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_box.md deleted file mode 100644 index 05c2b0279..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_box.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.conversation_box diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_starter_box.md b/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_starter_box.md deleted file mode 100644 index a7983d4e9..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/conversation_starter_box.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.conversation_starter_box diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/get_workflows.md b/docs/docs/en/api/fastagency/core/io/mesop/main/get_workflows.md deleted file mode 100644 index 07de97bfa..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/get_workflows.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.get_workflows diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/home_page.md b/docs/docs/en/api/fastagency/core/io/mesop/main/home_page.md deleted file mode 100644 index f72d68d42..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/home_page.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.home_page diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/on_user_feedback.md b/docs/docs/en/api/fastagency/core/io/mesop/main/on_user_feedback.md deleted file mode 100644 index 4aac7bcae..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/on_user_feedback.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.on_user_feedback diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/past_conversations_box.md b/docs/docs/en/api/fastagency/core/io/mesop/main/past_conversations_box.md deleted file mode 100644 index 836d4511c..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/past_conversations_box.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.past_conversations_box diff --git a/docs/docs/en/api/fastagency/core/io/mesop/main/send_prompt.md b/docs/docs/en/api/fastagency/core/io/mesop/main/send_prompt.md deleted file mode 100644 index 47b9fe336..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/main/send_prompt.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.main.send_prompt diff --git a/docs/docs/en/api/fastagency/core/io/mesop/message/MesopGUIMessageVisitor.md b/docs/docs/en/api/fastagency/core/io/mesop/message/MesopGUIMessageVisitor.md deleted file mode 100644 index 30fba0354..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/message/MesopGUIMessageVisitor.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.message.MesopGUIMessageVisitor diff --git a/docs/docs/en/api/fastagency/core/io/mesop/message/message_box.md b/docs/docs/en/api/fastagency/core/io/mesop/message/message_box.md deleted file mode 100644 index f20518bb9..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/message/message_box.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.message.message_box diff --git a/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_prompt_to_autogen.md b/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_prompt_to_autogen.md deleted file mode 100644 index 8044ecda5..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_prompt_to_autogen.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.send_prompt.send_prompt_to_autogen diff --git a/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_user_feedback_to_autogen.md b/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_user_feedback_to_autogen.md deleted file mode 100644 index ccf17316b..000000000 --- a/docs/docs/en/api/fastagency/core/io/mesop/send_prompt/send_user_feedback_to_autogen.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.io.mesop.send_prompt.send_user_feedback_to_autogen diff --git a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/core/runtimes/autogen/base/AutoGenWorkflows.md deleted file mode 100644 index 7a62ef0ca..000000000 --- a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/AutoGenWorkflows.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.runtimes.autogen.base.AutoGenWorkflows diff --git a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/CurrentMessage.md b/docs/docs/en/api/fastagency/core/runtimes/autogen/base/CurrentMessage.md deleted file mode 100644 index 697f224bd..000000000 --- a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/CurrentMessage.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.runtimes.autogen.base.CurrentMessage diff --git a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/IOStreamAdapter.md b/docs/docs/en/api/fastagency/core/runtimes/autogen/base/IOStreamAdapter.md deleted file mode 100644 index 4019aca13..000000000 --- a/docs/docs/en/api/fastagency/core/runtimes/autogen/base/IOStreamAdapter.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.core.runtimes.autogen.base.IOStreamAdapter diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md new file mode 100644 index 000000000..01c0b718a --- /dev/null +++ b/docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.runtimes.autogen.AutoGenWorkflows diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md b/docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md new file mode 100644 index 000000000..a8ee8e0e1 --- /dev/null +++ b/docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.runtimes.autogen.IOStreamAdapter diff --git a/docs/docs/en/api/fastagency/core/runtimes/autogen/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md similarity index 67% rename from docs/docs/en/api/fastagency/core/runtimes/autogen/AutoGenWorkflows.md rename to docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md index d1e7fea56..481336b15 100644 --- a/docs/docs/en/api/fastagency/core/runtimes/autogen/AutoGenWorkflows.md +++ b/docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.runtimes.autogen.AutoGenWorkflows +::: fastagency.runtimes.autogen.base.AutoGenWorkflows diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md b/docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md new file mode 100644 index 000000000..5864227f8 --- /dev/null +++ b/docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.runtimes.autogen.base.CurrentMessage diff --git a/docs/docs/en/api/fastagency/core/runtimes/autogen/IOStreamAdapter.md b/docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md similarity index 67% rename from docs/docs/en/api/fastagency/core/runtimes/autogen/IOStreamAdapter.md rename to docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md index b7d5e3d50..c7876374a 100644 --- a/docs/docs/en/api/fastagency/core/runtimes/autogen/IOStreamAdapter.md +++ b/docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.runtimes.autogen.IOStreamAdapter +::: fastagency.runtimes.autogen.base.IOStreamAdapter diff --git a/docs/docs/en/api/fastagency/ui/console/ConsoleUI.md b/docs/docs/en/api/fastagency/ui/console/ConsoleUI.md new file mode 100644 index 000000000..9b343ce52 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/console/ConsoleUI.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.console.ConsoleUI diff --git a/docs/docs/en/api/fastagency/ui/console/base/ConsoleUI.md b/docs/docs/en/api/fastagency/ui/console/base/ConsoleUI.md new file mode 100644 index 000000000..a4cb0e764 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/console/base/ConsoleUI.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.console.base.ConsoleUI diff --git a/docs/docs/en/api/fastagency/core/FastAgency.md b/docs/docs/en/api/fastagency/ui/mesop/MesopUI.md similarity index 77% rename from docs/docs/en/api/fastagency/core/FastAgency.md rename to docs/docs/en/api/fastagency/ui/mesop/MesopUI.md index bd595b7a8..cbdccc3e5 100644 --- a/docs/docs/en/api/fastagency/core/FastAgency.md +++ b/docs/docs/en/api/fastagency/ui/mesop/MesopUI.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.FastAgency +::: fastagency.ui.mesop.MesopUI diff --git a/docs/docs/en/api/fastagency/ui/mesop/base/MesopMessage.md b/docs/docs/en/api/fastagency/ui/mesop/base/MesopMessage.md new file mode 100644 index 000000000..ae545610f --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/base/MesopMessage.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.base.MesopMessage diff --git a/docs/docs/en/api/fastagency/ui/mesop/base/MesopUI.md b/docs/docs/en/api/fastagency/ui/mesop/base/MesopUI.md new file mode 100644 index 000000000..7ec2a96ff --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/base/MesopUI.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.base.MesopUI diff --git a/docs/docs/en/api/fastagency/core/base/run_workflow.md b/docs/docs/en/api/fastagency/ui/mesop/base/run_workflow.md similarity index 72% rename from docs/docs/en/api/fastagency/core/base/run_workflow.md rename to docs/docs/en/api/fastagency/ui/mesop/base/run_workflow.md index 67c7b30d0..b9404a57f 100644 --- a/docs/docs/en/api/fastagency/core/base/run_workflow.md +++ b/docs/docs/en/api/fastagency/ui/mesop/base/run_workflow.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.core.base.run_workflow +::: fastagency.ui.mesop.base.run_workflow diff --git a/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_prompt.md b/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_prompt.md new file mode 100644 index 000000000..906fb4a8c --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_prompt.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.components.inputs.input_prompt diff --git a/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_user_feedback.md b/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_user_feedback.md new file mode 100644 index 000000000..07111bdb8 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/components/inputs/input_user_feedback.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.components.inputs.input_user_feedback diff --git a/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/darken_hex_color.md b/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/darken_hex_color.md new file mode 100644 index 000000000..997cfb1c6 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/darken_hex_color.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.components.ui_common.darken_hex_color diff --git a/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/header.md b/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/header.md new file mode 100644 index 000000000..d22398cea --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/components/ui_common/header.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.components.ui_common.header diff --git a/docs/docs/en/api/fastagency/ui/mesop/data_model/Conversation.md b/docs/docs/en/api/fastagency/ui/mesop/data_model/Conversation.md new file mode 100644 index 000000000..7da9c1a31 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/data_model/Conversation.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.data_model.Conversation diff --git a/docs/docs/en/api/fastagency/ui/mesop/data_model/State.md b/docs/docs/en/api/fastagency/ui/mesop/data_model/State.md new file mode 100644 index 000000000..6c20bdb4d --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/data_model/State.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.data_model.State diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/conversation_box.md b/docs/docs/en/api/fastagency/ui/mesop/main/conversation_box.md new file mode 100644 index 000000000..6e4ed58bc --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/conversation_box.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.conversation_box diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/conversation_starter_box.md b/docs/docs/en/api/fastagency/ui/mesop/main/conversation_starter_box.md new file mode 100644 index 000000000..a7a9c9370 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/conversation_starter_box.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.conversation_starter_box diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md b/docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md new file mode 100644 index 000000000..0b353a4e5 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.get_workflows diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/home_page.md b/docs/docs/en/api/fastagency/ui/mesop/main/home_page.md new file mode 100644 index 000000000..9b6618e63 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/home_page.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.home_page diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/on_user_feedback.md b/docs/docs/en/api/fastagency/ui/mesop/main/on_user_feedback.md new file mode 100644 index 000000000..5ead74b05 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/on_user_feedback.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.on_user_feedback diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/past_conversations_box.md b/docs/docs/en/api/fastagency/ui/mesop/main/past_conversations_box.md new file mode 100644 index 000000000..d963c0cf7 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/past_conversations_box.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.past_conversations_box diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/send_prompt.md b/docs/docs/en/api/fastagency/ui/mesop/main/send_prompt.md new file mode 100644 index 000000000..6cf3996f3 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/main/send_prompt.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.main.send_prompt diff --git a/docs/docs/en/api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md b/docs/docs/en/api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md new file mode 100644 index 000000000..2191ac00a --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/message/MesopGUIMessageVisitor.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.message.MesopGUIMessageVisitor diff --git a/docs/docs/en/api/fastagency/ui/mesop/message/message_box.md b/docs/docs/en/api/fastagency/ui/mesop/message/message_box.md new file mode 100644 index 000000000..5abd9e490 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/message/message_box.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.message.message_box diff --git a/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md b/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md new file mode 100644 index 000000000..831ac0add --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.send_prompt.send_prompt_to_autogen diff --git a/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md b/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md new file mode 100644 index 000000000..09b934956 --- /dev/null +++ b/docs/docs/en/api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.ui.mesop.send_prompt.send_user_feedback_to_autogen diff --git a/docs/docs_src/tutorial/custom_user_interactions/main.py b/docs/docs_src/tutorial/custom_user_interactions/main.py index af364168e..0cbb0a755 100644 --- a/docs/docs_src/tutorial/custom_user_interactions/main.py +++ b/docs/docs_src/tutorial/custom_user_interactions/main.py @@ -5,10 +5,10 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency.core import Chatable -from fastagency.core.base import MultipleChoice, SystemMessage, TextInput -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.base import MultipleChoice, SystemMessage, TextInput +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows llm_config = { "config_list": [ @@ -132,4 +132,4 @@ def get_final_grade( return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/docs/docs_src/tutorial/external_rest_apis/main.py b/docs/docs_src/tutorial/external_rest_apis/main.py index aebd1c8f5..6afcb1e0b 100644 --- a/docs/docs_src/tutorial/external_rest_apis/main.py +++ b/docs/docs_src/tutorial/external_rest_apis/main.py @@ -4,9 +4,9 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency.core import Chatable -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency.api.openapi import OpenAPI @@ -57,4 +57,4 @@ def weather_workflow(io: Chatable, initial_message: str, session_id: str) -> str return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/docs/docs_src/tutorial/external_rest_apis/security.py b/docs/docs_src/tutorial/external_rest_apis/security.py index b1e4f4787..bfc7aeb51 100644 --- a/docs/docs_src/tutorial/external_rest_apis/security.py +++ b/docs/docs_src/tutorial/external_rest_apis/security.py @@ -4,9 +4,9 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency.core import Chatable -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI from fastagency.api.openapi.security import APIKeyHeader @@ -65,4 +65,4 @@ def weather_workflow_with_security(io: Chatable, initial_message: str, session_i return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/docs/docs_src/tutorial/getting_started/main.py b/docs/docs_src/tutorial/getting_started/main.py index 793dfcc3e..635260eb3 100644 --- a/docs/docs_src/tutorial/getting_started/main.py +++ b/docs/docs_src/tutorial/getting_started/main.py @@ -3,9 +3,9 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency.core import Chatable -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows llm_config = { "config_list": [ @@ -44,4 +44,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/examples/cli/main_console.py b/examples/cli/main_console.py index 3ad39695d..9850cec58 100644 --- a/examples/cli/main_console.py +++ b/examples/cli/main_console.py @@ -2,9 +2,9 @@ from autogen.agentchat import ConversableAgent -from fastagency.core import Chatable -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency import FastAgency @@ -43,4 +43,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/examples/cli/main_mesop.py b/examples/cli/main_mesop.py index 36c8bb1a5..898c75765 100644 --- a/examples/cli/main_mesop.py +++ b/examples/cli/main_mesop.py @@ -2,9 +2,9 @@ from autogen.agentchat import ConversableAgent -from fastagency.core import Chatable -from fastagency.core.io.mesop import MesopIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.mesop import MesopUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency import FastAgency @@ -43,4 +43,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=MesopIO()) +app = FastAgency(wf=wf, io=MesopUI()) diff --git a/examples/cli/main_user_proxy.py b/examples/cli/main_user_proxy.py index a6857401e..52cf3afbd 100644 --- a/examples/cli/main_user_proxy.py +++ b/examples/cli/main_user_proxy.py @@ -2,9 +2,9 @@ from autogen.agentchat import ConversableAgent, UserProxyAgent -from fastagency.core import Chatable -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency import Chatable +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI from fastagency.api.openapi.security import APIKeyHeader @@ -52,4 +52,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) diff --git a/fastagency/__init__.py b/fastagency/__init__.py index dc1a7f6d0..5316e20f2 100644 --- a/fastagency/__init__.py +++ b/fastagency/__init__.py @@ -1,6 +1,31 @@ """The fastest way to bring multi-agent workflows to production.""" from .__about__ import __version__ -from .core import FastAgency +from .app import FastAgency +from .base import ( + Chatable, + FunctionCallExecution, + IOMessage, + MessageType, + MultipleChoice, + SuggestedFunctionCall, + TextInput, + TextMessage, + Workflow, + Workflows, +) -__all__ = ["FastAgency", "__version__"] +__all__ = [ + "Chatable", + "FastAgency", + "FunctionCallExecution", + "IOMessage", + "MessageType", + "MultipleChoice", + "SuggestedFunctionCall", + "TextInput", + "TextMessage", + "Workflows", + "Workflow", + "__version__", +] diff --git a/fastagency/core/app.py b/fastagency/app.py similarity index 100% rename from fastagency/core/app.py rename to fastagency/app.py diff --git a/fastagency/core/base.py b/fastagency/base.py similarity index 100% rename from fastagency/core/base.py rename to fastagency/base.py diff --git a/fastagency/core/__init__.py b/fastagency/core/__init__.py deleted file mode 100644 index 5871f9191..000000000 --- a/fastagency/core/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -from .app import FastAgency -from .base import ( - Chatable, - FunctionCallExecution, - IOMessage, - MessageType, - MultipleChoice, - SuggestedFunctionCall, - TextInput, - TextMessage, - Workflow, - Workflows, -) - -__all__ = [ - "Chatable", - "FastAgency", - "FunctionCallExecution", - "IOMessage", - "MessageType", - "MultipleChoice", - "SuggestedFunctionCall", - "TextInput", - "TextMessage", - "Workflows", - "Workflow", -] diff --git a/fastagency/core/io/console/__init__.py b/fastagency/core/io/console/__init__.py deleted file mode 100644 index 2129a1dd1..000000000 --- a/fastagency/core/io/console/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .base import ConsoleIO - -__all__ = ["ConsoleIO"] diff --git a/fastagency/core/io/mesop/__init__.py b/fastagency/core/io/mesop/__init__.py deleted file mode 100644 index 9ba4e243f..000000000 --- a/fastagency/core/io/mesop/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .base import MesopIO - -__all__ = ["MesopIO"] diff --git a/fastagency/core/io/__init__.py b/fastagency/runtimes/__init__.py similarity index 100% rename from fastagency/core/io/__init__.py rename to fastagency/runtimes/__init__.py diff --git a/fastagency/core/runtimes/autogen/__init__.py b/fastagency/runtimes/autogen/__init__.py similarity index 100% rename from fastagency/core/runtimes/autogen/__init__.py rename to fastagency/runtimes/autogen/__init__.py diff --git a/fastagency/core/runtimes/autogen/base.py b/fastagency/runtimes/autogen/base.py similarity index 99% rename from fastagency/core/runtimes/autogen/base.py rename to fastagency/runtimes/autogen/base.py index 01cf89f70..737c16a72 100644 --- a/fastagency/core/runtimes/autogen/base.py +++ b/fastagency/runtimes/autogen/base.py @@ -5,7 +5,6 @@ from autogen.io import IOStream -from ....logging import get_logger from ...base import ( AskingMessage, Chatable, @@ -16,6 +15,7 @@ Workflow, Workflows, ) +from ...logging import get_logger __all__ = [ "AutoGenWorkflows", diff --git a/fastagency/core/io/mesop/components/__init__.py b/fastagency/ui/__init__.py similarity index 100% rename from fastagency/core/io/mesop/components/__init__.py rename to fastagency/ui/__init__.py diff --git a/fastagency/ui/console/__init__.py b/fastagency/ui/console/__init__.py new file mode 100644 index 000000000..eea5d1925 --- /dev/null +++ b/fastagency/ui/console/__init__.py @@ -0,0 +1,3 @@ +from .base import ConsoleUI + +__all__ = ["ConsoleUI"] diff --git a/fastagency/core/io/console/base.py b/fastagency/ui/console/base.py similarity index 91% rename from fastagency/core/io/console/base.py rename to fastagency/ui/console/base.py index d729de5d9..e9d7b78e5 100644 --- a/fastagency/core/io/console/base.py +++ b/fastagency/ui/console/base.py @@ -4,7 +4,6 @@ from dataclasses import dataclass from typing import Optional -from ....logging import get_logger from ...base import ( IOMessage, IOMessageVisitor, @@ -14,11 +13,12 @@ TextMessage, run_workflow, ) +from ...logging import get_logger logger = get_logger(__name__) -class ConsoleIO(IOMessageVisitor): # Chatable +class ConsoleUI(IOMessageVisitor): # implements Chatable @dataclass class ConsoleMessage: """A console message.""" @@ -28,21 +28,21 @@ class ConsoleMessage: heading: Optional[str] body: Optional[str] - def __init__(self, super_conversation: Optional["ConsoleIO"] = None) -> None: + def __init__(self, super_conversation: Optional["ConsoleUI"] = None) -> None: """Initialize the console IO object. Args: super_conversation (Optional[Chatable], optional): The super conversation. Defaults to None. """ - self.super_conversation: Optional[ConsoleIO] = super_conversation - self.sub_conversations: list[ConsoleIO] = [] + self.super_conversation: Optional[ConsoleUI] = super_conversation + self.sub_conversations: list[ConsoleUI] = [] - def create(self, app: "Runnable", import_string: str) -> None: + def create(self, app: Runnable, import_string: str) -> None: pass def start( self, - app: "Runnable", + app: Runnable, import_string: str, name: Optional[str] = None, initial_message: Optional[str] = None, @@ -155,8 +155,8 @@ def process_message(self, message: IOMessage) -> Optional[str]: # def process_streaming_message(self, message: IOStreamingMessage) -> str | None: # raise NotImplementedError - def create_subconversation(self) -> "ConsoleIO": - sub_conversation = ConsoleIO(self) + def create_subconversation(self) -> "ConsoleUI": + sub_conversation = ConsoleUI(self) self.sub_conversations.append(sub_conversation) return sub_conversation diff --git a/fastagency/ui/mesop/__init__.py b/fastagency/ui/mesop/__init__.py new file mode 100644 index 000000000..f05aa1303 --- /dev/null +++ b/fastagency/ui/mesop/__init__.py @@ -0,0 +1,3 @@ +from .base import MesopUI + +__all__ = ["MesopUI"] diff --git a/fastagency/core/io/mesop/base.py b/fastagency/ui/mesop/base.py similarity index 90% rename from fastagency/core/io/mesop/base.py rename to fastagency/ui/mesop/base.py index a7ddfc786..926c23860 100644 --- a/fastagency/core/io/mesop/base.py +++ b/fastagency/ui/mesop/base.py @@ -27,27 +27,27 @@ class MesopMessage: """A Mesop message.""" io_message: IOMessage - conversation: "MesopIO" + conversation: "MesopUI" -class MesopIO(IOMessageVisitor): # Chatable - def __init__(self, super_conversation: Optional["MesopIO"] = None) -> None: +class MesopUI(IOMessageVisitor): # Chatable + def __init__(self, super_conversation: Optional["MesopUI"] = None) -> None: """Initialize the console IO object. Args: super_conversation (Optional[Chatable], optional): The super conversation. Defaults to None. """ self.id: str = uuid4().hex - self.super_conversation: Optional[MesopIO] = super_conversation - self.sub_conversations: list[MesopIO] = [] + self.super_conversation: Optional[MesopUI] = super_conversation + self.sub_conversations: list[MesopUI] = [] self._in_queue: Optional[Queue[str]] = None self._out_queue: Optional[Queue[MesopMessage]] = None if super_conversation is None: self._in_queue = Queue() self._out_queue = Queue() - MesopIO.register(self) + MesopUI.register(self) - _registry: ClassVar[dict[str, "MesopIO"]] = {} + _registry: ClassVar[dict[str, "MesopUI"]] = {} @property def main_path(self) -> str: @@ -78,15 +78,15 @@ def start( raise RuntimeError("Mesop process failed") @classmethod - def register(cls, conversation: "MesopIO") -> None: + def register(cls, conversation: "MesopUI") -> None: cls._registry[conversation.id] = conversation @classmethod - def get_conversation(cls, id: str) -> "MesopIO": + def get_conversation(cls, id: str) -> "MesopUI": return cls._registry[id] @classmethod - def unregister(cls, conversation: "MesopIO") -> None: + def unregister(cls, conversation: "MesopUI") -> None: del cls._registry[conversation.id] @property @@ -94,7 +94,7 @@ def is_root_conversation(self) -> bool: return self.super_conversation is not None @property - def root_conversation(self) -> "MesopIO": + def root_conversation(self) -> "MesopUI": if self.super_conversation is None: return self else: @@ -146,8 +146,8 @@ def visit_multiple_choice(self, message: MultipleChoice) -> str: def process_message(self, message: IOMessage) -> Optional[str]: return self.visit(message) - def create_subconversation(self) -> "MesopIO": - sub_conversation = MesopIO(self) + def create_subconversation(self) -> "MesopUI": + sub_conversation = MesopUI(self) self.sub_conversations.append(sub_conversation) return sub_conversation @@ -175,8 +175,8 @@ def get_message_stream(self) -> Generator[MesopMessage, None, None]: yield message -def run_workflow(wf: Workflows, name: str, initial_message: str) -> MesopIO: - def conversation_worker(io: MesopIO, subconversation: MesopIO) -> None: +def run_workflow(wf: Workflows, name: str, initial_message: str) -> MesopUI: + def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: io.process_message( IOMessage.create( sender="user", @@ -238,7 +238,7 @@ def conversation_worker(io: MesopIO, subconversation: MesopIO) -> None: ) ) - io = MesopIO() + io = MesopUI() subconversation = io.create_subconversation() thread = threading.Thread(target=conversation_worker, args=(io, subconversation)) thread.start() diff --git a/fastagency/core/runtimes/__init__.py b/fastagency/ui/mesop/components/__init__.py similarity index 100% rename from fastagency/core/runtimes/__init__.py rename to fastagency/ui/mesop/components/__init__.py diff --git a/fastagency/core/io/mesop/components/inputs.py b/fastagency/ui/mesop/components/inputs.py similarity index 100% rename from fastagency/core/io/mesop/components/inputs.py rename to fastagency/ui/mesop/components/inputs.py diff --git a/fastagency/core/io/mesop/components/ui_common.py b/fastagency/ui/mesop/components/ui_common.py similarity index 100% rename from fastagency/core/io/mesop/components/ui_common.py rename to fastagency/ui/mesop/components/ui_common.py diff --git a/fastagency/core/io/mesop/data_model.py b/fastagency/ui/mesop/data_model.py similarity index 100% rename from fastagency/core/io/mesop/data_model.py rename to fastagency/ui/mesop/data_model.py diff --git a/fastagency/core/io/mesop/main.py b/fastagency/ui/mesop/main.py similarity index 92% rename from fastagency/core/io/mesop/main.py rename to fastagency/ui/mesop/main.py index 1a65132eb..e6862ed6c 100644 --- a/fastagency/core/io/mesop/main.py +++ b/fastagency/ui/mesop/main.py @@ -5,25 +5,25 @@ import mesop as me +from fastagency.base import AskingMessage, WorkflowCompleted, Workflows from fastagency.cli.discover import import_from_string -from fastagency.core.base import AskingMessage, WorkflowCompleted, Workflows -from fastagency.core.io.mesop.base import MesopMessage -from fastagency.core.io.mesop.components.inputs import input_prompt, input_user_feedback -from fastagency.core.io.mesop.components.ui_common import header -from fastagency.core.io.mesop.data_model import Conversation, State -from fastagency.core.io.mesop.message import message_box -from fastagency.core.io.mesop.send_prompt import ( +from fastagency.logging import get_logger +from fastagency.ui.mesop.base import MesopMessage +from fastagency.ui.mesop.components.inputs import input_prompt, input_user_feedback +from fastagency.ui.mesop.components.ui_common import header +from fastagency.ui.mesop.data_model import Conversation, State +from fastagency.ui.mesop.message import message_box +from fastagency.ui.mesop.send_prompt import ( send_prompt_to_autogen, send_user_feedback_to_autogen, ) -from fastagency.core.io.mesop.styles import ( +from fastagency.ui.mesop.styles import ( CHAT_STARTER_STYLE, PAST_CHATS_HIDE_STYLE, PAST_CHATS_SHOW_STYLE, ROOT_BOX_STYLE, STYLESHEETS, ) -from fastagency.logging import get_logger # Get the logger logger = get_logger(__name__) diff --git a/fastagency/core/io/mesop/message.py b/fastagency/ui/mesop/message.py similarity index 100% rename from fastagency/core/io/mesop/message.py rename to fastagency/ui/mesop/message.py diff --git a/fastagency/core/io/mesop/send_prompt.py b/fastagency/ui/mesop/send_prompt.py similarity index 85% rename from fastagency/core/io/mesop/send_prompt.py rename to fastagency/ui/mesop/send_prompt.py index d34b374b7..e21961f2e 100644 --- a/fastagency/core/io/mesop/send_prompt.py +++ b/fastagency/ui/mesop/send_prompt.py @@ -3,7 +3,7 @@ import mesop as me from ...base import Workflows -from .base import MesopIO, MesopMessage, run_workflow +from .base import MesopMessage, MesopUI, run_workflow from .data_model import State @@ -19,6 +19,6 @@ def send_prompt_to_autogen( def send_user_feedback_to_autogen(user_response: str) -> Iterable[MesopMessage]: state = me.state(State) mesop_id = state.fastagency - mesop_io = MesopIO.get_conversation(mesop_id) + mesop_io = MesopUI.get_conversation(mesop_id) mesop_io.respond(user_response) return mesop_io.get_message_stream() diff --git a/fastagency/core/io/mesop/styles.py b/fastagency/ui/mesop/styles.py similarity index 100% rename from fastagency/core/io/mesop/styles.py rename to fastagency/ui/mesop/styles.py diff --git a/tests/cli/test_discover.py b/tests/cli/test_discover.py index 2482b33fe..25ce72935 100644 --- a/tests/cli/test_discover.py +++ b/tests/cli/test_discover.py @@ -6,22 +6,23 @@ import pytest +from fastagency.app import FastAgency + # Import the function we want to test from fastagency.cli.discover import get_import_string, import_from_string -from fastagency.core.app import FastAgency @pytest.fixture(scope="module") def import_fixture() -> Generator[dict[str, Any], None, None]: # Create a temporary file for testing file_content = """ -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows +from fastagency.ui.console import ConsoleUI +from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency import FastAgency wf = AutoGenWorkflows() -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) """ with TemporaryDirectory() as tmp_dir: diff --git a/tests/core/io/console/__init__.py b/tests/core/io/console/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/core/test_autogen.py b/tests/test_autogen.py similarity index 96% rename from tests/core/test_autogen.py rename to tests/test_autogen.py index ada479e99..ecf0ee487 100644 --- a/tests/core/test_autogen.py +++ b/tests/test_autogen.py @@ -3,10 +3,10 @@ import pytest from autogen.agentchat import ConversableAgent, UserProxyAgent -from fastagency.core import Chatable, IOMessage -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen import AutoGenWorkflows -from fastagency.core.runtimes.autogen.base import _findall, _match +from fastagency import Chatable, IOMessage +from fastagency.runtimes.autogen import AutoGenWorkflows +from fastagency.runtimes.autogen.base import _findall, _match +from fastagency.ui.console import ConsoleUI from tests.conftest import InputMock @@ -151,7 +151,7 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: name = "simple_learning" - io = ConsoleIO() + io = ConsoleUI() io.process_message( IOMessage.create( @@ -235,7 +235,7 @@ def test( result = wf.run( name="test_workflow", session_id="session_id", - io=ConsoleIO(), + io=ConsoleUI(), initial_message="What is the weather in Zagreb right now?", ) diff --git a/tests/core/test_base.py b/tests/test_base.py similarity index 100% rename from tests/core/test_base.py rename to tests/test_base.py diff --git a/tests/core/__init__.py b/tests/ui/__init__.py similarity index 100% rename from tests/core/__init__.py rename to tests/ui/__init__.py diff --git a/tests/core/io/__init__.py b/tests/ui/console/__init__.py similarity index 100% rename from tests/core/io/__init__.py rename to tests/ui/console/__init__.py diff --git a/tests/core/io/console/test_base.py b/tests/ui/console/test_base.py similarity index 71% rename from tests/core/io/console/test_base.py rename to tests/ui/console/test_base.py index 0dd3ebcd1..19af9692f 100644 --- a/tests/core/io/console/test_base.py +++ b/tests/ui/console/test_base.py @@ -2,15 +2,15 @@ import pytest -from fastagency.core.app import FastAgency -from fastagency.core.io.console import ConsoleIO -from fastagency.core.runtimes.autogen import AutoGenWorkflows +from fastagency.app import FastAgency +from fastagency.runtimes.autogen import AutoGenWorkflows +from fastagency.ui.console import ConsoleUI @pytest.fixture def app() -> Iterator[FastAgency]: wf = AutoGenWorkflows() - console = ConsoleIO() + console = ConsoleUI() app = FastAgency(wf=wf, io=console) try: @@ -23,7 +23,7 @@ def app() -> Iterator[FastAgency]: pass -# class TestConsoleIOInput: +# class TestConsoleUIInput: # @pytest.skip("Not implemented") # type: ignore[misc] # def test_user_proxy_auto_reply(self, app: FastAgency) -> None: # raise NotImplementedError From 8b072f34fe6200fdb809d4ee7e1ac535744ee402 Mon Sep 17 00:00:00 2001 From: Kumaran Rajendhiran Date: Thu, 12 Sep 2024 14:00:54 +0530 Subject: [PATCH 3/8] Update test to remove duplicates (#189) * Update tests to support pydantic v2.9 * Update tests to support both pydantic v2.8 and v2.9 * wip * Use jsondiff to reduce duplicates in tests * Add a jsonencoder class to handle ellipsis class encoding --------- Co-authored-by: Davor Runje --- tests/api/openapi/test_end2end.py | 146 ++++-------------------------- 1 file changed, 17 insertions(+), 129 deletions(-) diff --git a/tests/api/openapi/test_end2end.py b/tests/api/openapi/test_end2end.py index 2faeb1195..532ce22d8 100644 --- a/tests/api/openapi/test_end2end.py +++ b/tests/api/openapi/test_end2end.py @@ -711,129 +711,13 @@ def test_register_for_llm( azure_gpt35_turbo_16k_llm_config: dict[str, Any], pydantic_version: float, ) -> None: - expected_tools_pydantic_v28 = [ - { - "type": "function", - "function": { - "description": "Create Item", - "name": "create_item_items__post", - "parameters": { - "type": "object", - "properties": { - "body": { - "properties": { - "name": { - "description": "The name of the item", - "title": "Name", - "type": "string", - }, - "description": { - "anyOf": [{"type": "string"}, {"type": "null"}], - "default": None, - "description": "The description of the item", - "title": "Description", - }, - "price": {"title": "Price", "type": "number"}, - "tax": { - "anyOf": [{"type": "number"}, {"type": "null"}], - "default": None, - "title": "Tax", - }, - }, - "required": ["name", "price"], - "title": "ItemsPostRequest", - "type": "object", - "description": "body", - } - }, - "required": ["body"], - }, - }, - }, - { - "type": "function", - "function": { - "description": "Read an item by ID", - "name": "read_item_items__item_id__get", - "parameters": { - "type": "object", - "properties": { - "item_id": { - "type": "integer", - "description": "The ID of the item to get", - }, - "q": { - "anyOf": [{"type": "string"}, {"type": "null"}], - "default": None, - "description": "some extra query parameter", - }, - }, - "required": ["item_id"], - }, - }, - }, - { - "type": "function", - "function": { - "description": "Update an item by ID", - "name": "update_item_items__item_id__put", - "parameters": { - "type": "object", - "properties": { - "item_id": { - "type": "integer", - "description": "The ID of the item to update", - }, - "body": { - "properties": { - "name": { - "description": "The name of the item", - "title": "Name", - "type": "string", - }, - "description": { - "anyOf": [{"type": "string"}, {"type": "null"}], - "default": None, - "description": "The description of the item", - "title": "Description", - }, - "price": {"title": "Price", "type": "number"}, - "tax": { - "anyOf": [{"type": "number"}, {"type": "null"}], - "default": None, - "title": "Tax", - }, - }, - "required": ["name", "price"], - "title": "ItemsItemIdPutRequest", - "type": "object", - "default": Ellipsis, - "description": "body", - }, - }, - "required": ["item_id"], - }, - }, - }, - { - "type": "function", - "function": { - "description": "Delete an item by ID", - "name": "delete_item_items__item_id__delete", - "parameters": { - "type": "object", - "properties": { - "item_id": { - "type": "integer", - "description": "The ID of the item to delete", - } - }, - "required": ["item_id"], - }, - }, - }, - ] - expected_tools_pydantic_v29 = [ + class JSONEncoder(json.JSONEncoder): + def default(self, o: Any) -> Any: + if o.__class__.__name__ == "ellipsis": + return "Ellipsis" + return super().default(o) + + expected_tools = [ { "type": "function", "function": { @@ -955,18 +839,22 @@ def test_register_for_llm( }, }, ] - expected_tools = ( - expected_tools_pydantic_v28 - if pydantic_version < 2.9 - else expected_tools_pydantic_v29 - ) agent = ConversableAgent( name="agent", llm_config=azure_gpt35_turbo_16k_llm_config ) client.register_for_llm(agent) tools = agent.llm_config["tools"] # print(tools) - assert tools == expected_tools + pydantic28_delta = '{"0": {"function": {"parameters": {"properties": {"body": {"title": "ItemsPostRequest"}}}}}, "2": {"function": {"parameters": {"properties": {"body": {"title": "ItemsItemIdPutRequest"}}}}}}' + if pydantic_version < 2.9: + # print(f"pydantic28_delta = '{jsondiff.diff(expected_tools, tools, dump=True)}'") + expected_tools = jsondiff.patch( + json.dumps(expected_tools, cls=JSONEncoder), pydantic28_delta, load=True + ) + + assert json.dumps(tools, cls=JSONEncoder) == json.dumps( + expected_tools, cls=JSONEncoder + ) def test_register_for_execution( self, client: OpenAPI, azure_gpt35_turbo_16k_llm_config: dict[str, Any] From a58ab7bd29902bdf25368ab698ac4ec336039d02 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 12 Sep 2024 16:55:41 +0200 Subject: [PATCH 4/8] Mesop app created in the same process (#193) * Mesop app is created in the same process * bug fix * fixed examples * test fix --- docs/docs/SUMMARY.md | 6 +- .../en/api/fastagency/{Chatable.md => UI.md} | 2 +- .../fastagency/base/{Chatable.md => UI.md} | 2 +- .../main/{get_workflows.md => get_ui.md} | 2 +- .../tutorial/custom_user_interactions/main.py | 6 +- .../tutorial/external_rest_apis/main.py | 6 +- .../tutorial/external_rest_apis/security.py | 6 +- .../docs_src/tutorial/getting_started/main.py | 6 +- examples/cli/main_console.py | 6 +- examples/cli/main_mesop.py | 6 +- examples/cli/main_user_proxy.py | 6 +- fastagency/__init__.py | 4 +- fastagency/app.py | 24 +++-- fastagency/base.py | 34 +++--- fastagency/cli/cli.py | 9 +- fastagency/runtimes/autogen/base.py | 26 +++-- fastagency/ui/console/base.py | 11 +- fastagency/ui/mesop/base.py | 101 ++++++++++++------ fastagency/ui/mesop/main.py | 41 +++---- tests/cli/test_discover.py | 2 +- tests/conftest.py | 2 +- tests/test_autogen.py | 16 +-- tests/ui/console/test_base.py | 2 +- 23 files changed, 178 insertions(+), 148 deletions(-) rename docs/docs/en/api/fastagency/{Chatable.md => UI.md} (82%) rename docs/docs/en/api/fastagency/base/{Chatable.md => UI.md} (79%) rename docs/docs/en/api/fastagency/ui/mesop/main/{get_workflows.md => get_ui.md} (71%) diff --git a/docs/docs/SUMMARY.md b/docs/docs/SUMMARY.md index 223b103c4..8334eee7c 100644 --- a/docs/docs/SUMMARY.md +++ b/docs/docs/SUMMARY.md @@ -11,7 +11,6 @@ search: - [Custom User Interactions](tutorial/custom-user-interactions/index.md) - Reference - fastagency - - [Chatable](api/fastagency/Chatable.md) - [FastAgency](api/fastagency/FastAgency.md) - [FunctionCallExecution](api/fastagency/FunctionCallExecution.md) - [IOMessage](api/fastagency/IOMessage.md) @@ -19,6 +18,7 @@ search: - [SuggestedFunctionCall](api/fastagency/SuggestedFunctionCall.md) - [TextInput](api/fastagency/TextInput.md) - [TextMessage](api/fastagency/TextMessage.md) + - [UI](api/fastagency/UI.md) - [Workflows](api/fastagency/Workflows.md) - api - openapi @@ -42,7 +42,6 @@ search: - [FastAgency](api/fastagency/app/FastAgency.md) - base - [AskingMessage](api/fastagency/base/AskingMessage.md) - - [Chatable](api/fastagency/base/Chatable.md) - [FunctionCallExecution](api/fastagency/base/FunctionCallExecution.md) - [IOMessage](api/fastagency/base/IOMessage.md) - [IOMessageVisitor](api/fastagency/base/IOMessageVisitor.md) @@ -52,6 +51,7 @@ search: - [SystemMessage](api/fastagency/base/SystemMessage.md) - [TextInput](api/fastagency/base/TextInput.md) - [TextMessage](api/fastagency/base/TextMessage.md) + - [UI](api/fastagency/base/UI.md) - [WorkflowCompleted](api/fastagency/base/WorkflowCompleted.md) - [Workflows](api/fastagency/base/Workflows.md) - [run_workflow](api/fastagency/base/run_workflow.md) @@ -251,7 +251,7 @@ search: - main - [conversation_box](api/fastagency/ui/mesop/main/conversation_box.md) - [conversation_starter_box](api/fastagency/ui/mesop/main/conversation_starter_box.md) - - [get_workflows](api/fastagency/ui/mesop/main/get_workflows.md) + - [get_ui](api/fastagency/ui/mesop/main/get_ui.md) - [home_page](api/fastagency/ui/mesop/main/home_page.md) - [on_user_feedback](api/fastagency/ui/mesop/main/on_user_feedback.md) - [past_conversations_box](api/fastagency/ui/mesop/main/past_conversations_box.md) diff --git a/docs/docs/en/api/fastagency/Chatable.md b/docs/docs/en/api/fastagency/UI.md similarity index 82% rename from docs/docs/en/api/fastagency/Chatable.md rename to docs/docs/en/api/fastagency/UI.md index e3633ab6d..1b37e6629 100644 --- a/docs/docs/en/api/fastagency/Chatable.md +++ b/docs/docs/en/api/fastagency/UI.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.Chatable +::: fastagency.UI diff --git a/docs/docs/en/api/fastagency/base/Chatable.md b/docs/docs/en/api/fastagency/base/UI.md similarity index 79% rename from docs/docs/en/api/fastagency/base/Chatable.md rename to docs/docs/en/api/fastagency/base/UI.md index 8b54965c9..e54da7e26 100644 --- a/docs/docs/en/api/fastagency/base/Chatable.md +++ b/docs/docs/en/api/fastagency/base/UI.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.base.Chatable +::: fastagency.base.UI diff --git a/docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md b/docs/docs/en/api/fastagency/ui/mesop/main/get_ui.md similarity index 71% rename from docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md rename to docs/docs/en/api/fastagency/ui/mesop/main/get_ui.md index 0b353a4e5..126dae64d 100644 --- a/docs/docs/en/api/fastagency/ui/mesop/main/get_workflows.md +++ b/docs/docs/en/api/fastagency/ui/mesop/main/get_ui.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.ui.mesop.main.get_workflows +::: fastagency.ui.mesop.main.get_ui diff --git a/docs/docs_src/tutorial/custom_user_interactions/main.py b/docs/docs_src/tutorial/custom_user_interactions/main.py index 0cbb0a755..3fe160b27 100644 --- a/docs/docs_src/tutorial/custom_user_interactions/main.py +++ b/docs/docs_src/tutorial/custom_user_interactions/main.py @@ -5,7 +5,7 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency import Chatable +from fastagency import UI from fastagency.base import MultipleChoice, SystemMessage, TextInput from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows @@ -24,7 +24,7 @@ @wf.register(name="exam_practice", description="Student and teacher chat") # type: ignore[type-var] -def exam_learning(io: Chatable, initial_message: str, session_id: str) -> Optional[str]: +def exam_learning(io: UI, initial_message: str, session_id: str) -> Optional[str]: def is_termination_msg(msg: dict[str, Any]) -> bool: return msg["content"] is not None and "TERMINATE" in msg["content"] @@ -132,4 +132,4 @@ def get_final_grade( return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/docs/docs_src/tutorial/external_rest_apis/main.py b/docs/docs_src/tutorial/external_rest_apis/main.py index 6afcb1e0b..996c76423 100644 --- a/docs/docs_src/tutorial/external_rest_apis/main.py +++ b/docs/docs_src/tutorial/external_rest_apis/main.py @@ -4,7 +4,7 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency import Chatable +from fastagency import UI from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows @@ -27,7 +27,7 @@ @wf.register(name="simple_weather", description="Weather chat") -def weather_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def weather_workflow(io: UI, initial_message: str, session_id: str) -> str: weather_api = OpenAPI.create(openapi_url=WEATHER_OPENAPI_URL) @@ -57,4 +57,4 @@ def weather_workflow(io: Chatable, initial_message: str, session_id: str) -> str return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/docs/docs_src/tutorial/external_rest_apis/security.py b/docs/docs_src/tutorial/external_rest_apis/security.py index bfc7aeb51..669837c86 100644 --- a/docs/docs_src/tutorial/external_rest_apis/security.py +++ b/docs/docs_src/tutorial/external_rest_apis/security.py @@ -4,7 +4,7 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency import Chatable +from fastagency import UI from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI @@ -26,7 +26,7 @@ @wf.register(name="simple_weather_with_security", description="Weather chat with security") -def weather_workflow_with_security(io: Chatable, initial_message: str, session_id: str) -> str: +def weather_workflow_with_security(io: UI, initial_message: str, session_id: str) -> str: weather_client = OpenAPI.create(openapi_url=WEATHER_OPENAPI_URL) @@ -65,4 +65,4 @@ def weather_workflow_with_security(io: Chatable, initial_message: str, session_i return chat_result.summary # type: ignore[no-any-return] -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/docs/docs_src/tutorial/getting_started/main.py b/docs/docs_src/tutorial/getting_started/main.py index 635260eb3..59615e8aa 100644 --- a/docs/docs_src/tutorial/getting_started/main.py +++ b/docs/docs_src/tutorial/getting_started/main.py @@ -3,7 +3,7 @@ from autogen.agentchat import ConversableAgent from fastagency import FastAgency -from fastagency import Chatable +from fastagency import UI from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows @@ -21,7 +21,7 @@ @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", @@ -44,4 +44,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/examples/cli/main_console.py b/examples/cli/main_console.py index 9850cec58..ee2898bef 100644 --- a/examples/cli/main_console.py +++ b/examples/cli/main_console.py @@ -2,7 +2,7 @@ from autogen.agentchat import ConversableAgent -from fastagency import Chatable +from fastagency import UI from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows @@ -22,7 +22,7 @@ wf = AutoGenWorkflows() @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", @@ -43,4 +43,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/examples/cli/main_mesop.py b/examples/cli/main_mesop.py index 898c75765..7d63eb774 100644 --- a/examples/cli/main_mesop.py +++ b/examples/cli/main_mesop.py @@ -2,7 +2,7 @@ from autogen.agentchat import ConversableAgent -from fastagency import Chatable +from fastagency import UI from fastagency.ui.mesop import MesopUI from fastagency.runtimes.autogen.base import AutoGenWorkflows @@ -22,7 +22,7 @@ wf = AutoGenWorkflows() @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", @@ -43,4 +43,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=MesopUI()) +app = FastAgency(wf=wf, ui=MesopUI()) diff --git a/examples/cli/main_user_proxy.py b/examples/cli/main_user_proxy.py index 52cf3afbd..b7e1f1ef8 100644 --- a/examples/cli/main_user_proxy.py +++ b/examples/cli/main_user_proxy.py @@ -2,7 +2,7 @@ from autogen.agentchat import ConversableAgent, UserProxyAgent -from fastagency import Chatable +from fastagency import UI from fastagency.ui.console import ConsoleUI from fastagency.runtimes.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI @@ -24,7 +24,7 @@ wf = AutoGenWorkflows() @wf.register(name="weatherman_workflow", description="Weatherman chat") -def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: user_proxy = UserProxyAgent( name="User_Proxy", @@ -52,4 +52,4 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: return chat_result.summary -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/fastagency/__init__.py b/fastagency/__init__.py index 5316e20f2..e9118bda9 100644 --- a/fastagency/__init__.py +++ b/fastagency/__init__.py @@ -3,7 +3,7 @@ from .__about__ import __version__ from .app import FastAgency from .base import ( - Chatable, + UI, FunctionCallExecution, IOMessage, MessageType, @@ -16,7 +16,7 @@ ) __all__ = [ - "Chatable", + "UI", "FastAgency", "FunctionCallExecution", "IOMessage", diff --git a/fastagency/app.py b/fastagency/app.py index c7cd1c05c..7523ead33 100644 --- a/fastagency/app.py +++ b/fastagency/app.py @@ -1,20 +1,22 @@ __all__ = ["FastAgency"] +from collections.abc import Generator +from contextlib import contextmanager from typing import Optional -from .base import Chatable, Workflows +from .base import UI, Workflows class FastAgency: # Runnable - def __init__(self, wf: Workflows, io: Chatable) -> None: + def __init__(self, wf: Workflows, ui: UI) -> None: """Initialize the FastAgency object. Args: wf (Workflows): The workflows object to use - io (Chatable): The IO object to use + ui (Chatable): The UI object to use """ self._wf = wf - self._io = io + self._ui = ui @property def wf(self) -> Workflows: @@ -22,13 +24,15 @@ def wf(self) -> Workflows: return self._wf @property - def io(self) -> Chatable: - """Return the IO object.""" - return self._io + def ui(self) -> UI: + """Return the UI object.""" + return self._ui - def create(self, import_string: str) -> None: + @contextmanager + def create(self, import_string: str) -> Generator[None, None, None]: """Create the FastAgency.""" - self._io.create(app=self, import_string=import_string) + with self._ui.create(app=self, import_string=import_string): + yield def start( self, @@ -37,7 +41,7 @@ def start( initial_message: Optional[str] = None, ) -> None: """Start the FastAgency.""" - self._io.start( + self.ui.start( app=self, import_string=import_string, name=name, diff --git a/fastagency/base.py b/fastagency/base.py index 9c1533620..c530addbd 100644 --- a/fastagency/base.py +++ b/fastagency/base.py @@ -1,6 +1,8 @@ import re import textwrap from abc import ABC, abstractmethod +from collections.abc import Generator, Iterator +from contextlib import contextmanager from dataclasses import asdict, dataclass, field, fields from typing import ( Any, @@ -14,7 +16,7 @@ ) __all__ = [ - "Chatable", + "UI", "FunctionCallExecution", "IOMessage", "MessageType", @@ -195,8 +197,9 @@ def visit_workflow_completed(self, message: WorkflowCompleted) -> Optional[str]: @runtime_checkable -class Chatable(Protocol): - def create(self, app: "Runnable", import_string: str) -> None: ... +class UI(Protocol): + @contextmanager + def create(self, app: "Runnable", import_string: str) -> Iterator[None]: ... def start( self, @@ -212,10 +215,10 @@ def process_message(self, message: IOMessage) -> Optional[str]: ... # self, message: IOStreamingMessage # ) -> Optional[str]: ... - def create_subconversation(self) -> "Chatable": ... + def create_subconversation(self) -> "UI": ... -Workflow = TypeVar("Workflow", bound=Callable[[Chatable, str, str], str]) +Workflow = TypeVar("Workflow", bound=Callable[[UI, str, str], str]) @runtime_checkable @@ -224,9 +227,7 @@ def register( self, name: str, description: str ) -> Callable[[Workflow], Workflow]: ... - def run( - self, name: str, session_id: str, io: Chatable, initial_message: str - ) -> str: ... + def run(self, name: str, session_id: str, ui: UI, initial_message: str) -> str: ... @property def names(self) -> list[str]: ... @@ -236,7 +237,8 @@ def get_description(self, name: str) -> str: ... @runtime_checkable class Runnable(Protocol): - def create(self, import_string: str) -> None: ... + @contextmanager + def create(self, import_string: str) -> Generator[None, None, None]: ... def start( self, @@ -249,12 +251,12 @@ def start( def wf(self) -> Workflows: ... @property - def io(self) -> Chatable: ... + def ui(self) -> UI: ... def run_workflow( wf: Workflows, - io: Chatable, + ui: UI, name: Optional[str], initial_message: Optional[str] = None, ) -> None: @@ -262,7 +264,7 @@ def run_workflow( Args: wf (Workflows): The workflows object to use. - io (Chatable): The IO object to use. + ui (Chatable): The UI object to use. name (Optional[str]): The name of the workflow to run. If not provided, the default workflow will be run. initial_message (Optional[str], optional): The initial message to send to the workflow. If not provided, a default message will be sent. Defaults to None. """ @@ -271,7 +273,7 @@ def run_workflow( description = wf.get_description(name) if initial_message is None: - initial_message = io.process_message( + initial_message = ui.process_message( TextInput( sender="FastAgency", recipient="user", @@ -284,7 +286,7 @@ def run_workflow( ) ) else: - io.process_message( + ui.process_message( SystemMessage( sender="FastAgency", recipient="user", @@ -303,11 +305,11 @@ def run_workflow( result = wf.run( name=name, session_id="session_id", - io=io.create_subconversation(), + ui=ui.create_subconversation(), initial_message="Hi!" if initial_message is None else initial_message, ) - io.process_message( + ui.process_message( WorkflowCompleted( sender="workflow", recipient="user", diff --git a/fastagency/cli/cli.py b/fastagency/cli/cli.py index 1c3d457e1..3f7b34a96 100644 --- a/fastagency/cli/cli.py +++ b/fastagency/cli/cli.py @@ -49,9 +49,12 @@ def _run_app( try: import_string, fa_app = get_import_string(path=path, app_name=app) - fa_app.start( - import_string=import_string, name=workflow, initial_message=initial_message - ) + with fa_app.create(import_string=import_string): + fa_app.start( + import_string=import_string, + name=workflow, + initial_message=initial_message, + ) except FastAgencyCLIError as e: logger.error(str(e)) raise typer.Exit(code=1) from None diff --git a/fastagency/runtimes/autogen/base.py b/fastagency/runtimes/autogen/base.py index 737c16a72..0cd1f7604 100644 --- a/fastagency/runtimes/autogen/base.py +++ b/fastagency/runtimes/autogen/base.py @@ -6,8 +6,8 @@ from autogen.io import IOStream from ...base import ( + UI, AskingMessage, - Chatable, IOMessage, MessageType, MultipleChoice, @@ -171,19 +171,19 @@ def create_message(self) -> IOMessage: class IOStreamAdapter: # IOStream - def __init__(self, io: Chatable) -> None: + def __init__(self, ui: UI) -> None: """Initialize the adapter with a ChatableIO object. Args: - io (ChatableIO): The ChatableIO object to adapt + ui (ChatableIO): The ChatableIO object to adapt """ - self.io = io + self.ui = ui self.current_message = CurrentMessage() self.messages: list[IOMessage] = [] - if not isinstance(self.io, Chatable): - raise ValueError("The io object must be an instance of Chatable.") + if not isinstance(self.ui, UI): + raise ValueError("The ui object must be an instance of Chatable.") def _process_message_chunk(self, chunk: str) -> bool: if self.current_message.process_chunk(chunk): @@ -203,7 +203,7 @@ def print( ready_to_send = self._process_message_chunk(body) if ready_to_send: message = self.messages[-1] - self.io.process_message(message) + self.ui.process_message(message) def input(self, prompt: str = "", *, password: bool = False) -> str: # logger.info(f"input(): {prompt=}, {password=}") @@ -211,7 +211,7 @@ def input(self, prompt: str = "", *, password: bool = False) -> str: prompt, password, self.messages ) - retval: str = self.io.process_message(message) # type: ignore[assignment] + retval: str = self.ui.process_message(message) # type: ignore[assignment] # in case of approving a suggested function call, we need to return an empty string to AutoGen if ( @@ -230,7 +230,7 @@ def input(self, prompt: str = "", *, password: bool = False) -> str: class AutoGenWorkflows(Workflows): def __init__(self) -> None: """Initialize the workflows.""" - self._workflows: dict[str, tuple[Callable[[Chatable, str, str], str], str]] = {} + self._workflows: dict[str, tuple[Callable[[UI, str, str], str], str]] = {} def register( self, name: str, description: str, *, fail_on_redefintion: bool = False @@ -247,15 +247,13 @@ def decorator(func: Workflow) -> Workflow: return decorator - def run( - self, name: str, session_id: str, io: Chatable, initial_message: str - ) -> str: + def run(self, name: str, session_id: str, ui: UI, initial_message: str) -> str: workflow, description = self._workflows[name] - iostream = IOStreamAdapter(io) + iostream = IOStreamAdapter(ui) with IOStream.set_default(iostream): - return workflow(io, initial_message, session_id) + return workflow(ui, initial_message, session_id) @property def names(self) -> list[str]: diff --git a/fastagency/ui/console/base.py b/fastagency/ui/console/base.py index e9d7b78e5..e4b0e2c9c 100644 --- a/fastagency/ui/console/base.py +++ b/fastagency/ui/console/base.py @@ -1,6 +1,8 @@ import getpass import json import textwrap +from collections.abc import Iterator +from contextlib import contextmanager from dataclasses import dataclass from typing import Optional @@ -18,7 +20,7 @@ logger = get_logger(__name__) -class ConsoleUI(IOMessageVisitor): # implements Chatable +class ConsoleUI(IOMessageVisitor): # implements UI @dataclass class ConsoleMessage: """A console message.""" @@ -29,7 +31,7 @@ class ConsoleMessage: body: Optional[str] def __init__(self, super_conversation: Optional["ConsoleUI"] = None) -> None: - """Initialize the console IO object. + """Initialize the console UI object. Args: super_conversation (Optional[Chatable], optional): The super conversation. Defaults to None. @@ -37,8 +39,9 @@ def __init__(self, super_conversation: Optional["ConsoleUI"] = None) -> None: self.super_conversation: Optional[ConsoleUI] = super_conversation self.sub_conversations: list[ConsoleUI] = [] - def create(self, app: Runnable, import_string: str) -> None: - pass + @contextmanager + def create(self, app: Runnable, import_string: str) -> Iterator[None]: + yield def start( self, diff --git a/fastagency/ui/mesop/base.py b/fastagency/ui/mesop/base.py index 926c23860..837abe42c 100644 --- a/fastagency/ui/mesop/base.py +++ b/fastagency/ui/mesop/base.py @@ -1,14 +1,16 @@ -import os -import subprocess # nosec: B404 -import sys import threading -from collections.abc import Generator +from collections.abc import Generator, Iterator +from contextlib import contextmanager from dataclasses import dataclass from pathlib import Path from queue import Queue +from tempfile import TemporaryDirectory from typing import ClassVar, Optional from uuid import uuid4 +from mesop.bin.bin import FLAGS as MESOP_FLAGS +from mesop.bin.bin import main as mesop_main + from ...base import ( AskingMessage, IOMessage, @@ -20,6 +22,9 @@ WorkflowCompleted, Workflows, ) +from ...logging import get_logger + +logger = get_logger(__name__) @dataclass @@ -30,18 +35,24 @@ class MesopMessage: conversation: "MesopUI" -class MesopUI(IOMessageVisitor): # Chatable - def __init__(self, super_conversation: Optional["MesopUI"] = None) -> None: - """Initialize the console IO object. +class MesopUI(IOMessageVisitor): # UI + _import_string: Optional[str] = None + _main_path: Optional[str] = None + _created_instance: Optional["MesopUI"] = None + _app: Optional[Runnable] = None + + def __init__(self, super_conversation: "Optional[MesopUI]" = None) -> None: + """Initialize the console UI object. Args: - super_conversation (Optional[Chatable], optional): The super conversation. Defaults to None. + super_conversation (Optional[MesopUI], optional): The super conversation. Defaults to None. """ self.id: str = uuid4().hex self.super_conversation: Optional[MesopUI] = super_conversation self.sub_conversations: list[MesopUI] = [] self._in_queue: Optional[Queue[str]] = None self._out_queue: Optional[Queue[MesopMessage]] = None + if super_conversation is None: self._in_queue = Queue() self._out_queue = Queue() @@ -49,12 +60,40 @@ def __init__(self, super_conversation: Optional["MesopUI"] = None) -> None: _registry: ClassVar[dict[str, "MesopUI"]] = {} + @classmethod + def get_created_instance(cls) -> "MesopUI": + created_instance = cls._created_instance + if created_instance is None: + raise RuntimeError("MesopUI has not been created yet.") + + return created_instance + @property - def main_path(self) -> str: - return (Path(__file__).parent / "main.py").absolute().as_posix() + def app(self) -> Runnable: + app = MesopUI._app + if app is None: + raise RuntimeError("MesopUI has not been created yet.") - def create(self, app: Runnable, import_string: str) -> None: - pass + return app + + @contextmanager + def create(self, app: Runnable, import_string: str) -> Iterator[None]: + logger.info(f"Creating MesopUI with import string: {import_string}") + self._app = app + self._import_string = import_string + + start_script = """import fastagency.ui.mesop.main""" + + with TemporaryDirectory() as temp_dir: + main_path = Path(temp_dir) / "main.py" + with main_path.open("w") as f: + f.write(start_script) + + MESOP_FLAGS.mark_as_parsed() + MesopUI._main_path = str(main_path) + MesopUI._created_instance = self + + yield def start( self, @@ -63,19 +102,13 @@ def start( name: Optional[str] = None, initial_message: Optional[str] = None, ) -> None: - env = os.environ.copy() - env["IMPORT_STRING"] = import_string - process = subprocess.Popen( # nosec: B603, B607 - ["mesop", self.main_path], - stdout=sys.stdout, - stderr=sys.stderr, - text=True, - bufsize=1, - env=env, + logger.info( + f"Starting MesopUI: import_string={self._import_string}, main_path={self._main_path}" ) - result = process.wait() - if result != 0: - raise RuntimeError("Mesop process failed") + + MesopUI._app = app + + mesop_main(["mesop", self._main_path]) @classmethod def register(cls, conversation: "MesopUI") -> None: @@ -176,8 +209,8 @@ def get_message_stream(self) -> Generator[MesopMessage, None, None]: def run_workflow(wf: Workflows, name: str, initial_message: str) -> MesopUI: - def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: - io.process_message( + def conversation_worker(ui: MesopUI, subconversation: MesopUI) -> None: + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -192,11 +225,11 @@ def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: result = wf.run( name=name, session_id="session_id", - io=subconversation, # type: ignore[arg-type] + ui=subconversation, # type: ignore[arg-type] initial_message=initial_message, ) except Exception as ex: - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -207,7 +240,7 @@ def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: }, ) ) - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -217,7 +250,7 @@ def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: ) return - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -229,7 +262,7 @@ def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: ) ) - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -238,9 +271,9 @@ def conversation_worker(io: MesopUI, subconversation: MesopUI) -> None: ) ) - io = MesopUI() - subconversation = io.create_subconversation() - thread = threading.Thread(target=conversation_worker, args=(io, subconversation)) + ui = MesopUI() + subconversation = ui.create_subconversation() + thread = threading.Thread(target=conversation_worker, args=(ui, subconversation)) thread.start() return subconversation diff --git a/fastagency/ui/mesop/main.py b/fastagency/ui/mesop/main.py index e6862ed6c..815e432a8 100644 --- a/fastagency/ui/mesop/main.py +++ b/fastagency/ui/mesop/main.py @@ -1,23 +1,18 @@ import json -import os from collections.abc import Iterator from uuid import uuid4 import mesop as me -from fastagency.base import AskingMessage, WorkflowCompleted, Workflows -from fastagency.cli.discover import import_from_string -from fastagency.logging import get_logger -from fastagency.ui.mesop.base import MesopMessage -from fastagency.ui.mesop.components.inputs import input_prompt, input_user_feedback -from fastagency.ui.mesop.components.ui_common import header -from fastagency.ui.mesop.data_model import Conversation, State -from fastagency.ui.mesop.message import message_box -from fastagency.ui.mesop.send_prompt import ( - send_prompt_to_autogen, - send_user_feedback_to_autogen, -) -from fastagency.ui.mesop.styles import ( +from ...base import AskingMessage, WorkflowCompleted +from ...logging import get_logger +from .base import MesopMessage, MesopUI +from .components.inputs import input_prompt, input_user_feedback +from .components.ui_common import header +from .data_model import Conversation, State +from .message import message_box +from .send_prompt import send_prompt_to_autogen, send_user_feedback_to_autogen +from .styles import ( CHAT_STARTER_STYLE, PAST_CHATS_HIDE_STYLE, PAST_CHATS_SHOW_STYLE, @@ -29,18 +24,8 @@ logger = get_logger(__name__) -def get_workflows() -> Workflows: - import_string = os.environ.get("IMPORT_STRING", None) - if import_string is None: - raise ValueError("No import string provided") - - # import app using import string - app = import_from_string(import_string) - - # get workflows from the app - wf = app.wf - - return wf +def get_ui() -> MesopUI: + return MesopUI.get_created_instance() SECURITY_POLICY = me.SecurityPolicy(allowed_iframe_parents=["https://huggingface.co"]) @@ -161,7 +146,9 @@ def _handle_message(state: State, message: MesopMessage) -> None: def send_prompt(e: me.ClickEvent) -> Iterator[None]: - wf = get_workflows() + ui = get_ui() + wf = ui.app.wf + name = wf.names[0] state = me.state(State) diff --git a/tests/cli/test_discover.py b/tests/cli/test_discover.py index 25ce72935..abbb7e4d8 100644 --- a/tests/cli/test_discover.py +++ b/tests/cli/test_discover.py @@ -22,7 +22,7 @@ def import_fixture() -> Generator[dict[str, Any], None, None]: wf = AutoGenWorkflows() -app = FastAgency(wf=wf, io=ConsoleUI()) +app = FastAgency(wf=wf, ui=ConsoleUI()) """ with TemporaryDirectory() as tmp_dir: diff --git a/tests/conftest.py b/tests/conftest.py index 91b2844f9..6c7164428 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -619,7 +619,7 @@ async def placeholder_assistant_weatherapi_ref( name=add_random_suffix("assistant_weather"), llm=llm_ref, toolbox_1=weather_toolbox_ref, - system_message="You are a helpful assistant with access to Weather API. After you successfully answer the question asked and there are no new questions, terminate the chat by outputting 'TERMINATE'", + system_message="You are a helpful assistant with access to Weather API. After you successfully answer the question asked and there are no new questions, terminate the chat by outputting 'TERMINATE' (all caps)", ) diff --git a/tests/test_autogen.py b/tests/test_autogen.py index ecf0ee487..0ebec20c4 100644 --- a/tests/test_autogen.py +++ b/tests/test_autogen.py @@ -3,7 +3,7 @@ import pytest from autogen.agentchat import ConversableAgent, UserProxyAgent -from fastagency import Chatable, IOMessage +from fastagency import UI, IOMessage from fastagency.runtimes.autogen import AutoGenWorkflows from fastagency.runtimes.autogen.base import _findall, _match from fastagency.ui.console import ConsoleUI @@ -126,7 +126,7 @@ def test_simple(openai_gpt4o_mini_llm_config: dict[str, Any]) -> None: @wf.register( name="simple_learning", description="Student and teacher learning chat" ) - def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: + def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", @@ -151,9 +151,9 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: name = "simple_learning" - io = ConsoleUI() + ui = ConsoleUI() - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -168,11 +168,11 @@ def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: result = wf.run( name=name, session_id="session_id", - io=io.create_subconversation(), + ui=ui.create_subconversation(), initial_message=initial_message, ) - io.process_message( + ui.process_message( IOMessage.create( sender="user", recipient="workflow", @@ -195,7 +195,7 @@ def wf(self, openai_gpt4o_mini_llm_config: dict[str, Any]) -> AutoGenWorkflows: name="test_workflow", description="Test of user proxy with human input mode set to always", ) - def workflow(io: Chatable, initial_message: str, session_id: str) -> str: + def workflow(ui: UI, initial_message: str, session_id: str) -> str: user_proxy = UserProxyAgent( name="User_Proxy", human_input_mode="ALWAYS", @@ -235,7 +235,7 @@ def test( result = wf.run( name="test_workflow", session_id="session_id", - io=ConsoleUI(), + ui=ConsoleUI(), initial_message="What is the weather in Zagreb right now?", ) diff --git a/tests/ui/console/test_base.py b/tests/ui/console/test_base.py index 19af9692f..0ebab2f5c 100644 --- a/tests/ui/console/test_base.py +++ b/tests/ui/console/test_base.py @@ -11,7 +11,7 @@ def app() -> Iterator[FastAgency]: wf = AutoGenWorkflows() console = ConsoleUI() - app = FastAgency(wf=wf, io=console) + app = FastAgency(wf=wf, ui=console) try: import_string = "main:app" From db901940da7d57f1bea4a133e4bb07442be7a8e4 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 12 Sep 2024 20:44:15 +0200 Subject: [PATCH 5/8] Add user guide (#179) * wip * test fixed * wip * wip * User guide added * version bumped to 0.1.0b0 --------- Co-authored-by: Kumaran Rajendhiran --- CONTRIBUTING.md | 2 +- README.md | 18 ++-- docs/docs.py | 4 +- docs/docs/SUMMARY.md | 37 +++++--- .../autogen/AutoGenWorkflows.md | 2 +- .../autogen/IOStreamAdapter.md | 2 +- .../runtime/autogen/base/AutoGenWorkflows.md | 11 +++ .../autogen/base/CurrentMessage.md | 2 +- .../autogen/base/IOStreamAdapter.md | 2 +- .../runtimes/autogen/base/AutoGenWorkflows.md | 11 --- .../contributing/CONTRIBUTING.md | 0 .../contributing/docs.md | 0 docs/docs/en/contributing/index.md | 1 + docs/docs/en/getting-started/index.md | 40 ++++----- docs/docs/en/user-guide/api/index.md | 23 +++++ .../api/openapi}/index.md | 10 +-- .../api}/security.md | 12 +-- .../index.md => user-guide/basics.md} | 28 +++--- docs/docs/en/user-guide/cli/index.md | 66 ++++++++++++++ docs/docs/en/user-guide/index.md | 29 ++++++ .../en/user-guide/runtime/autogen/index.md | 89 +++++++++++++++++++ .../runtime/autogen/interactions.md} | 14 +-- .../en/user-guide/runtime/crewai/basics.md | 9 ++ docs/docs/en/user-guide/runtime/index.md | 21 +++++ docs/docs/en/user-guide/testing/index.md | 17 ++++ docs/docs/en/user-guide/ui/console/basics.md | 74 +++++++++++++++ docs/docs/en/user-guide/ui/fastapi/basics.md | 17 ++++ docs/docs/en/user-guide/ui/index.md | 26 ++++++ docs/docs/en/user-guide/ui/mesop/basics.md | 83 +++++++++++++++++ docs/docs/navigation_template.txt | 25 ++++-- docs/docs/stylesheets/extra.css | 21 +++-- .../{tutorial => getting_started}/__init__.py | 0 .../main_console.py} | 4 +- docs/docs_src/getting_started/main_mesop.py | 47 ++++++++++ .../__init__.py | 0 .../custom_user_interactions}/__init__.py | 0 .../custom_user_interactions/main.py | 10 +-- .../external_rest_apis}/__init__.py | 0 .../external_rest_apis/main.py | 4 +- .../external_rest_apis/security.py | 4 +- .../docs_src/user_guide/runtime}/__init__.py | 0 .../user_guide/runtime/autogen/__init__.py | 0 .../user_guide/runtime/autogen/main.py | 71 +++++++++++++++ examples/autogen.ipynb | 24 ++--- examples/cli/main_console.py | 4 +- examples/cli/main_mesop.py | 4 +- examples/cli/main_user_proxy.py | 4 +- fastagency/__about__.py | 2 +- fastagency/app.py | 2 +- fastagency/base.py | 2 +- fastagency/runtime/__init__.py | 0 .../{runtimes => runtime}/autogen/__init__.py | 0 .../{runtimes => runtime}/autogen/base.py | 2 +- fastagency/ui/console/base.py | 2 +- tests/cli/test_discover.py | 2 +- .../external_rest_apis/test_with_security.py | 2 +- .../test_without_security.py | 2 +- tests/examples/__init__.py | 0 tests/test_autogen.py | 4 +- tests/ui/console/test_base.py | 2 +- 60 files changed, 739 insertions(+), 155 deletions(-) rename docs/docs/en/api/fastagency/{runtimes => runtime}/autogen/AutoGenWorkflows.md (69%) rename docs/docs/en/api/fastagency/{runtimes => runtime}/autogen/IOStreamAdapter.md (69%) create mode 100644 docs/docs/en/api/fastagency/runtime/autogen/base/AutoGenWorkflows.md rename docs/docs/en/api/fastagency/{runtimes => runtime}/autogen/base/CurrentMessage.md (67%) rename docs/docs/en/api/fastagency/{runtimes => runtime}/autogen/base/IOStreamAdapter.md (67%) delete mode 100644 docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md rename docs/docs/en/{getting-started => }/contributing/CONTRIBUTING.md (100%) rename docs/docs/en/{getting-started => }/contributing/docs.md (100%) create mode 100644 docs/docs/en/contributing/index.md create mode 100644 docs/docs/en/user-guide/api/index.md rename docs/docs/en/{tutorial/external-rest-apis => user-guide/api/openapi}/index.md (97%) rename docs/docs/en/{tutorial/external-rest-apis => user-guide/api}/security.md (97%) rename docs/docs/en/{tutorial/index.md => user-guide/basics.md} (88%) create mode 100644 docs/docs/en/user-guide/cli/index.md create mode 100644 docs/docs/en/user-guide/index.md create mode 100644 docs/docs/en/user-guide/runtime/autogen/index.md rename docs/docs/en/{tutorial/custom-user-interactions/index.md => user-guide/runtime/autogen/interactions.md} (68%) create mode 100644 docs/docs/en/user-guide/runtime/crewai/basics.md create mode 100644 docs/docs/en/user-guide/runtime/index.md create mode 100644 docs/docs/en/user-guide/testing/index.md create mode 100644 docs/docs/en/user-guide/ui/console/basics.md create mode 100644 docs/docs/en/user-guide/ui/fastapi/basics.md create mode 100644 docs/docs/en/user-guide/ui/index.md create mode 100644 docs/docs/en/user-guide/ui/mesop/basics.md rename docs/docs_src/{tutorial => getting_started}/__init__.py (100%) rename docs/docs_src/{tutorial/getting_started/main.py => getting_started/main_console.py} (89%) create mode 100644 docs/docs_src/getting_started/main_mesop.py rename docs/docs_src/{tutorial/custom_user_interactions => user_guide}/__init__.py (100%) rename docs/docs_src/{tutorial/external_rest_apis => user_guide/custom_user_interactions}/__init__.py (100%) rename docs/docs_src/{tutorial => user_guide}/custom_user_interactions/main.py (94%) rename docs/docs_src/{tutorial/getting_started => user_guide/external_rest_apis}/__init__.py (100%) rename docs/docs_src/{tutorial => user_guide}/external_rest_apis/main.py (91%) rename docs/docs_src/{tutorial => user_guide}/external_rest_apis/security.py (93%) rename {fastagency/runtimes => docs/docs_src/user_guide/runtime}/__init__.py (100%) create mode 100644 docs/docs_src/user_guide/runtime/autogen/__init__.py create mode 100644 docs/docs_src/user_guide/runtime/autogen/main.py create mode 100644 fastagency/runtime/__init__.py rename fastagency/{runtimes => runtime}/autogen/__init__.py (100%) rename fastagency/{runtimes => runtime}/autogen/base.py (99%) create mode 100644 tests/examples/__init__.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f1e393895..8b5e9bb2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -> **_NOTE:_** This is an auto-generated file. Please edit docs/docs/en/getting-started/contributing/CONTRIBUTING.md instead. +> **_NOTE:_** This is an auto-generated file. Please edit docs/docs/en/contributing/CONTRIBUTING.md instead. # Development diff --git a/README.md b/README.md index 46b7c4ea5..87872c8c8 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleIO](https://fastagency.ai/latest/api/fastagency/core/io/console/ConsoleIO/) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/) with [MesopIO](https://fastagency.ai/latest/api/fastagency/core/io/mesop/MesopIO/) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](https://fastagency.ai/latest/api/fastagency/io/console/ConsoleUI/) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/) with [MesopUI](https://fastagency.ai/latest/api/fastagency/io/mesop/MesopUI/) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/), to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. @@ -92,14 +92,14 @@ import os from autogen.agentchat import ConversableAgent -from fastagency.core import Chatable -from fastagency.core.runtimes.autogen.base import AutoGenWorkflows -from fastagency.core.io.console import ConsoleIO +from fastagency import UI +from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.ui.console import ConsoleUI from fastagency import FastAgency ``` -For Console applications, import `ConsoleIO` to handle command-line input and output. +For Console applications, import `ConsoleUI` to handle command-line input and output. ### Define Workflow @@ -120,7 +120,7 @@ llm_config = { wf = AutoGenWorkflows() @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str: +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", @@ -149,9 +149,9 @@ This code snippet sets up a simple learning chat between a student and a teacher Next, define your FastAgency application. This ties together your workflow and the interface you chose: ```python -from fastagency.core.io.console import ConsoleIO +from fastagency.ui.console import ConsoleUI -app = FastAgency(wf=wf, io=ConsoleIO()) +app = FastAgency(wf=wf, io=ConsoleUI()) ``` ## Run Application diff --git a/docs/docs.py b/docs/docs.py index 8772104b6..9ae30a879 100644 --- a/docs/docs.py +++ b/docs/docs.py @@ -28,9 +28,7 @@ EN_DOCS_DIR = DOCS_DIR / "en" EN_INDEX_PATH = EN_DOCS_DIR / "index.md" README_PATH = BASE_DIR.parent / "README.md" -EN_CONTRIBUTING_PATH = ( - EN_DOCS_DIR / "getting-started" / "contributing" / "CONTRIBUTING.md" -) +EN_CONTRIBUTING_PATH = EN_DOCS_DIR / "contributing" / "CONTRIBUTING.md" CONTRIBUTING_PATH = BASE_DIR.parent / "CONTRIBUTING.md" diff --git a/docs/docs/SUMMARY.md b/docs/docs/SUMMARY.md index 8334eee7c..c14248254 100644 --- a/docs/docs/SUMMARY.md +++ b/docs/docs/SUMMARY.md @@ -4,11 +4,20 @@ search: --- - Getting Started - [Getting Started](getting-started/index.md) -- Tutorial - - [Getting Started](tutorial/index.md) - - [Using External REST APIs](tutorial/external-rest-apis/index.md) - - [Using External REST APIs with security](tutorial/external-rest-apis/security.md) - - [Custom User Interactions](tutorial/custom-user-interactions/index.md) +- [User guide](user-guide/index.md) + - [Runtimes](user-guide/runtime/index.md) + - [AutoGen](user-guide/runtime/autogen/index.md) + - [User interaction](user-guide/runtime/autogen/interactions.md) + - [CrewAI](user-guide/runtime/crewai/basics.md) + - [UI](user-guide/ui/index.md) + - [Console](user-guide/ui/console/basics.md) + - [Mesop](user-guide/ui/mesop/basics.md) + - [FastAPI](user-guide/ui/fastapi/basics.md) + - [API-s](user-guide/api/index.md) + - [OpenAPI](user-guide/api/openapi/index.md) + - [Security](user-guide/api/security.md) + - [Testing](user-guide/testing/index.md) + - [CLI](user-guide/cli/index.md) - Reference - fastagency - [FastAgency](api/fastagency/FastAgency.md) @@ -76,14 +85,14 @@ search: - [setup_logging](api/fastagency/cli/logging/setup_logging.md) - logging - [get_logger](api/fastagency/logging/get_logger.md) - - runtimes + - runtime - autogen - - [AutoGenWorkflows](api/fastagency/runtimes/autogen/AutoGenWorkflows.md) - - [IOStreamAdapter](api/fastagency/runtimes/autogen/IOStreamAdapter.md) + - [AutoGenWorkflows](api/fastagency/runtime/autogen/AutoGenWorkflows.md) + - [IOStreamAdapter](api/fastagency/runtime/autogen/IOStreamAdapter.md) - base - - [AutoGenWorkflows](api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md) - - [CurrentMessage](api/fastagency/runtimes/autogen/base/CurrentMessage.md) - - [IOStreamAdapter](api/fastagency/runtimes/autogen/base/IOStreamAdapter.md) + - [AutoGenWorkflows](api/fastagency/runtime/autogen/base/AutoGenWorkflows.md) + - [CurrentMessage](api/fastagency/runtime/autogen/base/CurrentMessage.md) + - [IOStreamAdapter](api/fastagency/runtime/autogen/base/IOStreamAdapter.md) - studio - app - [ChatRequest](api/fastagency/studio/app/ChatRequest.md) @@ -262,7 +271,7 @@ search: - send_prompt - [send_prompt_to_autogen](api/fastagency/ui/mesop/send_prompt/send_prompt_to_autogen.md) - [send_user_feedback_to_autogen](api/fastagency/ui/mesop/send_prompt/send_user_feedback_to_autogen.md) -- Contributing - - [Development](getting-started/contributing/CONTRIBUTING.md) - - [Documentation](getting-started/contributing/docs.md) +- [Contributing](contributing/index.md) + - [Development](contributing/CONTRIBUTING.md) + - [Documentation](contributing/docs.md) - [Release Notes](release.md) \ No newline at end of file diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/runtime/autogen/AutoGenWorkflows.md similarity index 69% rename from docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md rename to docs/docs/en/api/fastagency/runtime/autogen/AutoGenWorkflows.md index 01c0b718a..3f840bb1e 100644 --- a/docs/docs/en/api/fastagency/runtimes/autogen/AutoGenWorkflows.md +++ b/docs/docs/en/api/fastagency/runtime/autogen/AutoGenWorkflows.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.runtimes.autogen.AutoGenWorkflows +::: fastagency.runtime.autogen.AutoGenWorkflows diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md b/docs/docs/en/api/fastagency/runtime/autogen/IOStreamAdapter.md similarity index 69% rename from docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md rename to docs/docs/en/api/fastagency/runtime/autogen/IOStreamAdapter.md index a8ee8e0e1..cdcf8879f 100644 --- a/docs/docs/en/api/fastagency/runtimes/autogen/IOStreamAdapter.md +++ b/docs/docs/en/api/fastagency/runtime/autogen/IOStreamAdapter.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.runtimes.autogen.IOStreamAdapter +::: fastagency.runtime.autogen.IOStreamAdapter diff --git a/docs/docs/en/api/fastagency/runtime/autogen/base/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/runtime/autogen/base/AutoGenWorkflows.md new file mode 100644 index 000000000..7478687ef --- /dev/null +++ b/docs/docs/en/api/fastagency/runtime/autogen/base/AutoGenWorkflows.md @@ -0,0 +1,11 @@ +--- +# 0.5 - API +# 2 - Release +# 3 - Contributing +# 5 - Template Page +# 10 - Default +search: + boost: 0.5 +--- + +::: fastagency.runtime.autogen.base.AutoGenWorkflows diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md b/docs/docs/en/api/fastagency/runtime/autogen/base/CurrentMessage.md similarity index 67% rename from docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md rename to docs/docs/en/api/fastagency/runtime/autogen/base/CurrentMessage.md index 5864227f8..e6cc98308 100644 --- a/docs/docs/en/api/fastagency/runtimes/autogen/base/CurrentMessage.md +++ b/docs/docs/en/api/fastagency/runtime/autogen/base/CurrentMessage.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.runtimes.autogen.base.CurrentMessage +::: fastagency.runtime.autogen.base.CurrentMessage diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md b/docs/docs/en/api/fastagency/runtime/autogen/base/IOStreamAdapter.md similarity index 67% rename from docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md rename to docs/docs/en/api/fastagency/runtime/autogen/base/IOStreamAdapter.md index c7876374a..78a638152 100644 --- a/docs/docs/en/api/fastagency/runtimes/autogen/base/IOStreamAdapter.md +++ b/docs/docs/en/api/fastagency/runtime/autogen/base/IOStreamAdapter.md @@ -8,4 +8,4 @@ search: boost: 0.5 --- -::: fastagency.runtimes.autogen.base.IOStreamAdapter +::: fastagency.runtime.autogen.base.IOStreamAdapter diff --git a/docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md b/docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md deleted file mode 100644 index 481336b15..000000000 --- a/docs/docs/en/api/fastagency/runtimes/autogen/base/AutoGenWorkflows.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -# 0.5 - API -# 2 - Release -# 3 - Contributing -# 5 - Template Page -# 10 - Default -search: - boost: 0.5 ---- - -::: fastagency.runtimes.autogen.base.AutoGenWorkflows diff --git a/docs/docs/en/getting-started/contributing/CONTRIBUTING.md b/docs/docs/en/contributing/CONTRIBUTING.md similarity index 100% rename from docs/docs/en/getting-started/contributing/CONTRIBUTING.md rename to docs/docs/en/contributing/CONTRIBUTING.md diff --git a/docs/docs/en/getting-started/contributing/docs.md b/docs/docs/en/contributing/docs.md similarity index 100% rename from docs/docs/en/getting-started/contributing/docs.md rename to docs/docs/en/contributing/docs.md diff --git a/docs/docs/en/contributing/index.md b/docs/docs/en/contributing/index.md new file mode 100644 index 000000000..854139a31 --- /dev/null +++ b/docs/docs/en/contributing/index.md @@ -0,0 +1 @@ +# Contributing diff --git a/docs/docs/en/getting-started/index.md b/docs/docs/en/getting-started/index.md index a289b7a86..c3e5f4df3 100644 --- a/docs/docs/en/getting-started/index.md +++ b/docs/docs/en/getting-started/index.md @@ -73,8 +73,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleIO](../api/fastagency/core/io/console/ConsoleIO.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopIO](../api/fastagency/core/io/mesop/MesopIO.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](../api/fastagency/io/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/io/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/){target="_blank"}, to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. @@ -119,33 +119,25 @@ To get started, you need to install FastAgency. You can do this using `pip`, Pyt Depending on the interface you choose, you'll need to import different modules. These imports set up the necessary components for your application: === "Console" - ```python - {!> docs_src/tutorial/getting_started/main.py [ln:1-8] !} + ```python hl_lines="7" + {!> docs_src/getting_started/main_console.py [ln:1-8] !} ``` - For Console applications, import `ConsoleIO` to handle command-line input and output. + For Console applications, import `ConsoleUI` to handle command-line input and output. === "Mesop" - ```python - import os - - from autogen.agentchat import ConversableAgent - - from fastagency.core import Chatable - from fastagency.core.runtimes.autogen.base import AutoGenWorkflows - from fastagency.core.io.mesop import MesopIO - - from fastagency import FastAgency + ```python hl_lines="7" + {!> docs_src/getting_started/main_mesop.py [ln:1-8] !} ``` - For Mesop applications, import `MesopIO` to integrate with the Mesop web interface. + For Mesop applications, import `MesopUI` to integrate with the Mesop web interface. ### Define Workflow You need to define the workflow that your application will use. This is where you specify how the agents interact and what they do. Here's a simple example of a workflow definition: ```python -{! docs_src/tutorial/getting_started/main.py [ln:10-43] !} +{! docs_src/getting_started/main_console.py [ln:10-43] !} ``` This code snippet sets up a simple learning chat between a student and a teacher. You define the agents and how they should interact, specifying how the conversation should be summarized. @@ -155,20 +147,18 @@ This code snippet sets up a simple learning chat between a student and a teacher Next, define your FastAgency application. This ties together your workflow and the interface you chose: === "Console" - ```python - {!> docs_src/tutorial/getting_started/main.py [ln:7,46,47] !} + ```python hl_lines="1" + {!> docs_src/getting_started/main_console.py [ln:47] !} ``` - For Console applications, use `ConsoleIO` to handle user interaction via the command line. + For Console applications, use `ConsoleUI` to handle user interaction via the command line. === "Mesop" - ```python - from fastagency.core.io.mesop import MesopIO - - app = FastAgency(wf=wf, io=MesopIO()) + ```python hl_lines="1" + {!> docs_src/getting_started/main_mesop.py [ln:47] !} ``` - For Mesop applications, use `MesopIO` to enable web-based interactions. + For Mesop applications, use `MesopUI` to enable web-based interactions. ### Run Application diff --git a/docs/docs/en/user-guide/api/index.md b/docs/docs/en/user-guide/api/index.md new file mode 100644 index 000000000..637e0087f --- /dev/null +++ b/docs/docs/en/user-guide/api/index.md @@ -0,0 +1,23 @@ +# API Integration + +FastAgency makes it easy to integrate external APIs into your multi-agent workflows, allowing agents to access and interact with real-time data. By leveraging FastAgency's API support, developers can automatically create functions properly annotated for use with large language models (LLMs). This functionality allows agents to fetch and process external information seamlessly. + +Currently, FastAgency supports importing API functionality from [**OpenAPI**](https://swagger.io/specification/) specifications, enabling developers to connect their agents with RESTful APIs effortlessly. In addition, we support various types of security for accessing APIs, ensuring your integrations are both functional and secure. + +## API Features in FastAgency + +### 1. **[OpenAPI Import](./openapi/)** +FastAgency can automatically generate API functions from OpenAPI specifications, streamlining the process of connecting agents to external services. With just a few lines of code, you can import an API specification, and FastAgency will handle the function generation and LLM integration, making it simple for agents to call external APIs. + +[Learn more about OpenAPI Import →](./openapi/) + +### 2. **[API Security](./security/)** +FastAgency supports different types of security for REST APIs, including OAuth, API keys, and more. This ensures that your API integrations are secure and can handle sensitive data. Our API security mechanisms are flexible, allowing you to configure and manage secure communication between your agents and external APIs. + +[Learn more about API Security →](./security/) + +--- + +FastAgency’s API integration capabilities allow your multi-agent systems to interact with the real world in meaningful ways. Whether you’re pulling data from an external service or managing secure connections, FastAgency provides the tools you need to build powerful, connected applications. + +For more updates and discussions, join our [**Discord channel**](https://discord.gg/kJjSGWrknU). diff --git a/docs/docs/en/tutorial/external-rest-apis/index.md b/docs/docs/en/user-guide/api/openapi/index.md similarity index 97% rename from docs/docs/en/tutorial/external-rest-apis/index.md rename to docs/docs/en/user-guide/api/openapi/index.md index b37ae6a7e..602acd58a 100644 --- a/docs/docs/en/tutorial/external-rest-apis/index.md +++ b/docs/docs/en/user-guide/api/openapi/index.md @@ -1,4 +1,4 @@ -# Using External REST APIs +# OpenAPI FastAgency can automatically create functions properly annotated for use with LLM-s from [OpenAPI](https://swagger.io/specification/) specification. @@ -21,7 +21,7 @@ pip install "fastagency[autogen,openapi]" These imports are similar to the imports section we have already covered, with the only difference being the additional imports of the `OpenAPI` Client and `UserProxyAgent`: ```python -{! docs_src/tutorial/external_rest_apis/main.py [ln:1-10] !} +{! docs_src/user_guide/external_rest_apis/main.py [ln:1-10] !} ``` ## Define Workflow @@ -29,7 +29,7 @@ These imports are similar to the imports section we have already covered, with t In this workflow, the only difference is that we create a Python client for the external REST API by passing the URL of the `openapi.json` to the `Client.create` method. Then, we register the generated client with the agent using the methods `register_for_llm` and `register_for_execution`. Here's a simple example of a workflow definition: ```python -{! docs_src/tutorial/external_rest_apis/main.py [ln:12-55] !} +{! docs_src/user_guide/external_rest_apis/main.py [ln:12-55] !} ``` This code snippet sets up a simple weather agent that calls an external weather API using the registered functions generated from the `openapi.json` URL. @@ -39,7 +39,7 @@ This code snippet sets up a simple weather agent that calls an external weather Next, define your FastAgency application. ```python -{! docs_src/tutorial/external_rest_apis/main.py [ln:58] !} +{! docs_src/user_guide/external_rest_apis/main.py [ln:58] !} ``` ## Run Application @@ -47,7 +47,7 @@ Next, define your FastAgency application. You can run this chapter's FastAgency application using the following command: ```console -fastagency run docs/docs_src/tutorial/external_rest_apis/main.py +fastagency run docs/docs_src/user_guide/external_rest_apis/main.py ``` ## Output diff --git a/docs/docs/en/tutorial/external-rest-apis/security.md b/docs/docs/en/user-guide/api/security.md similarity index 97% rename from docs/docs/en/tutorial/external-rest-apis/security.md rename to docs/docs/en/user-guide/api/security.md index 6ce873177..e723ed0b1 100644 --- a/docs/docs/en/tutorial/external-rest-apis/security.md +++ b/docs/docs/en/user-guide/api/security.md @@ -1,4 +1,4 @@ -# Using External REST APIs with security +# Security In the [previous chapter](./index.md){.internal-link}, we learned how to integrate external REST APIs into `AutoGen` agents using `FastAgency`, and we used a weather API route which had no security. However, not all external REST APIs are open to the public; some are behind a paywall and require security parameters for access. This section of the documentation explains how to create an agent that accesses an external REST API with security. @@ -19,7 +19,7 @@ pip install "fastagency[autogen,openapi]" The imports are the same as in the [previous chapter](./index.md){.internal-link}, except here we also import `APIKeyHeader` to set the security value in the header: ```python hl_lines="11" -{! docs_src/tutorial/external_rest_apis/security.py [ln:1-11] !} +{! docs_src/user_guide/external_rest_apis/security.py [ln:1-11] !} ``` ## Define Workflow @@ -29,13 +29,13 @@ In this workflow, we create a Python client for the external REST API by passing Additionally, we set the API key for the API using the `set_security_params` method: ```python hl_lines="2" -{! docs_src/tutorial/external_rest_apis/security.py [ln:33.5,34.5] !} +{! docs_src/user_guide/external_rest_apis/security.py [ln:33.5,34.5] !} ``` Here's a simple example of a workflow definition: ```python hl_lines="22" -{! docs_src/tutorial/external_rest_apis/security.py [ln:13-65] !} +{! docs_src/user_guide/external_rest_apis/security.py [ln:13-65] !} ``` This code snippet sets up a simple weather agent that calls an external weather API with security, using the registered functions generated from the `openapi.json` URL. @@ -45,7 +45,7 @@ This code snippet sets up a simple weather agent that calls an external weather Next, define your FastAgency application. ```python -{! docs_src/tutorial/external_rest_apis/security.py [ln:68] !} +{! docs_src/user_guide/external_rest_apis/security.py [ln:68] !} ``` ## Run Application @@ -53,7 +53,7 @@ Next, define your FastAgency application. You can run this chapter's FastAgency application using the following command:: ```console -fastagency run docs/docs_src/tutorial/external_rest_apis/security.py +fastagency run docs/docs_src/user_guide/external_rest_apis/security.py ``` ## Output diff --git a/docs/docs/en/tutorial/index.md b/docs/docs/en/user-guide/basics.md similarity index 88% rename from docs/docs/en/tutorial/index.md rename to docs/docs/en/user-guide/basics.md index 409064113..6ec44fc87 100644 --- a/docs/docs/en/tutorial/index.md +++ b/docs/docs/en/user-guide/basics.md @@ -66,8 +66,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleIO](../api/fastagency/core/io/console/ConsoleIO.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopIO](../api/fastagency/core/io/mesop/MesopIO.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](../api/fastagency/io/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/io/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/){target="_blank"}, to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. @@ -113,10 +113,10 @@ Depending on the interface you choose, you'll need to import different modules. === "Console" ```python - {!> docs_src/tutorial/getting_started/main.py [ln:1-8] !} + {!> docs_src/getting_started/main_console.py [ln:1-8] !} ``` - For Console applications, import `ConsoleIO` to handle command-line input and output. + For Console applications, import `ConsoleUI` to handle command-line input and output. === "Mesop" ```python @@ -124,21 +124,21 @@ Depending on the interface you choose, you'll need to import different modules. from autogen.agentchat import ConversableAgent - from fastagency.core import Chatable - from fastagency.core.runtimes.autogen.base import AutoGenWorkflows - from fastagency.core.io.mesop import MesopIO + from fastagency import UI + from fastagency.runtimes.autogen.base import AutoGenWorkflows + from fastagency.ui.mesop import MesopUI from fastagency import FastAgency ``` - For Mesop applications, import `MesopIO` to integrate with the Mesop web interface. + For Mesop applications, import `MesopUI` to integrate with the Mesop web interface. ### Define Workflow You need to define the workflow that your application will use. This is where you specify how the agents interact and what they do. Here's a simple example of a workflow definition: ```python -{! docs_src/tutorial/getting_started/main.py [ln:10-43] !} +{! docs_src/getting_started/main_console.py [ln:10-43] !} ``` This code snippet sets up a simple learning chat between a student and a teacher. You define the agents and how they should interact, specifying how the conversation should be summarized. @@ -149,19 +149,19 @@ Next, define your FastAgency application. This ties together your workflow and t === "Console" ```python - {!> docs_src/tutorial/getting_started/main.py [ln:7,46,47] !} + {!> docs_src/getting_started/main_console.py [ln:7,46,47] !} ``` - For Console applications, use `ConsoleIO` to handle user interaction via the command line. + For Console applications, use `ConsoleUI` to handle user interaction via the command line. === "Mesop" ```python - from fastagency.core.io.mesop import MesopIO + from fastagency.ui.mesop import MesopUI - app = FastAgency(wf=wf, io=MesopIO()) + app = FastAgency(wf=wf, io=MesopUI()) ``` - For Mesop applications, use `MesopIO` to enable web-based interactions. + For Mesop applications, use `MesopUI` to enable web-based interactions. ### Run Application diff --git a/docs/docs/en/user-guide/cli/index.md b/docs/docs/en/user-guide/cli/index.md new file mode 100644 index 000000000..2da6c5809 --- /dev/null +++ b/docs/docs/en/user-guide/cli/index.md @@ -0,0 +1,66 @@ +# FastAgency CLI Overview + +The **FastAgency Command Line Interface (CLI)** enables developers to manage and run FastAgency projects directly from the terminal. The CLI simplifies interactions with FastAgency apps, providing options for running, testing, and managing workflows efficiently. Below is an overview of the key commands and options available in the FastAgency CLI. + +## CLI Commands + +### `dev` +```bash +$ fastagency dev [OPTIONS] [PATH] +``` +The `dev` command runs a FastAgency app in **development mode**, which is equivalent to running `fastapi` but with live reload enabled. This is useful for testing and development, as it listens on `127.0.0.1` and automatically detects the Python module or package that needs to be imported based on the file or directory path provided. + +#### Command Details: +- If no path is provided, it will try to locate the application using common file names like `main.py`, `app.py`, `api.py`, or from the `app` directory. +- It automatically detects the **FastAgency app** object to use, typically looking for an object named `app` or `api`. + +#### Common Options: +- `--app`: The name of the variable that contains the FastAgency app in the imported module. It defaults to automatic detection. +- `--workflow (-w)`: Specifies the name of the workflow to run. +- `--initial_message (-i)`: Sets the initial message sent to the workflow. + +### `run` +```bash +$ fastagency run [OPTIONS] [PATH] +``` +The `run` command starts a FastAgency app in **production mode**, similar to the `dev` command, but optimized for production environments. + +#### Common Options for `run`: +- `--app`: Specifies the name of the app variable to run, like in `dev`. +- `--workflow (-w)`: Specifies a particular workflow to run. +- `--initial_message (-i)`: Sends a custom initial message to the workflow. + +### `version` +```bash +$ fastagency version +``` +The `version` command shows the currently installed version of FastAgency. + +### Global Options +- `--version`: Displays the current version of FastAgency. +- `--install-completion`: Installs shell completion for supported shells (bash, zsh, etc.). +- `--show-completion`: Shows the shell completion script for manual installation or customization. +- `--help`: Displays detailed help information for commands. + +--- + +## Example Usage + +### Running a FastAgency App in Development Mode +```bash +fastagency dev path/to/app.py +``` + +### Running a FastAgency App with a Specific Workflow +```bash +fastagency run path/to/app.py --workflow simple_workflow +``` + +### Setting an Initial Message +```bash +fastagency run path/to/app.py --initial_message "Hello, let's start!" +``` + +--- + +For more information, visit the [FastAgency Docs](https://fastagency.ai/latest/) or join our [**Discord community**](https://discord.gg/kJjSGWrknU). diff --git a/docs/docs/en/user-guide/index.md b/docs/docs/en/user-guide/index.md new file mode 100644 index 000000000..be089530d --- /dev/null +++ b/docs/docs/en/user-guide/index.md @@ -0,0 +1,29 @@ +# Introduction to FastAgency + +**FastAgency** is an open-source framework designed to accelerate the transition from prototype to production for multi-agent AI workflows. For developers who use the AutoGen framework, FastAgency enables you to seamlessly scale Jupyter notebook prototypes into fully functional, production-ready applications. With multi-framework support, a unified programming interface, and powerful API integration capabilities, FastAgency streamlines the deployment process, saving time and effort while maintaining flexibility and performance. + +Whether you're orchestrating complex AI agents or integrating external APIs into workflows, FastAgency provides the tools necessary to quickly transition from concept to production, reducing development cycles and allowing you to focus on optimizing your multi-agent systems. + +## Key Features + +- [**Multi-Runtime Support**](runtime/): FastAgency supports multiple agentic [runtimes](runtime/) to provide maximum flexibility. Currently, it supports **AutoGen** and plans to extend support to [CrewAI](https://www.crewai.com/){target="_blank"}. This ensures that as the AI ecosystem evolves, FastAgency remains a reliable and adaptable framework, capable of leveraging emerging agentic technologies. Developers can easily switch between frameworks, choosing the best one for their project's specific needs. + +- [**Unified Programming Interface Across UIs**](ui/): FastAgency features a **common programming interface** that enables you to develop your core workflows once and reuse them across various user interfaces without rewriting code. This includes support for both **console-based applications** via `ConsoleUI` and **web-based applications** via `MesopUI`. Whether you need a command-line tool or a fully interactive web app, FastAgency allows you to deploy the same underlying workflows across environments, saving development time and ensuring consistency. + +- [**Seamless External API Integration**](api/): One of FastAgency's standout features is its ability to easily integrate external APIs into your agent workflows. With just a **single line of code**, you can import an OpenAPI specification, and in only one more line, you can connect it to your agents. This dramatically simplifies the process of enhancing AI agents with real-time data, external processing, or third-party services. For example, you can easily integrate a weather API to provide dynamic, real-time weather updates to your users, making your application more interactive and useful with minimal effort. + +- [**Tester Class for Continuous Integration**](testing/): FastAgency also provides a **Tester Class** that enables developers to write and execute tests for their multi-agent workflows. This feature is crucial for maintaining the reliability and robustness of your application, allowing you to automatically verify agent behavior and interactions. The Tester Class is designed to integrate smoothly with **continuous integration (CI)** pipelines, helping you catch bugs early and ensure that your workflows remain functional as they scale into production. + +- [**Command-Line Interface (CLI) for Orchestration**](cli/): FastAgency includes a powerful **command-line interface (CLI)** for orchestrating and managing multi-agent applications directly from the terminal. The CLI allows developers to quickly run workflows, pass parameters, and monitor agent interactions without needing a full GUI. This is especially useful for automating deployments and integrating workflows into broader DevOps pipelines, enabling developers to maintain control and flexibility in how they manage AI-driven applications. + +## Why FastAgency? + +FastAgency bridges the gap between rapid prototyping and production-ready deployment, empowering developers to bring their multi-agent systems to life quickly and efficiently. By integrating familiar frameworks like AutoGen, providing powerful API integration, and offering robust CI testing tools, FastAgency reduces the complexity and overhead typically associated with deploying AI agents in real-world applications. + +Whether you’re building interactive console tools, developing fully-featured web apps, or orchestrating large-scale multi-agent systems, FastAgency is built to help you deploy faster, more reliably, and with greater flexibility. + +## ⭐⭐⭐ Stay in touch ⭐⭐⭐ + +Stay up to date with new features and integrations by following our documentation and community updates on our [**Discord server**](https://discord.gg/kJjSGWrknU){target="_blank"}. FastAgency is continually evolving to support new frameworks, APIs, and deployment strategies, ensuring you remain at the forefront of AI-driven development. + +Last but not least, show us your support by giving a star to our [**GitHub repository**](https://github.com/airtai/fastagency/){target="_blank"}. diff --git a/docs/docs/en/user-guide/runtime/autogen/index.md b/docs/docs/en/user-guide/runtime/autogen/index.md new file mode 100644 index 000000000..01b656462 --- /dev/null +++ b/docs/docs/en/user-guide/runtime/autogen/index.md @@ -0,0 +1,89 @@ +# AutoGen in FastAgency + +The **AutoGen** runtime is a key component of FastAgency, empowering developers to create intelligent, multi-agent systems powered by large language models (LLMs). AutoGen allows agents to communicate, collaborate, and perform complex tasks autonomously while easily integrating with external APIs for real-time data and functionality. + +In this example, we will create a simple weather chatbot using **AutoGen** in FastAgency. The chatbot will enable a user to interact with a weather agent that fetches real-time weather information from an external API using OpenAPI specifications. + +## Installation + +Before getting started, make sure you have installed FastAgency with support for the AutoGen runtime by running the following command: + +```bash +pip install "fastagency[autogen]" +``` + +This installation includes the AutoGen runtime, allowing you to build multi-agent workflows and integrate external APIs seamlessly. + +## Example: Integrating a Weather API with AutoGen + +### Step-by-Step Breakdown + +#### 1. **Import Required Modules** +The example starts by importing the necessary modules from **AutoGen** and **FastAgency**. These imports lay the foundation for building and running multi-agent workflows. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:1-11] !} +``` + +#### 2. **Configure the Language Model (LLM)** +Here, the large language model is configured to use the `gpt-4o-mini` model, and the API key is retrieved from the environment. This setup ensures that both the user and weather agents can interact effectively. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:12-22] !} +``` + +#### 3. **Set Up the Weather API** +We define the OpenAPI specification URL for the weather service. This API will later be used by the weather agent to fetch real-time weather data. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:23-26] !} +``` + +#### 4. **Define the Workflow and Agents** +In this step, we create two agents: + +- **UserProxyAgent**: This agent simulates the user interacting with the system. + +- **ConversableAgent**: This agent acts as the weather agent, responsible for fetching weather data from the API. + +The workflow is registered using **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/AutoGenWorkflows/)**. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:27-45] !} +``` + +#### 5. **Register API Functions with the Agents** +In this step, we register the weather API functions to ensure that the weather agent can call the correct functions, such as `get_daily_weather` and `get_daily_weather_weekly_get`, to retrieve the required weather data. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:46-60] !} +``` + +#### 6. **Enable Agent Interaction and Chat** +Here, the user agent initiates a chat with the weather agent, which queries the API and returns the weather information. The conversation is summarized using a method provided by the LLM. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:61-69] !} +``` + +#### 7. **Create and Run the Application** +Finally, we create the FastAgency application and launch it using the console interface. + +```python +{! docs_src/user_guide/runtime/autogen/main.py [ln:71-72] !} +``` + +### Running the Application + +```bash +cd docs/docs_src/user_guide/runtime/autogen +fastagency run main.py +``` + +Ensure you have set your OpenAI API key in the environment and that the weather API URL is accessible. The command will launch a console interface where users can input their requests and interact with the weather agent. + +--- + +This example demonstrates the power of the **AutoGen** runtime within FastAgency, showing how easy it is to integrate LLM-powered agents with real-time API services. By leveraging FastAgency, developers can quickly create interactive, scalable applications that interact with external data sources in real-time. + +For more detailed documentation, visit the [AutoGen Reference](../../../../api/fastagency/runtime/autogen/AutoGenWorkflows/). diff --git a/docs/docs/en/tutorial/custom-user-interactions/index.md b/docs/docs/en/user-guide/runtime/autogen/interactions.md similarity index 68% rename from docs/docs/en/tutorial/custom-user-interactions/index.md rename to docs/docs/en/user-guide/runtime/autogen/interactions.md index f58fcb340..bf440d8a0 100644 --- a/docs/docs/en/tutorial/custom-user-interactions/index.md +++ b/docs/docs/en/user-guide/runtime/autogen/interactions.md @@ -1,6 +1,6 @@ # Custom User Interactions -In this example, we'll demonstrate how to create custom interaction with the user using [`Chatable`](../api/fastagency/core/Chatable.md) protocol and its [`process_message`](../api/fastagency/core/Chatable.md#fastagency.core.Chatable.create_subconversation) method. +In this example, we'll demonstrate how to create custom interaction with the user using [`UI`](../api/fastagency/UI.md) protocol and its [`process_message`](../api/fastagency/UI.md#fastagency.UI.create_subconversation) method. ## Install @@ -23,7 +23,7 @@ Let's define three functions which will be available to the agents: `TextInput` is suitable for free-form text messages, ideal for open-ended queries and dialogues. This function allows the student to request exam questions from the teacher and provides some suggestions using `TextInput`. ```python -{! docs_src/tutorial/custom_user_interactions/main.py [ln:52.5,53.5,54.5,55.5,56.5,57.5,58.5,59.5,60.5,61.5,62.5,63.5,64.5,66.5,67.5,68.5,69.5,70.5] !} +{! docs_src/user_guide/custom_user_interactions/main.py [ln:52.5,53.5,54.5,55.5,56.5,57.5,58.5,59.5,60.5,61.5,62.5,63.5,64.5,66.5,67.5,68.5,69.5,70.5] !} ``` ### System Info Messages @@ -31,7 +31,7 @@ Let's define three functions which will be available to the agents: `SystemMessage` is used for operational or system-related instructions, such as logging data, and is not part of the agent dialogue. This function logs the final answers after the student completes the discussion using `SystemMessage` to log the event. ```python -{! docs_src/tutorial/custom_user_interactions/main.py [ln:72.5,73.5,74.5,75.5,76.5,77.5,78.5,79.5,80.5,81.5,82.5,83.5,84.5,85.5] !} +{! docs_src/user_guide/custom_user_interactions/main.py [ln:72.5,73.5,74.5,75.5,76.5,77.5,78.5,79.5,80.5,81.5,82.5,83.5,84.5,85.5] !} ``` ### Multiple Choice @@ -39,25 +39,25 @@ Let's define three functions which will be available to the agents: `MultipleChoice` is used for structured responses where the user must select one of several predefined options. This function retrieves the final grade for the student's submitted answers using `MultipleChoice`, presenting the user with grading options. ```python -{! docs_src/tutorial/custom_user_interactions/main.py [ln:87.5,88.5,89.5,90.5,91.5,92.5,93.5,94.5,96.5,97.5,98.5,99.5] !} +{! docs_src/user_guide/custom_user_interactions/main.py [ln:87.5,88.5,89.5,90.5,91.5,92.5,93.5,94.5,96.5,97.5,98.5,99.5] !} ``` ### Other Types of Messages -All supported messages are subclasses of the [IOMessage](../api/fastagency/core/IOMessage.md) base class. +All supported messages are subclasses of the [IOMessage](../api/fastagency/IOMessage.md) base class. ## Registering the Functions We now register these functions with the workflow, linking the `student_agent` as the caller and the `teacher_agent` as the executor. ```python -{! docs_src/tutorial/custom_user_interactions/main.py [ln:101.5,102.5,103.5,104.5,105.5,106.5,107.5,108.5,109.5,110.5,111.5,112.5,113.5,114.5,115.5,116.5,117.5,118.5,119.5,120.5,121.5,122.5,123.5] !} +{! docs_src/user_guide/custom_user_interactions/main.py [ln:101.5,102.5,103.5,104.5,105.5,106.5,107.5,108.5,109.5,110.5,111.5,112.5,113.5,114.5,115.5,116.5,117.5,118.5,119.5,120.5,121.5,122.5,123.5] !} ``` ## Define FastAgency Application Finally, we'll define the entire application: ```python -{! docs_src/tutorial/custom_user_interactions/main.py!} +{! docs_src/user_guide/custom_user_interactions/main.py!} ``` ## Run Application diff --git a/docs/docs/en/user-guide/runtime/crewai/basics.md b/docs/docs/en/user-guide/runtime/crewai/basics.md new file mode 100644 index 000000000..53def3d16 --- /dev/null +++ b/docs/docs/en/user-guide/runtime/crewai/basics.md @@ -0,0 +1,9 @@ +# CrewAI in FastAgency (Coming Soon) + +The **CrewAI** runtime is an exciting upcoming feature in FastAgency, designed to expand the framework’s capabilities for building sophisticated multi-agent workflows. **CrewAI** will enable agents to collaborate in dynamic and scalable environments, allowing for more complex use cases that involve multiple agents working together to achieve shared goals. + +Stay tuned for more updates on **CrewAI** as it is integrated into FastAgency. Once released, it will provide a powerful new option for building intelligent, multi-agent applications. + +--- + +Check back soon for detailed documentation and usage examples! For real-time updates and to join the discussion, visit our [**Discord channel**](https://discord.gg/kJjSGWrknU). diff --git a/docs/docs/en/user-guide/runtime/index.md b/docs/docs/en/user-guide/runtime/index.md new file mode 100644 index 000000000..83a86305d --- /dev/null +++ b/docs/docs/en/user-guide/runtime/index.md @@ -0,0 +1,21 @@ +# Runtimes in FastAgency + +**FastAgency** is a flexible, open-source framework designed to accelerate the transition from prototype to production for multi-agent AI workflows. If you're a developer working with agentic frameworks like **AutoGen**, FastAgency provides the tools to rapidly scale your projects into fully operational applications. A key feature of FastAgency is its support for multiple runtimes, allowing developers to switch between or combine various frameworks based on project needs. With multi-framework compatibility, FastAgency ensures that your workflows are not only optimized for today’s needs but also future-proofed as new frameworks emerge. + +## [AutoGen](autogen/) +The **AutoGen** runtime is central to FastAgency’s architecture and provides a powerful foundation for multi-agent workflows. AutoGen allows developers to define workflows in Python, leveraging large language models (LLMs) such as GPT to handle communication and collaboration between agents. It enables rapid prototyping and deployment of workflows that involve tasks like decision-making, customer service, or research. + +FastAgency seamlessly integrates with AutoGen, helping you transition from development in Jupyter notebooks to fully deployed applications. Whether you're managing conversational agents or orchestrating task automation, the AutoGen runtime in FastAgency helps you streamline the path from prototype to production. + +For more information on using AutoGen within FastAgency, visit the [AutoGen section](runtime/autogen/). + +## [CrewAI (coming soon)](crewai/) +The **CrewAI** runtime is an upcoming integration designed to further expand FastAgency’s capabilities. CrewAI offers a highly modular approach, providing greater flexibility for building more complex and dynamic workflows where agents need to collaborate autonomously. Its role-based design, combined with autonomous task delegation, makes CrewAI particularly suitable for projects involving a large number of specialized agents working in tandem. + +As the AI ecosystem continues to evolve, FastAgency’s support for CrewAI ensures that your workflows remain adaptable and ready for future innovations. This planned integration allows you to harness the advanced features of CrewAI, offering more options for scaling your multi-agent applications. + +For future updates and documentation on CrewAI, please visit the [CrewAI section](crewai/). + +--- + +With support for multiple runtimes, FastAgency enables developers to easily switch between frameworks like AutoGen and CrewAI, providing unmatched flexibility when building and deploying AI workflows. Whether you are utilizing the established features of AutoGen or preparing to explore CrewAI’s advanced capabilities, FastAgency ensures that your AI solutions are future-ready and capable of evolving alongside new technologies. diff --git a/docs/docs/en/user-guide/testing/index.md b/docs/docs/en/user-guide/testing/index.md new file mode 100644 index 000000000..8a56d6197 --- /dev/null +++ b/docs/docs/en/user-guide/testing/index.md @@ -0,0 +1,17 @@ +# Testing (Coming Soon) + +FastAgency is working on introducing a comprehensive testing framework to help developers ensure the reliability and correctness of their multi-agent workflows. This upcoming feature will allow you to write and execute tests for your workflows, ensuring agents behave as expected under various scenarios. The testing tools will seamlessly integrate into your development pipeline, enabling continuous integration (CI) support and ensuring that your applications remain robust and reliable as they scale. + +### Key Features (Planned): + +- **Automated Workflow Testing**: Define tests to simulate agent interactions and verify correct behavior. + +- **CI Integration**: Easily integrate tests into your continuous integration pipelines for automated validation. + +- **Mocking External APIs**: Simulate external API responses to test how agents handle external data sources. + +Stay tuned for more updates! To get the latest news and join the discussion, visit our [**Discord channel**](https://discord.gg/kJjSGWrknU). + +--- + +Check back soon for detailed documentation and examples once the testing framework is available! diff --git a/docs/docs/en/user-guide/ui/console/basics.md b/docs/docs/en/user-guide/ui/console/basics.md new file mode 100644 index 000000000..df64ed957 --- /dev/null +++ b/docs/docs/en/user-guide/ui/console/basics.md @@ -0,0 +1,74 @@ +# Console + +**[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)** in FastAgency provides a text-based interface for interacting with multi-agent workflows directly from the command line. This interface allows developers to quickly test and prototype workflows without needing to set up a graphical or web-based interface, making it an excellent tool for early-stage development and debugging. + +Below is an example that demonstrates how to set up a simple learning conversation between a student and a teacher using **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)**. + +## Example: Student and Teacher Learning Chat + +This example demonstrates how to create a workflow where a student agent interacts with a teacher agent. The student asks questions, and the teacher provides responses, simulating a learning environment. The interaction is facilitated through the console using **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)**. + +### Step-by-Step Breakdown + +#### 1. **Import Required Modules** +We begin by importing the necessary modules from **FastAgency** and **AutoGen**. These imports provide the essential building blocks for creating agents, workflows, and integrating the ConsoleUI. + +```python +{! docs_src/getting_started/main_console.py [ln:1-8] !} +``` + +- **ConversableAgent**: This class allows the creation of agents that can engage in conversational tasks. +- **[FastAgency](../../../../api/fastagency/FastAgency/)**: The core class responsible for orchestrating workflows and connecting them with UIs. +- **[UI](../../../../api/fastagency/UI/)** and **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)**: These classes define the user interface for interaction, with ConsoleUI providing a text-based interface. +- **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows. + +#### 2. **Configure the Language Model (LLM)** +Next, we configure the language model that will power the agents. In this case, we're using **GPT-4o-mini**, and the API key is retrieved from the environment. + +```python +{! docs_src/getting_started/main_console.py [ln:9-19] !} +``` + +- **Explanation**: The configuration specifies the LLM model and API key used for powering the conversation between agents. The temperature is set to `0.0` to ensure deterministic responses from the agents, making interactions consistent and reliable. This is particularly useful for scenarios where repeatability and predictability are required, such as testing. + +#### 3. **Define the Workflow and Agents** +Here, we define a simple workflow where the **Student Agent** interacts with the **Teacher Agent**. The student asks questions, and the teacher responds as a math teacher. The workflow is registered using **AutoGenWorkflows**. + +```python +{! docs_src/getting_started/main_console.py [ln:20-44] !} +``` + +- **Agent Overview**: The **Student Agent** is configured with a system message, "You are a student willing to learn," and will initiate questions during the interaction. The **Teacher Agent**, on the other hand, is set up as a math teacher and will respond to the student's questions. +- **Workflow Registration**: The workflow is registered under the name `simple_learning`. The **ConversableAgent** class is used to represent both the student and teacher agents, allowing them to communicate with each other up to 5 turns before summarizing the conversation using the `reflection_with_llm` method. + +#### 4. **Using ConsoleUI** +Finally, we instantiate **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)** to link the workflow to a text-based console interface. This allows the user to interact with the agents via the terminal. + +```python +{! docs_src/getting_started/main_console.py [ln:47-48] !} +``` + +- **Explanation**: Here, we set up the **ConsoleUI** as the user interface for the workflow, which will allow the entire agent interaction to take place within the terminal. + +### Running the Application + +Once the workflow is set up, you can run the application using the **FastAgency CLI**. Navigate to the directory where the script is located and run the following command: + +```bash +cd docs/docs_src/getting_started +fastagency run main_console.py +``` + +This will launch the console interface, allowing you to input messages as the student and observe how the teacher agent responds. + +**Note**: Ensure that your OpenAI API key is set in the environment, as the agents rely on it to interact using GPT-4o-mini. If the API key is not correctly configured, the application may fail to retrieve LLM-powered responses. + +### Debugging Tips +If you encounter issues running the application, ensure that: +- The OpenAI API key is correctly set in your environment variables. +- All necessary packages are installed, especially the `fastagency[autogen]` dependencies. +- The API connection to GPT-4o-mini is functional and responds as expected. + +--- + +By using **[ConsoleUI](../../../../api/fastagency/ui/console/ConsoleUI/)**, developers can rapidly test and deploy multi-agent workflows in a simple, text-based environment. The flexibility of this interface makes it ideal for prototyping agent interactions before scaling them into more complex applications. You can extend this workflow or modify the agents for various use cases, such as tutoring, customer support, or information retrieval. diff --git a/docs/docs/en/user-guide/ui/fastapi/basics.md b/docs/docs/en/user-guide/ui/fastapi/basics.md new file mode 100644 index 000000000..77169abb3 --- /dev/null +++ b/docs/docs/en/user-guide/ui/fastapi/basics.md @@ -0,0 +1,17 @@ +# FastAPI (Coming Soon) + +FastAgency is expanding its capabilities with support for [**FastAPI**](https://fastapi.tiangolo.com/)! This upcoming feature will allow developers to build multi-agent applications with a powerful, fully-fledged FastAPI backend, making it even easier to integrate agents into modern web applications. + +With [**FastAPI**](https://fastapi.tiangolo.com/), you will be able to: + +- Seamlessly integrate FastAgency's agent workflows with FastAPI endpoints. + +- Create RESTful APIs that interact with multi-agent systems. + +- Build scalable, high-performance web applications powered by FastAgency agents. + +Stay tuned for more updates as this feature is being developed. To get the latest news and join the discussion, visit our [**Discord channel**](https://discord.gg/kJjSGWrknU). + +--- + +Check back soon for detailed documentation and usage examples! diff --git a/docs/docs/en/user-guide/ui/index.md b/docs/docs/en/user-guide/ui/index.md new file mode 100644 index 000000000..e867e75f2 --- /dev/null +++ b/docs/docs/en/user-guide/ui/index.md @@ -0,0 +1,26 @@ +# User Interfaces + +FastAgency provides multiple ways to interact with and manage your multi-agent workflows through various user interface (UI) options. These interfaces enable developers to interact with agents in different environments—whether it’s a simple text-based console interface for quick testing or a web-based interface for more user-friendly interaction. Each UI option is designed to suit different development needs, from early-stage prototyping to fully deployed web applications. + +Below is an overview of the supported UIs, with links to their respective pages for more detailed information. + +## Available User Interfaces + +### 1. **[ConsoleUI](./console/)** +The **ConsoleUI** provides a command-line interface for interacting with FastAgency's agent workflows. It’s an ideal choice for developers who need to quickly test and prototype workflows directly in the terminal. + +[Learn more about ConsoleUI →](./console/) + +### 2. **[MesopUI](./mesop/)** +The **MesopUI** is a web-based interface that enables users to interact with agents through a browser. This UI is designed for applications that need a more graphical and interactive experience for users. + +[Learn more about MesopUI →](./mesop/) + +### 3. **[FastAPI UI (Coming Soon)](./fastapi/)** +FastAgency will soon introduce **FastAPI UI** support, which will allow you to build multi-agent systems with a FastAPI backend. This will enable seamless integration with RESTful APIs for modern web applications. + +[Learn more about FastAPI UI (Coming Soon) →](./fastapi/) + +--- + +Each of these UI options is designed to cater to different stages of the development lifecycle, providing flexibility whether you're prototyping or deploying a production-ready application. Stay tuned for updates, and if you have any questions or want to join the community, visit our [**Discord channel**](https://discord.gg/kJjSGWrknU). diff --git a/docs/docs/en/user-guide/ui/mesop/basics.md b/docs/docs/en/user-guide/ui/mesop/basics.md new file mode 100644 index 000000000..f29f5309d --- /dev/null +++ b/docs/docs/en/user-guide/ui/mesop/basics.md @@ -0,0 +1,83 @@ +# Mesop + +**[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)** in FastAgency offers a web-based interface for interacting with multi-agent workflows. Unlike the **ConsoleUI**, which is text-based and runs in the command line, MesopUI provides a user-friendly browser interface, making it ideal for applications that need a more engaging, graphical interaction. MesopUI is perfect for building interactive web applications and enabling users to interact with agents in a more intuitive way. + +To install **FastAgency** with MesopUI support, use the following command: + +```bash +pip install "fastagency[autogen,mesop]" +``` + +This command ensures that the required dependencies for both **AutoGen** and **MesopUI** are installed. + +Below, we’ll demonstrate how to set up a basic student-teacher conversation using **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)**. + +## Example: Student and Teacher Learning Chat + +This example shows how to create a simple learning chat where a student agent interacts with a teacher agent. The student asks questions, and the teacher provides responses, simulating a learning environment. The conversation is facilitated through the web interface using **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)**. + +### Step-by-Step Breakdown + +#### 1. **Import Required Modules** +We begin by importing the necessary modules from **FastAgency** and **AutoGen**. These imports provide the essential building blocks for creating agents, workflows, and integrating MesopUI. + +```python +{! docs_src/getting_started/main_mesop.py [ln:1-8] !} +``` + +- **ConversableAgent**: This class allows the creation of agents that can engage in conversational tasks. +- **[FastAgency](../../../../api/fastagency/FastAgency/)**: The core class responsible for orchestrating workflows and connecting them with UIs. +- **[UI](../../../../api/fastagency/UI/)** and **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)**: These classes define the user interface for interaction, with **MesopUI** enabling a web-based interaction. +- **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/base/AutoGenWorkflows/)**: Manages the creation and execution of multi-agent workflows. + +#### 2. **Configure the Language Model (LLM)** +Next, we configure the language model that powers the agents. In this case, we're using **GPT-4o-mini**, and the API key is retrieved from the environment. + +```python +{! docs_src/getting_started/main_mesop.py [ln:9-19] !} +``` + +- **Explanation**: The configuration specifies the LLM model and API key used for powering the conversation between agents. The temperature is set to `0.0` to ensure deterministic responses from the agents, making interactions consistent and reliable. + +#### 3. **Define the Workflow and Agents** +Here, we define a simple workflow where the **Student Agent** interacts with the **Teacher Agent**. The student asks questions, and the teacher responds as a math teacher. The workflow is registered using **AutoGenWorkflows**. + +```python +{! docs_src/getting_started/main_mesop.py [ln:20-44] !} +``` + +- **Agent Overview**: The **Student Agent** is configured with a system message, "You are a student willing to learn," and will initiate questions during the interaction. The **Teacher Agent**, on the other hand, is set up as a math teacher and will respond to the student's questions. +- **Workflow Registration**: The workflow is registered under the name `simple_learning`. The **ConversableAgent** class is used to represent both the student and teacher agents, allowing them to communicate with each other up to 5 turns before summarizing the conversation using the `reflection_with_llm` method. + +#### 4. **Using MesopUI** +Finally, we instantiate **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)** to link the workflow to a web-based interface. This allows the user to interact with the agents through a web browser. + +```python +from fastagency.ui.mesop import MesopUI +app = FastAgency(wf=wf, ui=MesopUI()) +``` + +- **Explanation**: Here, we set up the **MesopUI** as the user interface for the workflow, which will allow the entire agent interaction to take place through a web-based platform. + +### Running the Application + +Once the workflow is set up, you can run the application using the **FastAgency CLI**. Navigate to the directory where the script is located and run the following command: + +```bash +cd docs/docs_src/getting_started +fastagency run main_mesop.py +``` + +This will launch a local web server, and you will be able to access the MesopUI interface through your browser. The web interface will display the interaction between the student and teacher agents, allowing you to input questions and see the teacher’s responses. + +**Note**: Ensure that your OpenAI API key is set in the environment, as the agents rely on it to interact using GPT-4o-mini. If the API key is not correctly configured, the application may fail to retrieve LLM-powered responses. + +### Debugging Tips +If you encounter issues running the application, ensure that: +- The OpenAI API key is correctly set in your environment variables. +- All necessary packages are installed, especially the `fastagency[autogen,mesop]` dependencies. +- The MesopUI web interface is accessible from the browser, and no firewall is blocking the connection. + +--- + +By using **[MesopUI](../../../../api/fastagency/ui/mesop/MesopUI/)**, developers can create interactive, web-based multi-agent applications with ease. This interface is ideal for building user-friendly, browser-accessible systems, enabling users to interact with agents in a more engaging and visual environment. You can extend this workflow for more complex scenarios, such as tutoring systems, customer support, or real-time information retrieval. diff --git a/docs/docs/navigation_template.txt b/docs/docs/navigation_template.txt index f0d130cf3..0509cfbd2 100644 --- a/docs/docs/navigation_template.txt +++ b/docs/docs/navigation_template.txt @@ -4,14 +4,23 @@ search: --- - Getting Started - [Getting Started](getting-started/index.md) -- Tutorial - - [Getting Started](tutorial/index.md) - - [Using External REST APIs](tutorial/external-rest-apis/index.md) - - [Using External REST APIs with security](tutorial/external-rest-apis/security.md) - - [Custom User Interactions](tutorial/custom-user-interactions/index.md) +- [User guide](user-guide/index.md) + - [Runtimes](user-guide/runtime/index.md) + - [AutoGen](user-guide/runtime/autogen/index.md) + - [User interaction](user-guide/runtime/autogen/interactions.md) + - [CrewAI](user-guide/runtime/crewai/basics.md) + - [UI](user-guide/ui/index.md) + - [Console](user-guide/ui/console/basics.md) + - [Mesop](user-guide/ui/mesop/basics.md) + - [FastAPI](user-guide/ui/fastapi/basics.md) + - [API-s](user-guide/api/index.md) + - [OpenAPI](user-guide/api/openapi/index.md) + - [Security](user-guide/api/security.md) + - [Testing](user-guide/testing/index.md) + - [CLI](user-guide/cli/index.md) - Reference {api} -- Contributing - - [Development](getting-started/contributing/CONTRIBUTING.md) - - [Documentation](getting-started/contributing/docs.md) +- [Contributing](contributing/index.md) + - [Development](contributing/CONTRIBUTING.md) + - [Documentation](contributing/docs.md) - [Release Notes](release.md) diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css index a21f44b4c..31d697044 100644 --- a/docs/docs/stylesheets/extra.css +++ b/docs/docs/stylesheets/extra.css @@ -5,16 +5,16 @@ https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/stylesheets/ :root { /* Primary color */ - --md-primary-fg-color: #E43F2B; + --md-primary-fg-color: #E43F2B; --md-primary-fg-color--light: #E43F2B; - --md-primary-fg-color--dark: #E43F2B; + --md-primary-fg-color--dark: #E43F2B; /* Accent color */ - --md-accent-fg-color: #0080FF; - --md-accent-fg-color--transparent: #0080FF1A; + --md-accent-fg-color: #164DFF; + --md-accent-fg-color--transparent: #164DFF1A; /* Text color */ - --md-typeset-color: #ffffff; + --md-typeset-color: #ffffff; } [data-md-color-scheme="default"] { @@ -22,10 +22,10 @@ https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/stylesheets/ --md-footer-bg-color: #F25C49; --md-footer-bg-color--dark: #E43F2B; - } +} [data-md-color-scheme=slate] { - --md-default-bg-color: hsla(var(--md-hue),7%,18%,1); + --md-default-bg-color: hsla(var(--md-hue), 7%, 18%, 1); /* Footer background color */ --md-footer-bg-color: #F25C49; @@ -54,10 +54,15 @@ a.internal-link::after { content: "\00A0↪"; } -.md-header__button.md-logo img, .md-header__button.md-logo svg { +.md-header__button.md-logo img, +.md-header__button.md-logo svg { height: 1.8rem; } .md-header__button.md-logo { padding: 0 .2rem; } + +.highlight .hll { + background-color: #FFF587; +} diff --git a/docs/docs_src/tutorial/__init__.py b/docs/docs_src/getting_started/__init__.py similarity index 100% rename from docs/docs_src/tutorial/__init__.py rename to docs/docs_src/getting_started/__init__.py diff --git a/docs/docs_src/tutorial/getting_started/main.py b/docs/docs_src/getting_started/main_console.py similarity index 89% rename from docs/docs_src/tutorial/getting_started/main.py rename to docs/docs_src/getting_started/main_console.py index 59615e8aa..57bcf35e6 100644 --- a/docs/docs_src/tutorial/getting_started/main.py +++ b/docs/docs_src/getting_started/main_console.py @@ -5,7 +5,7 @@ from fastagency import FastAgency from fastagency import UI from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows llm_config = { "config_list": [ @@ -21,7 +21,7 @@ @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", diff --git a/docs/docs_src/getting_started/main_mesop.py b/docs/docs_src/getting_started/main_mesop.py new file mode 100644 index 000000000..29bbac98f --- /dev/null +++ b/docs/docs_src/getting_started/main_mesop.py @@ -0,0 +1,47 @@ +import os + +from autogen.agentchat import ConversableAgent + +from fastagency import FastAgency +from fastagency import UI +from fastagency.ui.mesop import MesopUI +from fastagency.runtime.autogen.base import AutoGenWorkflows + +llm_config = { + "config_list": [ + { + "model": "gpt-4o-mini", + "api_key": os.getenv("OPENAI_API_KEY"), + } + ], + "temperature": 0.8, +} + +wf = AutoGenWorkflows() + + +@wf.register(name="simple_learning", description="Student and teacher learning chat") +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: + student_agent = ConversableAgent( + name="Student_Agent", + system_message="You are a student willing to learn.", + llm_config=llm_config, + ) + teacher_agent = ConversableAgent( + name="Teacher_Agent", + system_message="You are a math teacher.", + llm_config=llm_config, + ) + + chat_result = student_agent.initiate_chat( + teacher_agent, + message=initial_message, + summary_method="reflection_with_llm", + max_turns=5, + ) + + return chat_result.summary # type: ignore[no-any-return] + + + +app = FastAgency(wf=wf, ui=MesopUI()) diff --git a/docs/docs_src/tutorial/custom_user_interactions/__init__.py b/docs/docs_src/user_guide/__init__.py similarity index 100% rename from docs/docs_src/tutorial/custom_user_interactions/__init__.py rename to docs/docs_src/user_guide/__init__.py diff --git a/docs/docs_src/tutorial/external_rest_apis/__init__.py b/docs/docs_src/user_guide/custom_user_interactions/__init__.py similarity index 100% rename from docs/docs_src/tutorial/external_rest_apis/__init__.py rename to docs/docs_src/user_guide/custom_user_interactions/__init__.py diff --git a/docs/docs_src/tutorial/custom_user_interactions/main.py b/docs/docs_src/user_guide/custom_user_interactions/main.py similarity index 94% rename from docs/docs_src/tutorial/custom_user_interactions/main.py rename to docs/docs_src/user_guide/custom_user_interactions/main.py index 3fe160b27..f248450c1 100644 --- a/docs/docs_src/tutorial/custom_user_interactions/main.py +++ b/docs/docs_src/user_guide/custom_user_interactions/main.py @@ -8,7 +8,7 @@ from fastagency import UI from fastagency.base import MultipleChoice, SystemMessage, TextInput from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows llm_config = { "config_list": [ @@ -24,7 +24,7 @@ @wf.register(name="exam_practice", description="Student and teacher chat") # type: ignore[type-var] -def exam_learning(io: UI, initial_message: str, session_id: str) -> Optional[str]: +def exam_learning(ui: UI, initial_message: str, session_id: str) -> Optional[str]: def is_termination_msg(msg: dict[str, Any]) -> bool: return msg["content"] is not None and "TERMINATE" in msg["content"] @@ -65,7 +65,7 @@ def retrieve_exam_questions( "5) Vitruvian Man", ], ) - return io.process_message(msg) + return ui.process_message(msg) except Exception as e: return f"retrieve_exam_questions() FAILED! {e}" @@ -79,7 +79,7 @@ def write_final_answers(message: Annotated[str, "Message for examiner"]) -> str: "content": message, }, ) - io.process_message(msg) + ui.process_message(msg) return "Final answers stored." except Exception as e: return f"write_final_answers() FAILED! {e}" @@ -94,7 +94,7 @@ def get_final_grade( prompt=message, choices=["A", "B", "C", "D", "F"], ) - return io.process_message(msg) + return ui.process_message(msg) except Exception as e: return f"get_final_grade() FAILED! {e}" diff --git a/docs/docs_src/tutorial/getting_started/__init__.py b/docs/docs_src/user_guide/external_rest_apis/__init__.py similarity index 100% rename from docs/docs_src/tutorial/getting_started/__init__.py rename to docs/docs_src/user_guide/external_rest_apis/__init__.py diff --git a/docs/docs_src/tutorial/external_rest_apis/main.py b/docs/docs_src/user_guide/external_rest_apis/main.py similarity index 91% rename from docs/docs_src/tutorial/external_rest_apis/main.py rename to docs/docs_src/user_guide/external_rest_apis/main.py index 996c76423..ea88cfcc0 100644 --- a/docs/docs_src/tutorial/external_rest_apis/main.py +++ b/docs/docs_src/user_guide/external_rest_apis/main.py @@ -6,7 +6,7 @@ from fastagency import FastAgency from fastagency import UI from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency.api.openapi import OpenAPI @@ -27,7 +27,7 @@ @wf.register(name="simple_weather", description="Weather chat") -def weather_workflow(io: UI, initial_message: str, session_id: str) -> str: +def weather_workflow(ui: UI, initial_message: str, session_id: str) -> str: weather_api = OpenAPI.create(openapi_url=WEATHER_OPENAPI_URL) diff --git a/docs/docs_src/tutorial/external_rest_apis/security.py b/docs/docs_src/user_guide/external_rest_apis/security.py similarity index 93% rename from docs/docs_src/tutorial/external_rest_apis/security.py rename to docs/docs_src/user_guide/external_rest_apis/security.py index 669837c86..c2229c77c 100644 --- a/docs/docs_src/tutorial/external_rest_apis/security.py +++ b/docs/docs_src/user_guide/external_rest_apis/security.py @@ -6,7 +6,7 @@ from fastagency import FastAgency from fastagency import UI from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI from fastagency.api.openapi.security import APIKeyHeader @@ -26,7 +26,7 @@ @wf.register(name="simple_weather_with_security", description="Weather chat with security") -def weather_workflow_with_security(io: UI, initial_message: str, session_id: str) -> str: +def weather_workflow_with_security(ui: UI, initial_message: str, session_id: str) -> str: weather_client = OpenAPI.create(openapi_url=WEATHER_OPENAPI_URL) diff --git a/fastagency/runtimes/__init__.py b/docs/docs_src/user_guide/runtime/__init__.py similarity index 100% rename from fastagency/runtimes/__init__.py rename to docs/docs_src/user_guide/runtime/__init__.py diff --git a/docs/docs_src/user_guide/runtime/autogen/__init__.py b/docs/docs_src/user_guide/runtime/autogen/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/docs_src/user_guide/runtime/autogen/main.py b/docs/docs_src/user_guide/runtime/autogen/main.py new file mode 100644 index 000000000..93d008800 --- /dev/null +++ b/docs/docs_src/user_guide/runtime/autogen/main.py @@ -0,0 +1,71 @@ +import os + +from autogen import UserProxyAgent +from autogen.agentchat import ConversableAgent + +from fastagency import FastAgency +from fastagency import UI +from fastagency.ui.console import ConsoleUI +from fastagency.runtime.autogen.base import AutoGenWorkflows + +from fastagency.api.openapi import OpenAPI + + +llm_config = { + "config_list": [ + { + "model": "gpt-4o-mini", + "api_key": os.getenv("OPENAI_API_KEY"), + } + ], + "temperature": 0.0, +} + +openapi_url="https://weather.tools.fastagency.ai/openapi.json" + +weather_api = OpenAPI.create(openapi_url=openapi_url) + +wf = AutoGenWorkflows() + +@wf.register(name="simple_weather", description="Weather chat") # type: ignore[type-var] +def weather_workflow(wf: AutoGenWorkflows, ui: UI, initial_message: str, session_id: str) -> str: + + user_agent = UserProxyAgent( + name="User_Agent", + system_message="You are a user agent", + llm_config=llm_config, + human_input_mode="NEVER", + ) + weather_agent = ConversableAgent( + name="Weather_Agent", + system_message="You are a weather agent", + llm_config=llm_config, + human_input_mode="NEVER", + ) + + wf.register_api( # type: ignore[attr-defined] + api=weather_api, + callers=[user_agent], + executors=[weather_agent], + functions=[ + { + "get_daily_weather_daily_get": { + "name": "get_daily_weather", + "description": "Get the daily weather", + } + }, + "get_daily_weather_weekly_get" + ] + ) + + chat_result = user_agent.initiate_chat( + weather_agent, + message=initial_message, + summary_method="reflection_with_llm", + max_turns=3, + ) + + return chat_result.summary # type: ignore[no-any-return] + + +app = FastAgency(wf=wf, ui=ConsoleUI()) diff --git a/examples/autogen.ipynb b/examples/autogen.ipynb index 55d078d23..48e172ad0 100644 --- a/examples/autogen.ipynb +++ b/examples/autogen.ipynb @@ -13,9 +13,9 @@ "from autogen.agentchat import ConversableAgent\n", "from fixtures import openai_gpt4o_mini_llm_config\n", "\n", - "from fastagency.core import Chatable, IOMessage\n", - "from fastagency.core.io.console import ConsoleIO\n", - "from fastagency.core.runtimes.autogen import AutoGenWorkflows\n", + "from fastagency import UI, IOMessage\n", + "from fastagency.ui.console import ConsoleUI\n", + "from fastagency.runtimes.autogen import AutoGenWorkflows\n", "from fastagency.logging import get_logger" ] }, @@ -52,7 +52,7 @@ "\n", "\n", "@wf.register(name=\"simple_learning\", description=\"Student and teacher learning chat\")\n", - "def simple_workflow(io: Chatable, initial_message: str, session_id: str) -> str:\n", + "def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str:\n", " student_agent = ConversableAgent(\n", " name=\"Student_Agent\",\n", " system_message=\"You are a student willing to learn.\",\n", @@ -82,9 +82,9 @@ "source": [ "def run_workflow(name: str, initial_message: str):\n", "\n", - " io = ConsoleIO()\n", + " io = ConsoleUI()\n", "\n", - " io.process_message(\n", + " ui.process_message(\n", " IOMessage.create(\n", " sender=\"user\",\n", " recipient=\"workflow\",\n", @@ -98,7 +98,7 @@ "\n", " result = wf.run(name=name, session_id=\"session_id\", io=io.create_subconversation(), initial_message=initial_message)\n", "\n", - " io.process_message(\n", + " ui.process_message(\n", " IOMessage.create(\n", " sender=\"user\",\n", " recipient=\"workflow\",\n", @@ -453,11 +453,11 @@ "source": [ "# wf = AutoGenWorkflows()\n", "\n", - "from fastagency.core.base import MultipleChoice, SystemMessage, TextInput\n", + "from fastagency.base import MultipleChoice, SystemMessage, TextInput\n", "\n", "\n", "@wf.register(name=\"exam_practice\", description=\"Student and teacher chat\")\n", - "def exam_learning(io: Chatable, initial_message: str, session_id: str) -> str:\n", + "def exam_learning(ui: UI, initial_message: str, session_id: str) -> str:\n", "\n", " def is_termination_msg(msg: str) -> bool:\n", " return msg[\"content\"] is not None and \"TERMINATE\" in msg[\"content\"]\n", @@ -491,7 +491,7 @@ " prompt=message,\n", " suggestions=[\"1) Mona Lisa\", \"2) Innovations\", \"3) Florence at the time of Leonardo\", \"4) The Last Supper\", \"5) Vit\"],\n", " )\n", - " return io.process_message(msg)\n", + " return ui.process_message(msg)\n", " except Exception as e:\n", " logger.error(f\"retrieve_exam_questions() FAILED! {e}\")\n", " return f\"retrieve_exam_questions() FAILED! {e}\"\n", @@ -506,7 +506,7 @@ " \"content\": message,\n", " },\n", " )\n", - " io.process_message(msg)\n", + " ui.process_message(msg)\n", " return \"Final answers stored.\"\n", " except Exception as e:\n", " logger.error(f\"write_final_answers() FAILED! {e}\")\n", @@ -520,7 +520,7 @@ " prompt=message,\n", " choices=[\"A\", \"B\", \"C\", \"D\", \"F\"],\n", " )\n", - " return io.process_message(msg)\n", + " return ui.process_message(msg)\n", " except Exception as e:\n", " logger.error(f\"get_final_grade() FAILED! {e}\")\n", " return f\"get_final_grade() FAILED! {e}\"\n", diff --git a/examples/cli/main_console.py b/examples/cli/main_console.py index ee2898bef..2d8142bad 100644 --- a/examples/cli/main_console.py +++ b/examples/cli/main_console.py @@ -4,7 +4,7 @@ from fastagency import UI from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency import FastAgency @@ -22,7 +22,7 @@ wf = AutoGenWorkflows() @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", diff --git a/examples/cli/main_mesop.py b/examples/cli/main_mesop.py index 7d63eb774..6c90b2f63 100644 --- a/examples/cli/main_mesop.py +++ b/examples/cli/main_mesop.py @@ -4,7 +4,7 @@ from fastagency import UI from fastagency.ui.mesop import MesopUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency import FastAgency @@ -22,7 +22,7 @@ wf = AutoGenWorkflows() @wf.register(name="simple_learning", description="Student and teacher learning chat") -def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: student_agent = ConversableAgent( name="Student_Agent", system_message="You are a student willing to learn.", diff --git a/examples/cli/main_user_proxy.py b/examples/cli/main_user_proxy.py index b7e1f1ef8..2f8ad83f2 100644 --- a/examples/cli/main_user_proxy.py +++ b/examples/cli/main_user_proxy.py @@ -4,7 +4,7 @@ from fastagency import UI from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency.api.openapi.client import OpenAPI from fastagency.api.openapi.security import APIKeyHeader @@ -24,7 +24,7 @@ wf = AutoGenWorkflows() @wf.register(name="weatherman_workflow", description="Weatherman chat") -def simple_workflow(io: UI, initial_message: str, session_id: str) -> str: +def simple_workflow(ui: UI, initial_message: str, session_id: str) -> str: user_proxy = UserProxyAgent( name="User_Proxy", diff --git a/fastagency/__about__.py b/fastagency/__about__.py index 41523a223..b6791e5f2 100644 --- a/fastagency/__about__.py +++ b/fastagency/__about__.py @@ -1,3 +1,3 @@ """The fastest way to bring multi-agent workflows to production.""" -__version__ = "0.0.1" +__version__ = "0.1.0b0" diff --git a/fastagency/app.py b/fastagency/app.py index 7523ead33..5e892d2fb 100644 --- a/fastagency/app.py +++ b/fastagency/app.py @@ -13,7 +13,7 @@ def __init__(self, wf: Workflows, ui: UI) -> None: Args: wf (Workflows): The workflows object to use - ui (Chatable): The UI object to use + ui (UI): The UI object to use """ self._wf = wf self._ui = ui diff --git a/fastagency/base.py b/fastagency/base.py index c530addbd..9574f898e 100644 --- a/fastagency/base.py +++ b/fastagency/base.py @@ -264,7 +264,7 @@ def run_workflow( Args: wf (Workflows): The workflows object to use. - ui (Chatable): The UI object to use. + ui (UI): The UI object to use. name (Optional[str]): The name of the workflow to run. If not provided, the default workflow will be run. initial_message (Optional[str], optional): The initial message to send to the workflow. If not provided, a default message will be sent. Defaults to None. """ diff --git a/fastagency/runtime/__init__.py b/fastagency/runtime/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/fastagency/runtimes/autogen/__init__.py b/fastagency/runtime/autogen/__init__.py similarity index 100% rename from fastagency/runtimes/autogen/__init__.py rename to fastagency/runtime/autogen/__init__.py diff --git a/fastagency/runtimes/autogen/base.py b/fastagency/runtime/autogen/base.py similarity index 99% rename from fastagency/runtimes/autogen/base.py rename to fastagency/runtime/autogen/base.py index 0cd1f7604..9a7225277 100644 --- a/fastagency/runtimes/autogen/base.py +++ b/fastagency/runtime/autogen/base.py @@ -183,7 +183,7 @@ def __init__(self, ui: UI) -> None: self.messages: list[IOMessage] = [] if not isinstance(self.ui, UI): - raise ValueError("The ui object must be an instance of Chatable.") + raise ValueError("The ui object must be an instance of UI.") def _process_message_chunk(self, chunk: str) -> bool: if self.current_message.process_chunk(chunk): diff --git a/fastagency/ui/console/base.py b/fastagency/ui/console/base.py index e4b0e2c9c..462a2102e 100644 --- a/fastagency/ui/console/base.py +++ b/fastagency/ui/console/base.py @@ -34,7 +34,7 @@ def __init__(self, super_conversation: Optional["ConsoleUI"] = None) -> None: """Initialize the console UI object. Args: - super_conversation (Optional[Chatable], optional): The super conversation. Defaults to None. + super_conversation (Optional[UI], optional): The super conversation. Defaults to None. """ self.super_conversation: Optional[ConsoleUI] = super_conversation self.sub_conversations: list[ConsoleUI] = [] diff --git a/tests/cli/test_discover.py b/tests/cli/test_discover.py index abbb7e4d8..7fc8541d3 100644 --- a/tests/cli/test_discover.py +++ b/tests/cli/test_discover.py @@ -17,7 +17,7 @@ def import_fixture() -> Generator[dict[str, Any], None, None]: # Create a temporary file for testing file_content = """ from fastagency.ui.console import ConsoleUI -from fastagency.runtimes.autogen.base import AutoGenWorkflows +from fastagency.runtime.autogen.base import AutoGenWorkflows from fastagency import FastAgency wf = AutoGenWorkflows() diff --git a/tests/docs_src/external_rest_apis/test_with_security.py b/tests/docs_src/external_rest_apis/test_with_security.py index c91e5506a..2656571bd 100644 --- a/tests/docs_src/external_rest_apis/test_with_security.py +++ b/tests/docs_src/external_rest_apis/test_with_security.py @@ -14,7 +14,7 @@ def test_cli_with_security(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr("builtins.input", InputMock([INPUT_MESSAGE])) result = runner.invoke( - app, ["run", "docs/docs_src/tutorial/external_rest_apis/security.py"] + app, ["run", "docs/docs_src/user_guide/external_rest_apis/security.py"] ) assert INPUT_MESSAGE in result.stdout assert "get_hourly_weather_hourly_get" in result.stdout diff --git a/tests/docs_src/external_rest_apis/test_without_security.py b/tests/docs_src/external_rest_apis/test_without_security.py index f2292d9e8..717fc49bb 100644 --- a/tests/docs_src/external_rest_apis/test_without_security.py +++ b/tests/docs_src/external_rest_apis/test_without_security.py @@ -14,7 +14,7 @@ def test_cli_without_security(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr("builtins.input", InputMock([INPUT_MESSAGE])) result = runner.invoke( - app, ["run", "docs/docs_src/tutorial/external_rest_apis/main.py"] + app, ["run", "docs/docs_src/user_guide/external_rest_apis/main.py"] ) assert INPUT_MESSAGE in result.stdout assert "get_daily_weather_daily_get" in result.stdout diff --git a/tests/examples/__init__.py b/tests/examples/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_autogen.py b/tests/test_autogen.py index 0ebec20c4..648482330 100644 --- a/tests/test_autogen.py +++ b/tests/test_autogen.py @@ -4,8 +4,8 @@ from autogen.agentchat import ConversableAgent, UserProxyAgent from fastagency import UI, IOMessage -from fastagency.runtimes.autogen import AutoGenWorkflows -from fastagency.runtimes.autogen.base import _findall, _match +from fastagency.runtime.autogen import AutoGenWorkflows +from fastagency.runtime.autogen.base import _findall, _match from fastagency.ui.console import ConsoleUI from tests.conftest import InputMock diff --git a/tests/ui/console/test_base.py b/tests/ui/console/test_base.py index 0ebab2f5c..acc92ce1a 100644 --- a/tests/ui/console/test_base.py +++ b/tests/ui/console/test_base.py @@ -3,7 +3,7 @@ import pytest from fastagency.app import FastAgency -from fastagency.runtimes.autogen import AutoGenWorkflows +from fastagency.runtime.autogen import AutoGenWorkflows from fastagency.ui.console import ConsoleUI From 9dcf941043498abe9c28a67152c88ea10d696b6e Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Fri, 13 Sep 2024 00:21:36 +0530 Subject: [PATCH 6/8] Add immutable after creation metadata to schema (#184) --- fastagency/studio/models/deployments/deployment.py | 11 ++++++++++- tests/studio/models/deployments/test_deployment.py | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/fastagency/studio/models/deployments/deployment.py b/fastagency/studio/models/deployments/deployment.py index 7b64a0793..98b6e552b 100644 --- a/fastagency/studio/models/deployments/deployment.py +++ b/fastagency/studio/models/deployments/deployment.py @@ -34,7 +34,13 @@ class Deployment(Model): ] repo_name: Annotated[ - str, Field(..., description="The name of the GitHub repository.", min_length=1) + str, + Field( + ..., + description="The name of the GitHub repository.", + min_length=1, + json_schema_extra={"metadata": {"immutable_after_creation": True}}, + ), ] fly_app_name: Annotated[ @@ -44,6 +50,7 @@ class Deployment(Model): description="The name of the Fly.io application.", min_length=1, max_length=30, + json_schema_extra={"metadata": {"immutable_after_creation": True}}, ), ] @@ -59,6 +66,7 @@ class Deployment(Model): Field( title="GH Token", description="The GitHub token to use for creating a new repository", + json_schema_extra={"metadata": {"immutable_after_creation": True}}, ), ] fly_token: Annotated[ @@ -66,6 +74,7 @@ class Deployment(Model): Field( title="Fly Token", description="The Fly.io token to use for deploying the deployment", + json_schema_extra={"metadata": {"immutable_after_creation": True}}, ), ] diff --git a/tests/studio/models/deployments/test_deployment.py b/tests/studio/models/deployments/test_deployment.py index c3fbc21a0..34acfc4d1 100644 --- a/tests/studio/models/deployments/test_deployment.py +++ b/tests/studio/models/deployments/test_deployment.py @@ -148,6 +148,7 @@ def test_deployment_model_schema(self, pydantic_version: float) -> None: }, "repo_name": { "description": "The name of the GitHub repository.", + "metadata": {"immutable_after_creation": True}, "minLength": 1, "title": "Repo Name", "type": "string", @@ -155,6 +156,7 @@ def test_deployment_model_schema(self, pydantic_version: float) -> None: "fly_app_name": { "description": "The name of the Fly.io application.", "maxLength": 30, + "metadata": {"immutable_after_creation": True}, "minLength": 1, "title": "Fly App Name", "type": "string", @@ -167,11 +169,13 @@ def test_deployment_model_schema(self, pydantic_version: float) -> None: "gh_token": { "$ref": "#/$defs/GitHubTokenRef", "description": "The GitHub token to use for creating a new repository", + "metadata": {"immutable_after_creation": True}, "title": "GH Token", }, "fly_token": { "$ref": "#/$defs/FlyTokenRef", "description": "The Fly.io token to use for deploying the deployment", + "metadata": {"immutable_after_creation": True}, "title": "Fly Token", }, }, From 27c0beb9146464b0f8710699ce7abdcfaabd83f9 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 12 Sep 2024 21:24:29 +0200 Subject: [PATCH 7/8] fix broken links (#196) --- README.md | 4 ++-- docs/docs/en/getting-started/index.md | 4 ++-- docs/docs/en/user-guide/api/openapi/index.md | 2 +- docs/docs/en/user-guide/basics.md | 4 ++-- docs/docs/en/user-guide/runtime/autogen/index.md | 2 +- .../en/user-guide/runtime/autogen/interactions.md | 4 ++-- docs/docs/en/user-guide/runtime/index.md | 6 +++--- docs/docs/en/user-guide/ui/index.md | 12 ++++++------ 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 87872c8c8..12e534138 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleUI](https://fastagency.ai/latest/api/fastagency/io/console/ConsoleUI/) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/) with [MesopUI](https://fastagency.ai/latest/api/fastagency/io/mesop/MesopUI/) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](https://fastagency.ai/latest/api/fastagency/ui/console/ConsoleUI/) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/) with [MesopUI](https://fastagency.ai/latest/api/fastagency/ui/mesop/MesopUI/) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/), to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. diff --git a/docs/docs/en/getting-started/index.md b/docs/docs/en/getting-started/index.md index c3e5f4df3..45b9a0da3 100644 --- a/docs/docs/en/getting-started/index.md +++ b/docs/docs/en/getting-started/index.md @@ -73,8 +73,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleUI](../api/fastagency/io/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/io/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](../api/fastagency/ui/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/ui/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/){target="_blank"}, to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. diff --git a/docs/docs/en/user-guide/api/openapi/index.md b/docs/docs/en/user-guide/api/openapi/index.md index 602acd58a..0751a9567 100644 --- a/docs/docs/en/user-guide/api/openapi/index.md +++ b/docs/docs/en/user-guide/api/openapi/index.md @@ -7,7 +7,7 @@ This example demonstrates how to integrate external REST API calls into `AutoGen In this example, we'll use a simple [weather API](https://weather.tools.fastagency.ai/docs){target="_blank"} and its specification available at [https://weather.tools.fastagency.ai/openapi.json](https://weather.tools.fastagency.ai/openapi.json){target="_blank"}. !!! note - The [weather API](https://weather.tools.fastagency.ai/docs){target="_blank"} has two routes: one for the daily weather forecast, which has no security, and another for the hourly forecast, which is secured. We will learn how to access external APIs that are secured in the [next chapter](./security.md){.internal-link}. + The [weather API](https://weather.tools.fastagency.ai/docs){target="_blank"} has two routes: one for the daily weather forecast, which has no security, and another for the hourly forecast, which is secured. We will learn how to access external APIs that are secured in the [next chapter](../security.md){.internal-link}. ## Install diff --git a/docs/docs/en/user-guide/basics.md b/docs/docs/en/user-guide/basics.md index 6ec44fc87..2fe90588b 100644 --- a/docs/docs/en/user-guide/basics.md +++ b/docs/docs/en/user-guide/basics.md @@ -66,8 +66,8 @@ With FastAgency, you can create interactive applications using various interface FastAgency currently supports workflows defined using AutoGen and provides options for different types of applications: -- **Console**: Use the [ConsoleUI](../api/fastagency/io/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. -- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/io/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. +- **Console**: Use the [ConsoleUI](../api/fastagency/ui/console/ConsoleUI.md) interface for command-line based interaction. This is ideal for developing and testing workflows in a text-based environment. +- **Mesop**: Utilize [Mesop](https://google.github.io/mesop/){target="_blank"} with [MesopUI](../api/fastagency/ui/mesop/MesopUI.md) for web-based applications. This interface is suitable for creating web applications with a user-friendly interface. We are also working on adding support for other frameworks, such as [CrewAI](https://www.crewai.com/){target="_blank"}, to broaden the scope and capabilities of FastAgency. Stay tuned for updates on these integrations. diff --git a/docs/docs/en/user-guide/runtime/autogen/index.md b/docs/docs/en/user-guide/runtime/autogen/index.md index 01b656462..8b4d3c250 100644 --- a/docs/docs/en/user-guide/runtime/autogen/index.md +++ b/docs/docs/en/user-guide/runtime/autogen/index.md @@ -46,7 +46,7 @@ In this step, we create two agents: - **ConversableAgent**: This agent acts as the weather agent, responsible for fetching weather data from the API. -The workflow is registered using **[AutoGenWorkflows](../../../../api/fastagency/runtime/autogen/AutoGenWorkflows/)**. +The workflow is registered using **[AutoGenWorkflows](../../../api/fastagency/runtime/autogen/AutoGenWorkflows/)**. ```python {! docs_src/user_guide/runtime/autogen/main.py [ln:27-45] !} diff --git a/docs/docs/en/user-guide/runtime/autogen/interactions.md b/docs/docs/en/user-guide/runtime/autogen/interactions.md index bf440d8a0..701a29666 100644 --- a/docs/docs/en/user-guide/runtime/autogen/interactions.md +++ b/docs/docs/en/user-guide/runtime/autogen/interactions.md @@ -1,6 +1,6 @@ # Custom User Interactions -In this example, we'll demonstrate how to create custom interaction with the user using [`UI`](../api/fastagency/UI.md) protocol and its [`process_message`](../api/fastagency/UI.md#fastagency.UI.create_subconversation) method. +In this example, we'll demonstrate how to create custom interaction with the user using [`UI`](../../../../api/fastagency/UI/) protocol and its [`process_message`](../../../../api/fastagency/UI/#fastagency.UI.create_subconversation) method. ## Install @@ -44,7 +44,7 @@ Let's define three functions which will be available to the agents: ### Other Types of Messages -All supported messages are subclasses of the [IOMessage](../api/fastagency/IOMessage.md) base class. +All supported messages are subclasses of the [IOMessage](../../../../api/fastagency/IOMessage/) base class. ## Registering the Functions We now register these functions with the workflow, linking the `student_agent` as the caller and the `teacher_agent` as the executor. diff --git a/docs/docs/en/user-guide/runtime/index.md b/docs/docs/en/user-guide/runtime/index.md index 83a86305d..4254d16b4 100644 --- a/docs/docs/en/user-guide/runtime/index.md +++ b/docs/docs/en/user-guide/runtime/index.md @@ -7,14 +7,14 @@ The **AutoGen** runtime is central to FastAgency’s architecture and provides a FastAgency seamlessly integrates with AutoGen, helping you transition from development in Jupyter notebooks to fully deployed applications. Whether you're managing conversational agents or orchestrating task automation, the AutoGen runtime in FastAgency helps you streamline the path from prototype to production. -For more information on using AutoGen within FastAgency, visit the [AutoGen section](runtime/autogen/). +For more information on using AutoGen within FastAgency, visit the [AutoGen section](autogen/). -## [CrewAI (coming soon)](crewai/) +## [CrewAI (coming soon)](crewai/basics/) The **CrewAI** runtime is an upcoming integration designed to further expand FastAgency’s capabilities. CrewAI offers a highly modular approach, providing greater flexibility for building more complex and dynamic workflows where agents need to collaborate autonomously. Its role-based design, combined with autonomous task delegation, makes CrewAI particularly suitable for projects involving a large number of specialized agents working in tandem. As the AI ecosystem continues to evolve, FastAgency’s support for CrewAI ensures that your workflows remain adaptable and ready for future innovations. This planned integration allows you to harness the advanced features of CrewAI, offering more options for scaling your multi-agent applications. -For future updates and documentation on CrewAI, please visit the [CrewAI section](crewai/). +For future updates and documentation on CrewAI, please visit the [CrewAI section](crewai/basics/). --- diff --git a/docs/docs/en/user-guide/ui/index.md b/docs/docs/en/user-guide/ui/index.md index e867e75f2..4a3380a5a 100644 --- a/docs/docs/en/user-guide/ui/index.md +++ b/docs/docs/en/user-guide/ui/index.md @@ -6,20 +6,20 @@ Below is an overview of the supported UIs, with links to their respective pages ## Available User Interfaces -### 1. **[ConsoleUI](./console/)** +### 1. **[ConsoleUI](./console/basics/)** The **ConsoleUI** provides a command-line interface for interacting with FastAgency's agent workflows. It’s an ideal choice for developers who need to quickly test and prototype workflows directly in the terminal. -[Learn more about ConsoleUI →](./console/) +[Learn more about ConsoleUI →](./console/basics/) -### 2. **[MesopUI](./mesop/)** +### 2. **[MesopUI](./mesop/basics/)** The **MesopUI** is a web-based interface that enables users to interact with agents through a browser. This UI is designed for applications that need a more graphical and interactive experience for users. -[Learn more about MesopUI →](./mesop/) +[Learn more about MesopUI →](./mesop/basics/basics/) -### 3. **[FastAPI UI (Coming Soon)](./fastapi/)** +### 3. **[FastAPI UI (Coming Soon)](./fastapi/basics/)** FastAgency will soon introduce **FastAPI UI** support, which will allow you to build multi-agent systems with a FastAPI backend. This will enable seamless integration with RESTful APIs for modern web applications. -[Learn more about FastAPI UI (Coming Soon) →](./fastapi/) +[Learn more about FastAPI UI (Coming Soon) →](./fastapi/basics/) --- From 8aaba85a0a853797f07df140b755f57a393dcc31 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 12 Sep 2024 21:38:39 +0200 Subject: [PATCH 8/8] fix broken links (#197) --- docs/docs/en/user-guide/runtime/autogen/index.md | 2 +- docs/docs/en/user-guide/ui/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/en/user-guide/runtime/autogen/index.md b/docs/docs/en/user-guide/runtime/autogen/index.md index 8b4d3c250..4e859ff6c 100644 --- a/docs/docs/en/user-guide/runtime/autogen/index.md +++ b/docs/docs/en/user-guide/runtime/autogen/index.md @@ -86,4 +86,4 @@ Ensure you have set your OpenAI API key in the environment and that the weather This example demonstrates the power of the **AutoGen** runtime within FastAgency, showing how easy it is to integrate LLM-powered agents with real-time API services. By leveraging FastAgency, developers can quickly create interactive, scalable applications that interact with external data sources in real-time. -For more detailed documentation, visit the [AutoGen Reference](../../../../api/fastagency/runtime/autogen/AutoGenWorkflows/). +For more detailed documentation, visit the [AutoGen Reference](../../../api/fastagency/runtime/autogen/AutoGenWorkflows/). diff --git a/docs/docs/en/user-guide/ui/index.md b/docs/docs/en/user-guide/ui/index.md index 4a3380a5a..183513fb6 100644 --- a/docs/docs/en/user-guide/ui/index.md +++ b/docs/docs/en/user-guide/ui/index.md @@ -14,7 +14,7 @@ The **ConsoleUI** provides a command-line interface for interacting with FastAge ### 2. **[MesopUI](./mesop/basics/)** The **MesopUI** is a web-based interface that enables users to interact with agents through a browser. This UI is designed for applications that need a more graphical and interactive experience for users. -[Learn more about MesopUI →](./mesop/basics/basics/) +[Learn more about MesopUI →](./mesop/basics/) ### 3. **[FastAPI UI (Coming Soon)](./fastapi/basics/)** FastAgency will soon introduce **FastAPI UI** support, which will allow you to build multi-agent systems with a FastAPI backend. This will enable seamless integration with RESTful APIs for modern web applications.