You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shentong.martin 4ea5783584 chore: fix staticcheck formatting
Change-Id: I10f1b13764ae8533034cec505bcb24dfa216d531
2 months ago
..
agents chore: fix lint and formatting 2 months ago
generic chore: fix lint and formatting 2 months ago
params feat(adk): add excel agent based on plan-execute-replan pattern (#122) 6 months ago
playground feat(adk): add excel agent based on plan-execute-replan pattern (#122) 6 months ago
tools chore: fix lint and formatting 2 months ago
utils chore: fix staticcheck formatting 2 months ago
README.md feat(adk): add excel agent based on plan-execute-replan pattern (#122) 6 months ago
main.go chore: fix lint and formatting 2 months ago
operator.go chore: fix lint and formatting 2 months ago

README.md

Eino ADK Integration Example: Excel Agent

Description

Excel Agent is a "smart assistant who can understand Excel". It first breaks down the problem into steps, then executes and verifies the results step by step. It can understand user problems and uploaded file contents, propose feasible solutions, and select appropriate tools (system commands, generate and run Python code, network queries, etc.) to complete tasks.

Before using this, you need to make some configurations:

Env

//requiredBasic LLM Model Configcurrently support Ark and OpenAI models.
// Ark model config
export ARK_API_KEY=""   //requiredArk Model API Key
export ARK_MODEL=""     //requiredArk Model name
export ARK_BASE_URL=""  //optionalArk Model base_url
export ARK_REGION=""    //optionalArk Model region

// OpenAI model config
export OPENAI_API_KEY=""       // (requiredOpenAI Model API Key
export OPENAI_MODEL=""         // (requiredOpenAI Model name
export OPENAI_BASE_URL=""      // (optionalOpenAI base_url
export OPENAI_BY_AZURE="false" // (optionalOpenAI using Azure service or not

//optionalPython executable pathdefault using system python.
// It's recommended to use venv, and install pandas / numpy / matplotlib / openpyxl before lanunching this agent.
// When the code written by CodeAgent fails to run due to lack of dependencies, the pip command may be used to try to install dependencies. 
// At this time, if you use python in the system environment, it may be blocked, causing the Excel Agent to fail to run and exit.
export EXCEL_AGENT_PYTHON_EXECUTABLE_PATH="python"

//optionalVision Model Configdefault null, which ImagepReader tool in ReportAgent will not activate.
export ARK_VISION_API_KEY=""    // Ark Vision Model API Key
export ARK_VISION_MODEL=""      // Ark Vision Model name
export ARK_VISION_BASE_URL=""   // Ark Vision Model base_url
export ARK_VISION_REGION=""     // Ark Vision Model region

Input

The input for Excel Agent is a description of user requirements and a series of files to be processed:

  • The first line in main.go represents the requirement description entered by the user:
      func main() {
          // query := schema.UserMessage("Count the recommended novel names and recommended times in the attachment file, and write the results to the file. The content with "" is the name of the novel and forms a table. The header is the name of the novel and the number of recommendations. The novels with the same name are listed in only one line, and the number of recommendations is added")
          // query := schema.UserMessage("Read the content in simulated question. csv, put the question, answer, resolution and options in the same line in a standardized format, and simply write the answer to the resolution")
          query := schema.UserMessage("Please help me extract the first column in question.csv table into a new csv")
      }
    
  • adk/multiagent/integration-excel-agent/playground/input is the default attachment input path. For example, the question.csv file mentioned in the above query needs to be placed in this directory before it can be read by the agent. In addition, it supports the configuration of the environment variable EXCEL_AGENT_INPUT_DIR to set the attachment input path (absolute path).
  • Several sample files are provided in the path adk/multiagent/integration-excel-agent/playground/test_data for your test:
      % tree adk/multiagent/integration-excel-agent/playground/test_data
      adk/multiagent/integration-excel-agent/playground/test_data
      ├── questions.csv
      ├── 推荐小说.txt
      └── 模拟出题.csv
    
      1 directory, 3 files
    

Output

The default working directory is adk/multiagent/integration-excel-agent/playground/${uuid}.

You can set your own working directory by setting env: export EXCEL_AGENT_WORK_DIR="your_path"" (the absolute path before/$uuid).