|
| 1 | +# iCareer LLM-Graph-Builder对接文档 |
| 2 | +## 简历导入 |
| 3 | +### 使用LLM将简历转换成描述 |
| 4 | +> 使用LLM把简历的json转换成一段描述简历的文字,便于导入数据库。模型使用ecnu-max,prompt如下: |
| 5 | +``` |
| 6 | +请用一段话总结以下JSON格式的简历文件。 |
| 7 | +要求: |
| 8 | +1. **术语标准化** :将JSON中的术语进行标准化,例如使用"Java"替代"Java语言"。 |
| 9 | +2. **主语统一** :每一句的主语必须是简历的所属人(即简历的主人)。 |
| 10 | +3. **格式要求** :语句长度尽可能短。 |
| 11 | +4. **内容完整性** :严格遵照简历中的所有内容进行总结,不要丢失或忽略任何信息。 |
| 12 | +5. **无关信息** :不要输出与简历内容无关的信息。 |
| 13 | +6. **唯一标识符**:输出中需要包含简历所属人的唯一标识符。 |
| 14 | +7. **换行要求**:在每一句话的句号后进行{换行} |
| 15 | +JSON简历文件将在下面给出: |
| 16 | +``` |
| 17 | +### 连接数据库 |
| 18 | +> 使用前需要连接数据库 |
| 19 | +
|
| 20 | +#### POST /connect |
| 21 | +#### Args |
| 22 | +* `uri`= Neo4j uri, |
| 23 | +* `userName`= Neo4j db username, |
| 24 | +* `password`= Neo4j db password, |
| 25 | +* `database`= Neo4j database name |
| 26 | +### 文件上传 |
| 27 | +> 将文件上传到后端,以便于下一步处理 |
| 28 | +#### POST /upload |
| 29 | +#### Args |
| 30 | +* `file`=The file to be uploaded, received in chunks,(Blob) |
| 31 | +* `chunkNumber`=The current chunk number being uploaded, |
| 32 | +* `totalChunks`=The total number of chunks the file is divided into (each chunk of 1Mb size), |
| 33 | +* `originalname`=The original name of the file, |
| 34 | +* `model`=The model associated with the file, |
| 35 | +* `uri`=Neo4j uri, |
| 36 | +* `userName`= Neo4j db username, |
| 37 | +* `password`= Neo4j db password, |
| 38 | +* `database`= Neo4j database name |
| 39 | +### 进行提取 |
| 40 | +> 从文件中提取关系并存入neo4j |
| 41 | +#### POST /extract |
| 42 | +#### Args |
| 43 | +* `uri`=Neo4j uri, |
| 44 | +* `userName`= Neo4j db username, |
| 45 | +* `password`= Neo4j db password, |
| 46 | +* `database`= Neo4j database name |
| 47 | +* `model`= LLM model,(ecnu_ecnu-max) |
| 48 | +* `file_name` = File uploaded from device |
| 49 | +* `source_type` = (local_file) |
| 50 | +* `allowedNodes` = Node labels passed from settings panel. (Person,ContactInfomation,CareerObjective,WorkExperience,IntershipExperience,Skill,SelfAssessment,Award,EducationalBackground,Article,Subject,Year,ID) |
| 51 | +* `allowedRelationship` = Relationship labels passed from settings panel (HAS_CONTACT_INFOMATION,HAS_CAREER_OBJECTIVE,HAS_WORK_EXPERIENCE,HAS_INTERNSHIP_EXPERIENCE,HAS_SKILL,HAS_SELF_ASSESSMENT,HAS_AWARD,AUTHORED_BY,BELONGS_TO,PUBLISHED_IN_YEAR,IDENTIFIED_BY) |
| 52 | +* `retry_condition` = When retry extract use (delete_entities_and_start_from_beginning/start_from_beginning/start_from_last_processed_position). |
| 53 | +### 失败时重试 |
| 54 | +> 提取失败时重试提取 |
| 55 | +#### POST /retry_processing |
| 56 | +#### Args |
| 57 | +* `uri`=Neo4j uri, |
| 58 | +* `userName`= Neo4j db username, |
| 59 | +* `password`= Neo4j db password, |
| 60 | +* `database`= Neo4j database name, |
| 61 | +* `file_name`= Name of the file which user want to Ready to Reprocess. |
| 62 | +* `retry_condition` = One of the above 3 conditions which is selected for reprocessing.(delete_entities_and_start_from_beginning/start_from_beginning/start_from_last_processed_position) |
| 63 | +### 后处理 |
| 64 | +> 提取完成后需要经过后处理才能进行查询 |
| 65 | +#### POST /post_processing |
| 66 | +#### Args |
| 67 | +* `uri`=Neo4j uri, |
| 68 | +* `userName`= Neo4j db username, |
| 69 | +* `password`= Neo4j db password, |
| 70 | +* `database`= Neo4j database name |
| 71 | +* `tasks`= List of tasks to perform(["materialize_text_chunk_similarities","enable_hybrid_search_and_fulltext_search_in_bloom","materialize_entity_similarities","enable_communities"]) |
| 72 | +### 查看任务 |
| 73 | +> 查看正在进行的提取 |
| 74 | +#### POST /sources_list |
| 75 | +#### Args |
| 76 | +* `uri`=Neo4j uri, |
| 77 | +* `userName`= Neo4j db username, |
| 78 | +* `password`= Neo4j db password, |
| 79 | +* `database`= Neo4j database name |
| 80 | +### 更新进度 |
| 81 | +> 查看正在进行的提取的进度,可能用到了SSE,没跑通 |
| 82 | +#### GET /update_extract_status/{file_name} |
| 83 | +#### Args |
| 84 | +* `uri`=Neo4j uri, |
| 85 | +* `userName`= Neo4j db username, |
| 86 | +* `password`= Neo4j db password, |
| 87 | +* `database`= Neo4j database name |
| 88 | +## 进行查询 |
| 89 | +### 聊天接口 |
| 90 | +> 通用聊天接口 |
| 91 | +#### POST /chat_bot |
| 92 | +#### Args |
| 93 | +* `uri`= neo4j uri |
| 94 | +* `userName`= Neo4j database username |
| 95 | +* `password`= Neo4j database password |
| 96 | +* `model`= LLM model(ecnu_ecnu-reasoner/ecnu_ecnu-reasoner-lite) |
| 97 | +* `question`= User query for the chatbot |
| 98 | +* `session_id`= Session ID used to maintain the history of chats during the user's connection (UUID,由前端生成,用来区分不同用户的上下文) |
| 99 | +* `mode` = chat mode to use (graph_vector_fulltext(经过测试)/vector/graph/graph_vector/fulltext/entity_vector/global_vector) |
| 100 | +* `document_names` = the names of documents to be filtered works for vector mode and vector+Graph mode |
| 101 | +## 备注 |
| 102 | +> 示例的响应参见postman的导出文件 |
0 commit comments