Skip to content

Commit

Permalink
reorganizing repository for new incoming work-in-the-open (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrabach authored Sep 30, 2024
1 parent a5769f5 commit ce4161f
Show file tree
Hide file tree
Showing 462 changed files with 1,367 additions and 218 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/POST_SETUP_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ See the [README](../README.md) for more details on how to use the Semantic Workb
### Next steps:

- Launch an example assistant service:
- Using the [canonical assistant](../semantic-workbench/v1/service/semantic-workbench-assistant/README.md)
- Using the [canonical assistant](../libraries/python/semantic-workbench-assistant/README.md)
- Use VS Code > `Run and Debug` (Ctrl/Cmd+Shift+D) > `canonical-assistant` to start the canonical assistant
- Using an [example assistant](../examples/)
- Use VS Code > `Run and Debug` (Ctrl/Cmd+Shift+D) > `launch assistant (examples/python-01-echo-bot)` to start the example assistant
- Use VS Code > `Run and Debug` (Ctrl/Cmd+Shift+D) > `launch assistant (examples/python/python-01-echo-bot)` to start the example assistant
- Or create your own assistant service by following the [Assistant Development Guide](../docs/ASSISTANT_DEVELOPMENT_GUIDE.md)
- Add the assistant to the workbench app by clicking the `Add Assistant` button in the app and selecting the assistant from the list
- Configure the assistant and interact with it in the app by clicking on the assistant in the list
Expand All @@ -34,7 +34,7 @@ See the [README](../README.md) for more details on how to use the Semantic Workb

We have included an example Python assistant service that echos the user's input and can serve as a starting point for your own assistant service.

See the [python-01-echo-bot/README](../examples/python-01-echo-bot/README.md) for more details.
See the [python-01-echo-bot/README](../examples/python/python-01-echo-bot/README.md) for more details.

## Deleting a Codespace

Expand Down
10 changes: 6 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,17 @@
// "otherPortsAttributes": {},
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": {
// Build and restore dependencies for key projects in the repo
"make": "make -C /workspaces/semanticworkbench",
// Set up git to automatically set up the remote when pushing if it doesn't exist
"git_config": "git config --add push.autoSetupRemote true"
"git_config": "git config --add push.autoSetupRemote true",
// Build and restore dependencies for key projects in the repo
"make": "make -C /workspaces/semanticworkbench"
},
// Configure tool-specific properties.
"customizations": {
"codespaces": {
"openFiles": ["/workspaces/semanticworkbench/.devcontainer/POST_SETUP_README.md"]
"openFiles": [
"/workspaces/semanticworkbench/.devcontainer/POST_SETUP_README.md"
]
},
"vscode": {
"extensions": [
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/semantic-workbench-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
paths:
[
".github/workflows/semantic-workbench-service.yml",
"semantic-workbench/v1/service/semantic-workbench-service/**",
"workbench-service/**",
]

push:
branches: ["main"]
paths:
[
".github/workflows/semantic-workbench-service.yml",
"semantic-workbench/v1/service/semantic-workbench-service/**",
"workbench-service/**",
]

workflow_dispatch:

defaults:
run:
working-directory: semantic-workbench/v1/service/semantic-workbench-service
working-directory: workbench-service

jobs:
test:
Expand Down
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "node",
"request": "launch",
"name": "app: semantic-workbench-app",
"cwd": "${workspaceFolder}/semantic-workbench/v1/app",
"cwd": "${workspaceFolder}/workbench-app",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"runtimeExecutable": "npm",
Expand All @@ -24,7 +24,7 @@
"type": "debugpy",
"request": "launch",
"name": "service: semantic-workbench-service",
"cwd": "${workspaceFolder}/semantic-workbench/v1/service",
"cwd": "${workspaceFolder}/workbench-service",
"module": "semantic_workbench_service.start",
"justMyCode": false,
"consoleTitle": "semantic-workbench-service",
Expand All @@ -34,7 +34,7 @@
"type": "debugpy",
"request": "launch",
"name": "canonical-assistant",
"cwd": "${workspaceFolder}/semantic-workbench/v1/service",
"cwd": "${workspaceFolder}/libraries/semantic-workbench-assistant",
"module": "semantic_workbench_assistant.start",
"args": ["semantic_workbench_assistant.canonical:app", "--port", "3002"],
"consoleTitle": "canonical-assistant"
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"python.analysis.fixAll": ["source.unusedImports"],
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.typeCheckingMode": "basic",
"python.defaultInterpreterPath": "${workspaceFolder}/semantic-workbench/v1/service/.venv",
"python.defaultInterpreterPath": "${workspaceFolder}/workbench-service/.venv",
"python.languageServer": "Pylance",
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder:v1}/service",
"python.testing.cwd": "${workspaceFolder:v1}/workbench-service",
"python.testing.pytestArgs": [],
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
Expand Down
9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Before filing a new issue, please search the list of issues to make sure it does
not already exist.

If you do find an existing issue for what you wanted to report, please include
your own feedback in the discussion. Do consider upvoting (👍 reaction) the original
your own feedback in the discussion. Do consider up-voting (👍 reaction) the original
post, as this helps us prioritize popular issues in our backlog.

### Writing a Good Bug Report
Expand Down Expand Up @@ -87,9 +87,9 @@ We use and recommend the following workflow:
You can request that the issue be assigned to you. Note: The issue filer and
the implementer don't have to be the same person.
2. Create a personal fork of the repository on GitHub (if you don't already have one).
3. In your fork, create a branch off of main (`git checkout -b mybranch`).
3. In your fork, create a branch off of main (`git checkout -b my_branch`).
- Name the branch so that it clearly communicates your intentions, such as
"issue-123" or "githubhandle-issue".
"issue-123" or "github_handle-issue".
4. Make and commit your changes to your branch.
5. Add new tests corresponding to your change, if applicable.
6. Run the build and tests as described in the readme for the part(s) of the Semantic Workbench your changes impact to ensure that your build is clean and all tests are passing.
Expand All @@ -99,11 +99,10 @@ We use and recommend the following workflow:
8. Wait for feedback or approval of your changes from the code maintainers.
9. When area owners have signed off, and all checks are green, your PR will be merged.


### Adding Assistants

We appreciate your interest in extending Semantic Workbench's functionality through
providing assistants in the main repo. However, we want to clarify our approach to
providing assistants in the main repo. However, we want to clarify our approach to
our GitHub repository. To maintain a clean and manageable codebase we will not be
hosting assistants directly in the Semantic Workbench GitHub repository.
Instead, we encourage contributors to host their assistants in separate
Expand Down
2 changes: 1 addition & 1 deletion KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Semantic Workbench Known Issues

You may encounter the following known issues, which may include workarounds, mitigations, or expected resolution timeframes.
You may encounter the following known issues, which may include workarounds, mitigation's, or expected resolution time-frames.

## Semantic Workbench App

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repo_root = $(shell git rev-parse --show-toplevel)
include $(repo_root)/build-tools/makefiles/recursive.mk
include $(repo_root)/tools/makefiles/recursive.mk
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ or more assistants, configuring settings, and exposing various behaviors.

The Semantic Workbench is composed of three main components:

- [Workbench Service](semantic-workbench/v1/service/README.md) (Python): The backend service that
- [Workbench Service](workbench-service/README.md) (Python): The backend service that
handles core functionalities.
- [Workbench App](semantic-workbench/v1/app/README.md) (React/Typescript): The frontend web user
- [Workbench App](workbench-app/README.md) (React/Typescript): The frontend web user
interface for interacting with workbench and assistants.
- [Assistant Services](examples) (Python, C#, etc.): any number of assistant services that implement the service protocols/APIs,
developed using any framework and programming language of your choice.
Expand All @@ -30,9 +30,9 @@ See the [GitHub Codespaces / devcontainer README](.devcontainer/README.md) for m
# Quick start - Local development environment

- Configure your dev environment, [setup guide](docs/SETUP_DEV_ENVIRONMENT.md).
- Start the backend service, see [here for instructions](semantic-workbench/v1/service/README.md).
- Start the frontend app, see [here for instructions](semantic-workbench/v1/app/README.md).
- Start the [Python chatbot example](examples/python-03-simple-chatbot/README.md), or one of the other [examples](examples).
- Start the backend service, see [here for instructions](workbench-service/README.md).
- Start the frontend app, see [here for instructions](workbench-app/README.md).
- Start the [Python chatbot example](examples/python/python-03-simple-chatbot/README.md), or one of the other [examples](examples).

![image](https://raw.githubusercontent.com/microsoft/semanticworkbench/main/docs/images/readme1.png)

Expand All @@ -46,16 +46,16 @@ To develop new assistants and connect existing ones, see the [Assistant Developm

The repository contains a few examples that can be used to create custom assistants:

- [Python Canonical Assistant](semantic-workbench/v1/service/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py)
- [Python example 1](examples/python-01-echo-bot/README.md): a simple assistant echoing text back.
- [Python example 2](examples/python-02-simple-chatbot/README.md): a simple chatbot implementing metaprompt guardrails and content moderation.
- [Python example 3](examples/python-03-simple-chatbot/README.md): a functional chatbot implementing metaprompt guardrails and content moderation.
- [.NET example 1](examples/dotnet-01-echo-bot/README.md): a simple agent with echo and support for a basic `/say` command.
- [.NET example 2](examples/dotnet-02-message-types-demo/README.md): a simple assistants showcasing Azure AI Content Safety integration and some workbench features like Mermaid graphs.
- [.NET example 3](examples/dotnet-03-simple-chatbot/README.md): a functional chatbot implementing metaprompt guardrails and content moderation.
- [Python Canonical Assistant](libraries/python/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py)
- [Python example 1](examples/python/python-01-echo-bot/README.md): a simple assistant echoing text back.
- [Python example 2](examples/python/python-02-simple-chatbot/README.md): a simple chatbot implementing metaprompt guardrails and content moderation.
- [Python example 3](examples/python/python-03-simple-chatbot/README.md): a functional chatbot implementing metaprompt guardrails and content moderation.
- [.NET example 1](examples/dotnet/dotnet-01-echo-bot/README.md): a simple agent with echo and support for a basic `/say` command.
- [.NET example 2](examples/dotnet/dotnet-02-message-types-demo/README.md): a simple assistants showcasing Azure AI Content Safety integration and some workbench features like Mermaid graphs.
- [.NET example 3](examples/dotnet/dotnet-03-simple-chatbot/README.md): a functional chatbot implementing metaprompt guardrails and content moderation.

![Mermaid graph example](examples/dotnet-02-message-types-demo/docs/mermaid.png)
![ABC music example](examples/dotnet-02-message-types-demo/docs/abc.png)
![Mermaid graph example](examples/dotnet/dotnet-02-message-types-demo/docs/mermaid.png)
![ABC music example](examples/dotnet/dotnet-02-message-types-demo/docs/abc.png)

## Open the Workbench and create an assistant instance

Expand All @@ -82,13 +82,13 @@ Expected: You get a response from your assistant!

## Refreshing Dev Environment

- [v1\service\.data](service.data) delete this directory or specific files if you know which one.
- Delete `~/workbench-service/.data` or specific files if you know which one(s).
- From repo root, run `make clean install`.
- This will perform a `git clean` and run installs in all sub-directories
- Or a faster option if you just want to install semantic workbench related stuff:
- From repo root, run `make clean`
- From `~/semantic-workbench/v1/app`, run `make install`
- From `~/semantic-workbench/v1/service`, run `make install`
- From `~/workbench-app`, run `make install`
- From `~/workbench-service`, run `make install`

# Contributing

Expand Down
4 changes: 0 additions & 4 deletions assistant-connector/python/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion assistants/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repo_root = $(shell git rev-parse --show-toplevel)
include $(repo_root)/build-tools/makefiles/recursive.mk
include $(repo_root)/tools/makefiles/recursive.mk
2 changes: 1 addition & 1 deletion assistants/prospector-assistant/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"type": "debugpy",
"request": "launch",
"name": "launch assistant",
"name": "assistants: prospector-assistant",
"cwd": "${workspaceFolder}",
"module": "semantic_workbench_assistant.start",
"args": ["assistant.chat:app", "--port", "3011"],
Expand Down
2 changes: 1 addition & 1 deletion assistants/prospector-assistant/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ repo_root = $(shell git rev-parse --show-toplevel)

.DEFAULT_GOAL := venv

include $(repo_root)/build-tools/makefiles/poetry.mk
include $(repo_root)/tools/makefiles/poetry.mk
2 changes: 1 addition & 1 deletion assistants/prospector-assistant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See the [Responsible AI FAQ](../../RESPONSIBLE_AI_FAQ.md) for more information.
- SUGGESTED: Use GitHub Codespaces for a quick, easy, and consistent dev
environment: [/.devcontainer/README.md](../../.devcontainer/README.md)
- ALTERNATIVE: Local setup following the [main README](../../README.md#quick-start---local-development-environment)
- Set up and verify that the workbench app and service are running using the [semantic-workbench.code-workspace](../../semantic-workbench/v1/semantic-workbench.code-workspace)
- Set up and verify that the workbench app and service are running using the [semantic-workbench.code-workspace](../../semantic-workbench.code-workspace)
- If using Azure OpenAI, set up an Azure account and create a Content Safety resource
- See [Azure AI Content Safety](https://azure.microsoft.com/products/ai-services/ai-content-safety) for more information
- Copy the `.env.example` to `.env` and update the `ASSISTANT__AZURE_CONTENT_SAFETY_ENDPOINT` value with the endpoint of your Azure Content Safety resource
Expand Down
4 changes: 2 additions & 2 deletions assistants/prospector-assistant/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ pdfplumber = "^0.11.2"
tiktoken = "^0.7.0"

# If you copy this file to your project, you should verify the relative path to the following:
semantic-workbench-assistant = { path = "../../semantic-workbench/v1/service/semantic-workbench-assistant", develop = true }
content-safety = { path = "../../libraries/content-safety/", develop = true }
semantic-workbench-assistant = { path = "../../libraries/python/semantic-workbench-assistant", develop = true }
content-safety = { path = "../../libraries/python/content-safety/", develop = true }

[tool.poetry.group.dev.dependencies]
ruff = "^0.6.4"
Expand Down
16 changes: 8 additions & 8 deletions docs/ASSISTANT_DEVELOPMENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

For assistants to be instantiated in Semantic Workbench, you need to implement an assistant service that the workbench can talk with via http.

We provide several python base classes to make this easier: [semantic-workbench-assistant](../semantic-workbench/v1/service/semantic-workbench-assistant/README.md)
We provide several python base classes to make this easier: [semantic-workbench-assistant](../libraries/python/semantic-workbench-assistant/README.md)

Example assistant services:

- [Canonical assistant example](../semantic-workbench/v1/service/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py)
- Python assistant [python-01-echo-bot](../examples/python-01-echo-bot/README.md) and [python-02-simple-chatbot](../examples/python-02-simple-chatbot/README.md)
- .NET agent [dotnet-01-echo-bot](../examples/dotnet-01-echo-bot/README.md), [dotnet-02-message-types-demo](../examples/dotnet-02-message-types-demo/README.md) and [dotnet-03-simple-chatbot](../examples/dotnet-03-simple-chatbot/README.md)
- [Canonical assistant example](../libraries/python/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py)
- Python assistant [python-01-echo-bot](../examples/python/python-01-echo-bot/README.md) and [python-02-simple-chatbot](../examples/python/python-02-simple-chatbot/README.md)
- .NET agent [dotnet-01-echo-bot](../examples/dotnet/dotnet-01-echo-bot/README.md), [dotnet-02-message-types-demo](../examples/dotnet/dotnet-02-message-types-demo/README.md) and [dotnet-03-simple-chatbot](../examples/dotnet/dotnet-03-simple-chatbot/README.md)

## Top level concepts

RECOMMENDED FOR PYTHON: Use the `semantic-workbench-assistant` classes to create your assistant service. These classes provide a lot of the boilerplate code for you.

See the [semantic-workbench-assistant.assistant_app.AssistantApp](../semantic-workbench/v1/service/semantic-workbench-assistant/semantic_workbench_assistant/assistant_app/assistant.py) for the classes
and the Python [python-01-echo-bot](../examples/python-01-echo-bot/README.md) for an example of how to use them.
See the [semantic-workbench-assistant.assistant_app.AssistantApp](../libraries/python/semantic-workbench-assistant/semantic_workbench_assistant/assistant_app/assistant.py) for the classes
and the Python [python-01-echo-bot](../examples/python/python-01-echo-bot/README.md) for an example of how to use them.

### assistant_service.FastAPIAssistantService

Your main job is to implement a service that supports all the Semantic Workbench methods. The [Canonical assistant example](../semantic-workbench/v1/service/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py) demonstrates a minimal implementation.
Your main job is to implement a service that supports all the Semantic Workbench methods. The [Canonical assistant example](../libraries/python/semantic-workbench-assistant/semantic_workbench_assistant/canonical.py) demonstrates a minimal implementation.

It implements an assistant service that inherits from FastAPIAssistantService:

Expand All @@ -44,7 +44,7 @@ This service is now a FastAPIAssistantService containing all the assistant metho
- Follow the `README.md` in the example project to get started
- If the project has a `.env.example` file, copy it to `.env` and update the values as needed
- Build and Launch assistant. Run workbench service. Run workbench app. Add assistant local url to workbench via UI.
- NOTE: See additional documentation in [/semantic-workbench/v1/app/docs](../semantic-workbench/v1/app/docs/) regarding app features that can be used in the assistant service.
- NOTE: See additional documentation in [/workbench-app/docs](../workbench-app/docs/) regarding app features that can be used in the assistant service.

## Assistant service deployment

Expand Down
Loading

0 comments on commit ce4161f

Please sign in to comment.