✨ Getting Started
Overview
This guide provides detailed instructions on how to get started with Etendo Copilot, an API that allows interaction with a bot capable of selecting the appropriate tools to respond to user queries. It includes the necessary requirements, instructions for adding dependencies, environment variable configurations, and steps to run Copilot on an Etendo Classic project. Additionally, it covers optional configurations to customize Copilot's behavior and provides links to detailed installation guides for required software.
Etendo Copilot
Javapackage: com.etendoerp.copilot
Requirements
- Etendo Classic. If you do not have it, you can install it using the Etendo Installation Developer Guide.
- Python version ^3.10, to install it follow The Official Installation Guide.
- Docker to install it follow The Official Installation Guide.
Installation
This module is included in the Copilot Extensions bundle
Info
To be able to include this functionality, the Copilot Extensions Bundle must be installed. To do that, follow the instructions from the marketplace: Copilot Extensions Bundle. For more information about the available versions, core compatibility and new features, visit Copilot Extensions - Release notes.
In addition, you can install only the module containing the Etendo Copilot by following the guide on How to install modules in Etendo, looking for the GitHub Package com.etendoerp.copilot
.
Ensure you have 1.3.2 plugin version or greater:
Run Etendo Copilot
-
In
gradle.properties
file is necessary to add some environment variables as a mandatory requirementgradle.propertiesCOPILOT_PORT=5000 OPENAI_API_KEY= **** ETENDO_HOST=http://your.etendo.instance/etendo
Environment Variable Options Info COPILOT_PORT 5000
Required The copilot port can be defined by the user OPENAI_API_KEY ***********************
Required You can use an OPEN AI API Key of your own, or you can contact the Etendo support team to obtain one. ETENDO_HOST http://your.etendo.instance/etendo
Required The URL of the Etendo system, this is where copilot will send the requests to communicate with the Etendo system. ETENDO_HOST_DOCKER Optional The URL of the Etendo system, this is where copilot will send the requests to communicate with the Etendo system. This variable is used when the copilot is running in a docker container and the Etendo Instance is not accessible from a domain. Info
The
ETENDO_HOST_DOCKER
variable is used when the copilot is running in a docker container and the Etendo Instance is not accessible from a domain. This is important because the copilot needs to communicate with the Etendo system to perform the necessary actions. For example, if Copilot is running into a docker container and the Etendo Instance is running locally, theETENDO_HOST
variable should behttp://localhost:8080/etendo
and theETENDO_HOST_DOCKER
variable should behttp://host.docker.internal:8080/etendo
. Its recommended to access to the Docker Container shell and check the network configuration to get the correct IP address.- In addition, there are other optional variables to configure certain aspects of the copilot. If not specified, default values are used.
Environment Variable Options Default Info SYSTEM_PROMPT String
"You are a very powerful assistant with a set of tools, which you will try to use for the requests made to you."
The prompt that will be used to make the request to the agent and that will condition the response and behavior of the copilot. CONFIGURED_TOOLS_FILENAME JSON File name
tools_config.json
The name of the file that contains the configuration of the enabled tools. DEPENDENCIES_TOOLS_FILENAME TOML File name
tools_deps.toml
The name of the file that contains the configuration of the dependencies of the tools. COPILOT_IMAGE_TAG String
master
The tag of the copilot docker image that will be used. COPILOT_PULL_IMAGE Boolean
true
If true, the copilot docker image will be pulled from docker hub. If false, gradle will try to use the local image with the tag specified in COPILOT_IMAGE_TAG, but if it does not exist, it will be pulled from docker hub. COPILOT_DOCKER_CONTAINER_NAME String
etendo-default
The name of the docker container that will be created to run the copilot docker image. -
Once the Copilot dependency was added and the variables configurated, in the terminal execute:
To apply changes To complile the environment -
To download and run the latest copilot Docker image, execute:
Info
In the terminal Etendo Copilot will be running, and you can see the corresponding log, in case you want to return to the terminal you can exit with Ctrl + C, although the docker container will continue running. We recommend using lazydocker or Docker Desktop for a simple and fast container management.
To stop the Copilot container you can run:
-
Try Copilot in your Etendo instance. To configure an assistant to use Etendo Copilot, follow the Assistant Configuration Guide.