### Start Development Server Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/ui/CONTRIBUTING.md Run this command to start the development server. ```bash pnpm dev ``` -------------------------------- ### Start FastAPI Service Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-tool/README.md Copies the environment template, prompts the user to fill in environment variables, and then starts the FastAPI service using `uv`. ```bash cd genie-tool cp .env_template .env # 填写环境变量 uv run python server.py ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-tool/README.md Installs project dependencies using `uv` and activates the virtual environment. ```bash pip install uv cd genie-tool uv sync source .venv/bin/activate ``` -------------------------------- ### Install Dependencies Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/ui/CONTRIBUTING.md Run this command to install project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Initialize Database Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-tool/README.md Initializes the project's database. This command is typically run only once during initial setup. ```bash cd genie-tool python -m genie_tool.db.db_engine ``` -------------------------------- ### Run Project Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-backend/README.md Shell script to start the Genie Backend application. ```bash ./start.sh ``` -------------------------------- ### Start JoyAgent-JDGenie Application Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md This script is used to start the JoyAgent-JDGenie application. It should be run after configuring the application. ```bash sh start_genie.sh ``` -------------------------------- ### Start JoyAgent-JDGenie Services Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Use these shell scripts to check dependencies, start all services, and manage the JoyAgent-JDGenie application. Control+C can be used to kill all services. ```shell sh check_dep_port.sh sh Genie_start.sh ``` -------------------------------- ### Java BaseTool Interface and Implementation Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README_EN.md Defines the BaseTool interface for custom agents and provides a WeatherTool example. Implement this interface to add custom sub-agents. ```java /** * Base Tool Interface */publicinterfaceBaseTool { StringgetName(); // Tool name StringgetDescription(); // Tool description Map toParams(); // Tool parameters Objectexecute(Objectinput); // Invoke tool } // Weather Agent Example publicclassWeatherToolimplementsBaseTool { @Override publicStringgetName() { return"agent_weather"; } @Override publicStringgetDescription() { return"A weather query agent"; } @Override publicMap toParams() { return"{\"type\":\"object\",\"properties\":{\"location\":{\"description\":\"地点\",\"type\":\"string\"}},\"required\":[\"location\"]}"; } @Override publicObjectexecute(Objectinput) { return"Today's weather is sunny"; } } ``` -------------------------------- ### Clone and Navigate Project Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-backend/README.md Commands to clone the project repository and navigate into the project directory. ```bash git clone [项目地址] cd genie-backend ``` -------------------------------- ### Docker Deployment for JoyAgent-JDGenie Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Instructions for cloning the repository, configuring application settings, building the Docker image, and running the service. Ensure to update `application.yml` and `.env_template` with your specific API keys and model configurations. ```bash 1. git clone https://github.com/jd-opensource/joyagent-jdgenie.git 2. 手动更新 genie-backend/src/main/resources/application.yml中 base_url、apikey、model、max_tokens、model_name等配置 使用DeepSeek时: 注意deepseek-chat 为max_tokens: 8192 手动更新 genie-tool/.env_template 中的 OPENAI_API_KEY、OPENAI_BASE_URL、DEFAULT_MODEL、SERPER_SEARCH_API_KEY 使用DeepSeek时: 设置DEEPSEEK_API_KEY、DEEPSEEK_API_BASE,DEFAULT_MODEL 设置为 deepseek/deepseek-chat,所有 ${DEFAULT_MODEL} 也都改成deepseek/deepseek-chat 3. 编译dockerfile docker build -t genie:latest . 4. 启动dockerfile docker run -d -p 3000:3000 -p 8080:8080 -p 1601:1601 --name genie-app genie:latest 5. 浏览器输入 localhost:3000 访问genie ``` -------------------------------- ### Manual Service Launch Scripts Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README_EN.md Shell scripts to verify dependencies and ports, and to launch all services. Restart after configuration changes. ```bash sh check_dep_port.sh # Verify all dependencies and port occupancy sh Genie_start.sh # Launch services directly; restart this script after configuration changes (terminate all services with Control+C) ``` -------------------------------- ### Docker Deployment Commands Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README_EN.md Commands for cloning the repository, updating configurations, building the Docker image, and launching the container. ```bash 1.git clone https://github.com/jd-opensource/joyagent-jdgenie.git 2.Manually update the following configurations in genie-backend/src/main/resources/application.yml: base_url, apikey, model, max_tokens, model_name Note for DeepSeek users: Set max_tokens: 8192 for deepseek-chat Manually update the following environment variables in genie-tool/.env_template: OPENAI_API_KEY, OPENAI_BASE_URL, DEFAULT_MODEL, SERPER_SEARCH_API_KEY DeepSeek Configuration:Set DEEPSEEK_API_KEY and DEEPSEEK_API_BASE,Configure DEFAULT_MODEL = deepseek/deepseek-chat, Replace all occurrences of ${DEFAULT_MODEL} with deepseek/deepseek-chat 3.Build the Docker image docker build -t genie:latest . 4.Launch the Docker container docker run -d -p 3000:3000 -p 8080:8080 -p 1601:1601 --name genie-app genie:latest 5.Access Genie via browser Open http://localhost:3000 ``` -------------------------------- ### Build Project Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-backend/README.md Shell script to compile the Genie Backend project. ```bash ./build.sh ``` -------------------------------- ### Project Structure Overview Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-backend/README.md Illustrates the directory layout of the Genie Backend project. ```tree genie-backend/ ├── src/ │ ├── main/ │ │ ├── java/com/jd/genie/ │ │ │ ├── agent/ │ │ │ ├── config/ │ │ │ ├── controller/ │ │ │ ├── handler/ │ │ │ ├── model/ │ │ │ ├── service/ │ │ │ └── util/ │ │ └── resources/ │ └── test/ ├── pom.xml ├── build.sh ├── start.sh └── README.md ``` -------------------------------- ### Implement Custom Tool Interface Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Implement the BaseTool interface to create custom agents. This involves defining the tool's name, description, parameters, and execution logic. ```java /** * 工具基接口 */ public interface BaseTool { String getName(); // 工具名称 String getDescription(); // 工具描述 Map toParams(); // 工具参数 Object execute(Object input); // 调用工具 } // 天气智能体示例 public class WeatherTool implements BaseTool { @Override public String getName() { return "agent_weather"; } @Override public String getDescription() { return "这是一个可以查询天气的智能体"; } @Override public Map toParams() { return "{\"type\":\"object\",\"properties\":{\"location\":{\"description\":\"地点\",\"type\":\"string\"}},\"required\":[\"location\"]}"; } @Override public Object execute(Object input) { return "今日天气晴朗"; } } ``` -------------------------------- ### Call Tool API with cURL Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Use this cURL command to invoke a tool, specifying the server URL, tool name, and arguments. Ensure the Content-Type is set to application/json. ```bash curl -X POST 'http://localhost:8188/call_tool' -H "Content-Type: application/json" -d '{ "server_url": "https://mcp.amap.com/sse?key=xxxxxxxxxxxx", "name": "maps_geo", "arguments": { "address": "经海路地铁站" } }' ``` -------------------------------- ### Configure MCP Server URLs Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Add MCP server URLs to the application configuration file. Multiple servers should be comma-separated. This configuration is used by the backend. ```yaml mcp_server_url: "http://ip1:port1/sse,http://ip2:port2/sse" ``` -------------------------------- ### maps_schema_take_taxi Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Generates a client-invokable URI to directly open a ride-hailing service (e.g., Gaode Maps) for booking a taxi. ```APIDOC ## maps_schema_take_taxi ### Description Generates a client URI to wake up a ride-hailing client application (like Gaode Maps) for booking a taxi. ### Method Not specified (assumed to be a function call within the SDK) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **slon** (string) - Optional - The longitude of the starting point. - **slat** (string) - Optional - The latitude of the starting point. - **sname** (string) - Optional - The name of the starting point. - **dlon** (string) - Required - The longitude of the destination. - **dlat** (string) - Required - The latitude of the destination. - **dname** (string) - Required - The name of the destination. ### Request Example ```json { "slon": "121.473701", "slat": "31.230413", "sname": "Origin", "dlon": "121.500000", "dlat": "31.200000", "dname": "Destination" } ``` ### Response #### Success Response (200) - **uri** (string) - The generated client URI to open the ride-hailing service. #### Response Example ```json { "uri": "amapuri://வுக/taxi?slon=121.473701&slat=31.230413&sname=Origin&dlon=121.500000&dlat=31.200000&dname=Destination" } ``` ``` -------------------------------- ### maps_schema_navi Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Generates a client-invokable URI to open the navigation page in a client application, based on destination coordinates. ```APIDOC ## maps_schema_navi ### Description Generates a client URI to wake up the client application and navigate to a specified destination. ### Method Not specified (assumed to be a function call within the SDK) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **lon** (string) - Required - The longitude of the destination. - **lat** (string) - Required - The latitude of the destination. ### Request Example ```json { "lon": "121.473701", "lat": "31.230413" } ``` ### Response #### Success Response (200) - **uri** (string) - The generated client URI to open the navigation page. #### Response Example ```json { "uri": "amapuri://route/plan?dlon=121.473701&dlat=31.230413" } ``` ``` -------------------------------- ### Lint and Fix Code Style Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/ui/CONTRIBUTING.md Use these commands to check and automatically fix code style issues with ESLint and Prettier. ```bash pnpm lint ``` ```bash pnpm fix ``` -------------------------------- ### Call Tool Endpoint Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md This endpoint allows users to call various tools by providing the server URL, tool name, and arguments. The response contains the result of the tool execution. ```APIDOC ## POST /call_tool ### Description Invokes a specified tool with given arguments. ### Method POST ### Endpoint http://localhost:8188/call_tool ### Parameters #### Request Body - **server_url** (string) - Required - The URL of the server hosting the tool. - **name** (string) - Required - The name of the tool to call. - **arguments** (object) - Required - A JSON object containing the arguments for the tool. - **address** (string) - Required - The address to be geocoded. ### Request Example ```json { "server_url": "https://mcp.amap.com/sse?key=xxxxxxxxxxxx", "name": "maps_geo", "arguments": { "address": "经海路地铁站" } } ``` ### Response #### Success Response (200) - **code** (integer) - The status code of the response. - **message** (string) - A message indicating the status of the operation. - **data** (object) - Contains the result of the tool call. - **content** (array) - An array of results from the tool. - **type** (string) - The type of content. - **text** (string) - The textual representation of the result. - **isError** (boolean) - Indicates if an error occurred. #### Response Example ```json { "code": 200, "message": "success", "data": { "_meta": null, "content": [ { "type": "text", "text": "{\"results\":[{\"country\":\"中国\",\"province\":\"北京市\",\"city\":\"北京市\",\"citycode\":\"010\",\"district\":\"通州区\",\"street\":[],\"number\":[],\"adcode\":\"110112\",\"location\":\"116.562245,39.783587\",\"level\":\"公交地铁站点\"}]}" } ], "isError": false } } ``` ``` -------------------------------- ### maps_schema_personal_map Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Generates a URI link for displaying itinerary planning results on Gaode Maps. It takes a list of locations and their order to create a navigable route. ```APIDOC ## maps_schema_personal_map ### Description Generates a URI link for displaying itinerary planning results on Gaode Maps. It takes a list of locations and their order to create a navigable route. ### Method POST ### Endpoint /maps/schema_personal_map ### Parameters #### Request Body - **orgName** (string) - Required - The name of the mini-program for itinerary planning. - **lineList** (array) - Required - A list of itinerary steps. - **title** (string) - Required - The title or description of the itinerary step. - **pointInfoList** (array) - Required - A list of points of interest for this step. - **name** (string) - Required - The name of the point of interest. - **lon** (number) - Required - The longitude of the point of interest. - **lat** (number) - Required - The latitude of the point of interest. - **poiId** (string) - Required - The POI ID of the point of interest. ``` -------------------------------- ### BibTeX Citation for JoyAgent-JDGenie Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README_DataAgent.md Use this BibTeX entry for academic citations of the JoyAgent-JDGenie project. It includes author, title, year, URL, version, publisher, and contact emails. ```bibtex @software{JoyAgent-JDGenie, author = {Agent Team at JDCHO}, title = {JoyAgent-JDGenie}, year = {2025}, url = {https://github.com/jd-opensource/joyagent-jdgenie}, version = {0.1.0}, publisher = {GitHub}, email = {jiashilin1@jd.com;liyang.1236@jd.com;liushangkun@jd.com;tianshaohua.1@jd.com;wangzhen449@jd.com;yaoting.2@jd.com;houkang6@jd.com;jinglingtuan@jd.com;guohongliang@jd.com;zhang.junbo@jd.com} } ``` -------------------------------- ### BibTeX for Academic Citation Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Use this BibTeX entry for academic citations of the JoyAgent-JDGenie project. It includes author, title, year, URL, version, and publisher information. ```bibtex @software{JoyAgent-JDGenie, author = {Agent Team at JDCHO}, title = {JoyAgent-JDGenie}, year = {2025}, url = {https://github.com/jd-opensource/joyagent-jdgenie}, version = {0.1.0}, publisher = {GitHub}, email = {jiashilin1@jd.com;liyang.1236@jd.com;liushangkun@jd.com;tianshaohua.1@jd.com;wangzhen449@jd.com;yaoting.2@jd.com;houkang6@jd.com;jinglingtuan@jd.com;guohongliang@jd.com} } ``` -------------------------------- ### Add Custom Agent to Controller Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/README.md Integrate your custom agent by adding it to the tool collection in the GenieController. This makes the agent available for use within the application. ```java WeatherTool weatherTool = new WeatherTool(); toolCollection.addTool(weatherTool); ``` -------------------------------- ### maps_weather Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Retrieves weather information for a specified city using its name or adcode. ```APIDOC ## maps_weather ### Description Fetches weather information for a given city, identified by its name or adcode. ### Method Not specified (assumed to be a function call within the SDK) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **city** (string) - Required - The name or adcode of the city for which to retrieve weather information. ### Request Example ```json { "city": "Beijing" } ``` ### Response #### Success Response (200) - **weather_info** (object) - An object containing weather details (structure not specified). #### Response Example ```json { "weather_info": { "temperature": "25°C", "condition": "Sunny" } } ``` ``` -------------------------------- ### Tool Calling API Response Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md This JSON structure represents a successful response from the tool calling API. It includes a status code, a success message, and the content returned by the tool, which may contain structured data or text. ```json { "code": 200, "message": "success", "data": { "_meta": null, "content": [ { "type": "text", "text": "{\"results\":[{\"country\":\"中国\",\"province\":\"北京市\",\"city\":\"北京市\",\"citycode\":\"010\",\"district\":\"通州区\",\"street\":[],\"number\":[],\"adcode\":\"110112\",\"location\":\"116.562245,39.783587\",\"level\":\"公交地铁站点\"},{\"country\":\"中国\",\"province\":\"云南省\",\"city\":\"昆明市\",\"citycode\":\"0871\",\"district\":\"官渡区\",\"street\":\"经海路\",\"number\":[],\"adcode\":\"530111\",\"location\":\"102.768586,24.994150\",\"level\":\"道路\"},{\"country\":\"中国\",\"province\":\"云南省\",\"city\":\"昆明市\",\"citycode\":\"0871\",\"district\":\"官渡区\",\"street\":\"经海路\",\"number\":[],\"adcode\":\"530111\",\"location\":\"102.768585,24.994179\",\"level\":\"道路\"},{\"country\":\"中国\",\"province\":\"云南省\",\"city\":\"昆明市\",\"citycode\":\"0871\",\"district\":\"官渡区\",\"street\":\"经海路\",\"number\":[],\"adcode\":\"530111\",\"location\":\"102.768585,24.994179\",\"level\":\"道路\"}]}"}, "annotations": null } ], "isError": false } } ``` -------------------------------- ### maps_search_detail Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Retrieves detailed information for a Point of Interest (POI) using its ID, obtained from keyword or nearby searches. ```APIDOC ## maps_search_detail ### Description Queries for detailed information of a POI ID obtained from keyword or nearby searches. ### Method Not specified (assumed to be a function call within the SDK) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **id** (string) - Required - The POI ID to retrieve details for. ### Request Example ```json { "id": "poi_id_string" } ``` ### Response #### Success Response (200) - **details** (object) - Description of the POI details (structure not specified). #### Response Example ```json { "details": { "name": "Example POI Name", "address": "123 Example Street" } } ``` ``` -------------------------------- ### maps_regeocode Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Converts a given latitude and longitude coordinate into administrative address information. ```APIDOC ## maps_regeocode ### Description Converts a given latitude and longitude coordinate into administrative address information. ### Method POST ### Endpoint /maps/regeocode ### Parameters #### Request Body - **location** (string) - Required - Latitude and longitude coordinates (e.g., "120.155047,30.274118"). ``` -------------------------------- ### maps_text_search Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Performs a Point of Interest (POI) search based on keywords and returns relevant information. ```APIDOC ## maps_text_search ### Description Searches for POIs based on user-provided keywords and returns relevant information. ### Method Not specified (assumed to be a function call within the SDK) ### Parameters #### Path Parameters None #### Query Parameters - **keywords** (string) - Required - The search keywords. - **city** (string) - Optional - The city to search within. - **citylimit** (boolean) - Optional - Whether to limit the search to the specified city. Defaults to false. ### Request Example ```json { "keywords": "restaurants", "city": "San Francisco", "citylimit": true } ``` ### Response #### Success Response (200) - **results** (array) - An array of POI search results (structure not specified). #### Response Example ```json { "results": [ { "name": "Example Restaurant", "address": "456 Example Ave" } ] } ``` ``` -------------------------------- ### maps_around_search Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Performs a nearby search to find Points of Interest (POI) within a specified radius around a given location, based on keywords. ```APIDOC ## maps_around_search ### Description Performs a nearby search to find Points of Interest (POI) within a specified radius around a given location, based on keywords. ### Method POST ### Endpoint /maps/around_search ### Parameters #### Request Body - **keywords** (string) - Required - The search keywords. - **location** (string) - Required - The center coordinates for the search (longitude,latitude). - **radius** (string) - Required - The search radius. ``` -------------------------------- ### maps_ip_location Source: https://github.com/jd-opensource/joyagent-jdgenie/blob/data_agent/genie-client/README.md Determines the geographical location of a given IP address. ```APIDOC ## maps_ip_location ### Description Determines the geographical location of a given IP address. ### Method POST ### Endpoint /maps/ip_location ### Parameters #### Request Body - **ip** (string) - Required - The IP address to locate. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.