Skip to main content

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

  1. Everything can be a Plugin, connect everything to AI & LLM by Messages.
  2. General LLM Interface and seamlessly LLM replacement.
  3. Decouple Businesses from Plugins and LLMs.
  4. Decouple Plugins from Copilots, LLMs, and Resources.
  5. Component package management.
  6. Convenient and Easy for Community to contribute.
  7. Free and flexible in application developments.
  8. Friendly to other developing tools.
  9. 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

Website
GitHub
Documents

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

  1. Find the Copilot information (group_id, artifact_id, and version) from this website.

  2. 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.

  1. 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
    

    latest version

    component source

  2. 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
    

    latest version

    component source

  3. 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
    

    latest version

    component source

For developers

Develop a Plugin

  1. Directory structure

    root
    |-- .config
    |    |-- config.yaml
    |    |-- ... (other config files)
    |
    |-- __init__.py (expose a "constructor" method to construct your plugin)
    |-- ...
    
  2. Extend AbstractPlugin for your plugin, and implement

    • the __init__ method which receives only one dict parameter containing its configuration.
    • the command method which receives a command name string and a parameter (recommends in type dict) and returns its response (recommends in type dict, 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:
            # ...
    
  3. Edit your plugin config.yaml under the .config folder. Don't forget to fill the setup 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>
    
    #...
    
  4. 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"
    ]
    
  5. Deploy your python package.

  6. Deploy your plugin into our Plugin Repository so that others can use it:

    conpack deploy
            # --src-folder=<your_source_folder>
    

Develop a Copilot

  1. Build the directory structure just the same as if you are developing a Plugin.

  2. Generally there's no need to extend the Copilot interface, extend the Interactor 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
            )
            # ...
    
  3. Edit your interactor config.yaml under the .config folder. Don't forget to fill the setup section as developing a plugin.

  4. 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"
    ]
    
  5. Modify the Copilot config.yaml with your own Interactor and run the Copilot to test

    group_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:
        # ...
    
    # ...
    
  6. Deploy your python package.

  7. 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

concopilot-0.0.5.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

concopilot-0.0.5-py3-none-any.whl (66.9 kB view details)

Uploaded Python 3

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

Hashes for concopilot-0.0.5.tar.gz
Algorithm Hash digest
SHA256 cf37b2f9bee1b2d05425cdb49dbea33f2324a2cd90f296fecfbafe76c492a0b3
MD5 a236ef5b8c5c1d649e88cf88df5a84ba
BLAKE2b-256 1236ffa2e24696ac8ab2f29aae140feaa75a8a0ff2629e40f7182ce6a8367700

See more details on using hashes here.

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

Hashes for concopilot-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1e8b820abf1f1c1f0479af1611546bf677b70588808075affb97952014ca3b67
MD5 1d46e93e17d57aafeff325c5d440a33a
BLAKE2b-256 29eee95529152f42e3564d2f721f08e00c4b4f0f4702c2dee01ca385b37501b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page