ConCopilot defines standards and common interfaces that would be helpful to make each part of a copilot reusable, replaceable, portable, and flexible.
Project description
ConCopilot
Benefit everyone from AI & LLM
ConCopilot is designed to CONnect all COPILOTs by making "functional parts" reusable, replaceable, portable, and flexible, aiming to leverage all potential tasks by AI & LLM.
ConCopilot defines standards and common interfaces that would be helpful to make each part of a copilot reusable, replaceable, portable, and flexible. Any contributions that can improve these features are welcome.
Other than that, ConCopilot do NOT provide specific implementation nor developing constrains to developers. Instead, ConCopilot fully leave these freedom to developers and users. Every component and configs can be changed during both developing and using, and it is welcome to upload those new components into our repository so that others can be benefited from.
Why ConCopilot
Based on Plugins, Driven by Messages
- Everything can be a Plugin, connect everything to AI & LLM by Messages.
- General LLM Interface and seamlessly LLM replacement.
- Decouple Businesses from Plugins and LLMs.
- Decouple Plugins from Copilots, LLMs, and Resources.
- Component package management.
- Convenient and Easy for Community to contribute.
- Free and flexible in application developments.
- Friendly to other developing tools.
- Simple for end users.
ConCopilot vs. LangChain vs. AutoGPT
In one word, LangChain is a developing tools for LLM applications, AutoGPT is one of those applications, and ConCopilot defines standards and common interfaces to help application developers and end users to deal with components easily, as well as to help products and services connect to LLMs.
As a result, using tools like LangChain, following ConCopilot interface, developing products like AutoGPT, benefit people around the world. 😆
Resources
Please note that ConCopilot do NOT take the responsibility of any malicious and abuse of components.
Example
See example source codes and configs here.
Installation
pip install --upgrade concopilot
For end users
Run a developed Copilot task
-
Find the Copilot information (group_id, artifact_id, and version) from this website.
-
Run the Copilot:
conpack run --group-id=<copilot_group_id> --artifact-id=<copilot_artifact_id> --version=<copilot_version> # --config-file=<your_downloaded_file_path> # --working-directory=<your_working_directory>
Quick examples
You may like to download the config files and modify some parameters first, such as API keys, service ports, etc.
Run conpack build
first, and then find the corresponding config.yaml
file from the ".runtime" folder.
The directory path is composed by the components group_id
, artifact_id
, and version
.
-
Simple Chat:
conpack run --group-id=org.concopilot.example.copilot --artifact-id=basic-chat-copilot --version=<version> # --config-file=<config.yaml|config_glm.yaml|config_rwkv.yaml|config_web.yaml|config_web_glm.yaml|config_web_rwkv.yaml> # --working-directory=<your_working_directory> # --skip-setup
-
Chat with Tools:
conpack run --group-id=org.concopilot.example.copilot --artifact-id=basic-chat-with-tool-copilot --version=<version> # --config-file=<config.yaml|config_ocr.yaml|config_ocr_glm.yaml> # --working-directory=<your_working_directory> # --skip-setup
-
Simplified Auto-GPT like:
conpack run --group-id=org.concopilot.example.copilot --artifact-id=basic-auto-copilot --version=<version> # --config-file=<config.yaml|config_web.yaml> # --working-directory=<your_working_directory> # --skip-setup
For developers
Develop a Plugin
-
Directory structure
root |-- .config | |-- config.yaml | |-- ... (other config files) | |-- __init__.py (expose a "constructor" method to construct your plugin) |-- ...
-
Extend
AbstractPlugin
for your plugin, and implement- the
__init__
method which receives only onedict
parameter containing its configuration. - the
command
method which receives a command namestring
and a parameter (recommends in typedict
) and returns its response (recommends in typedict
, too).
from concopilot.framework.plugin import AbstractPlugin class YourPlugin(AbstractPlugin): def __init__(self, config: Dict): super(YourPlugin, self).__init__(config) # ... def command(self, command_name: str, param: Any, **kwargs) -> Any: # ...
- the
-
Edit your plugin
config.yaml
under the.config
folder. Don't forget to fill thesetup
section:# in your plugin's config.yaml group_id: <group_id> artifact_id: <artifact_id> version: <version> # ... setup: pip: - <your_python_package> package: <package_of_the__init__py> #...
-
Edit the
__init__.py
in the package to expose a "constructor" method for plugin initialization like below:from typing import Dict from your.plugin.package import YourPlugin def constructor(config: Dict): return YourPlugin(config) __all__=[ 'constructor'# Please make sure the method name is exactly "constructor" ]
-
Deploy your python package.
-
Deploy your plugin into our Plugin Repository so that others can use it:
conpack deploy # --src-folder=<your_source_folder>
Develop a Copilot
-
Build the directory structure just the same as if you are developing a Plugin.
-
Generally there's no need to extend the
Copilot
interface, extend theInteractor
instead.from concopilot.framework.interactor import BasicInteractor class YourInteractor(BasicInteractor): def __init__( self, config: Dict, resource_manager: ResourceManager, cerebrum: Cerebrum, plugin_manager: PluginManager, message_manager: MessageManager ): super(BasicInteractor, self).__init__( config, resource_manager, cerebrum, plugin_manager, message_manager ) # ...
-
Edit your interactor
config.yaml
under the.config
folder. Don't forget to fill thesetup
section as developing a plugin. -
Edit the
__init__.py
in the package to expose a "constructor" method for plugin initialization like below:from typing import Dict from your.interactor.package import YourInteractor def constructor(config: Dict): return YourInteractor(config) __all__=[ 'constructor'# Please make sure the method name is exactly "constructor" ]
-
Modify the Copilot
config.yaml
with your ownInteractor
and run the Copilot to testgroup_id: org.concopilot.basic.copilot artifact_id: basic-copilot version: <basic_copilot_version> type: copilot as_plugin: false # ... interactor: group_id: <your_interactor_group_id> artifact_id: <your_interactor_artifact_id> version: <your_interactor_version> config: # ... # ...
-
Deploy your python package.
-
Deploy your interactor into our Plugin Repository so that others can use it
conpack deploy # --src-folder=<your_source_folder>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file concopilot-0.0.5.tar.gz
.
File metadata
- Download URL: concopilot-0.0.5.tar.gz
- Upload date:
- Size: 47.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf37b2f9bee1b2d05425cdb49dbea33f2324a2cd90f296fecfbafe76c492a0b3 |
|
MD5 | a236ef5b8c5c1d649e88cf88df5a84ba |
|
BLAKE2b-256 | 1236ffa2e24696ac8ab2f29aae140feaa75a8a0ff2629e40f7182ce6a8367700 |
File details
Details for the file concopilot-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: concopilot-0.0.5-py3-none-any.whl
- Upload date:
- Size: 66.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8b820abf1f1c1f0479af1611546bf677b70588808075affb97952014ca3b67 |
|
MD5 | 1d46e93e17d57aafeff325c5d440a33a |
|
BLAKE2b-256 | 29eee95529152f42e3564d2f721f08e00c4b4f0f4702c2dee01ca385b37501b7 |