Package: concopilot
ConCopilotBenefit everyone from AI & LLMConCopilot is designed toCONnect allCOPILOTs by making "functional parts"reusable,replaceable,portable, andflexible, 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 copilotreusable,replaceable,portable, andflexible.
Any contributions that can improve these features are welcome.Other than that, ConCopilot doNOTprovide 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 ConCopilotBased on Plugins, Driven by MessagesEverything can be aPlugin, connect everything to AI & LLM byMessages.General LLM Interfaceand 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. AutoGPTIn 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. 😆ResourcesWebsiteGitHubDocumentsPlease note that ConCopilot doNOTtake the responsibility of any malicious and abuse of components.ExampleSee example source codes and configshere.Installationpipinstall--upgradeconcopilotFor end usersRun a developed Copilot taskFind the Copilot information (group_id, artifact_id, and version) from this website.Run the Copilot:conpackrun--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 examplesYou may like to download the config files and modify some parameters first, such as API keys, service ports, etc.
Runconpack buildfirst, and then find the correspondingconfig.yamlfile from the ".runtime" folder.
The directory path is composed by the componentsgroup_id,artifact_id, andversion.Simple Chat:conpackrun--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-setuplatest versioncomponent sourceChat with Tools:conpackrun--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-setuplatest versioncomponent sourceSimplified Auto-GPT like:conpackrun--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-setuplatest versioncomponent sourceFor developersDevelop a PluginDirectory structureroot
|-- .config
|    |-- config.yaml
|    |-- ... (other config files)
|
|-- __init__.py (expose a "constructor" method to construct your plugin)
|-- ...ExtendAbstractPluginfor your plugin, and implementthe__init__method which receives only onedictparameter containing its configuration.thecommandmethod which receives a command namestringand a parameter (recommends in typedict) and returns its response (recommends in typedict, too).fromconcopilot.framework.pluginimportAbstractPluginclassYourPlugin(AbstractPlugin):def__init__(self,config:Dict):super(YourPlugin,self).__init__(config)# ...defcommand(self,command_name:str,param:Any,**kwargs)->Any:# ...Edit your pluginconfig.yamlunder the.configfolder. Don't forget to fill thesetupsection:# in your plugin's config.yamlgroup_id:<group_id>artifact_id:<artifact_id>version:<version># ...setup:pip:-<your_python_package>package:<package_of_the__init__py>#...Edit the__init__.pyin the package to expose a "constructor" method for plugin initialization like below:fromtypingimportDictfromyour.plugin.packageimportYourPlugindefconstructor(config:Dict):returnYourPlugin(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:conpackdeploy# --src-folder=<your_source_folder>Develop a CopilotBuild the directory structure just the same as if you are developing a Plugin.Generally there's no need to extend theCopilotinterface, extend theInteractorinstead.fromconcopilot.framework.interactorimportBasicInteractorclassYourInteractor(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 interactorconfig.yamlunder the.configfolder. Don't forget to fill thesetupsection as developing a plugin.Edit the__init__.pyin the package to expose a "constructor" method for plugin initialization like below:fromtypingimportDictfromyour.interactor.packageimportYourInteractordefconstructor(config:Dict):returnYourInteractor(config)__all__=['constructor'# Please make sure the method name is exactly "constructor"]Modify the Copilotconfig.yamlwith your ownInteractorand run the Copilot to testgroup_id:org.concopilot.basic.copilotartifact_id:basic-copilotversion:<basic_copilot_version>type:copilotas_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 itconpackdeploy# --src-folder=<your_source_folder>