CN-122019583-A - Information generation method, apparatus, electronic device, storage medium, and program product
Abstract
The application discloses an information generation method, an information generation device, electronic equipment, a storage medium and a program product, and relates to the technical field of computers; and in response to the target processing unit being retrieved from the at least one candidate processing unit, calling the target processing unit to execute an information query process to generate target information matched with the information query request. By implementing the technical scheme of the application, accurate and efficient retrieval and calling of the processing unit can be realized, so that accurate information is generated according to the information inquiry request.
Inventors
- LIU JIALIN
- LI ZHAOMING
- CHEN MIAORONG
- CHEN JINHAI
Assignees
- 杭州网易云音乐科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251204
Claims (10)
- 1. An information generation method, the method comprising: Determining at least one candidate processing unit matched with an information inquiry request triggered by a target object; Retrieving a target processing unit from the at least one candidate processing unit based on attribute description information corresponding to the candidate processing unit and the information query request; And in response to retrieving the target processing unit from the at least one candidate processing unit, invoking the target processing unit to execute an information query process, and generating target information matched with the information query request.
- 2. The method of claim 1, wherein the determining at least one candidate processing unit that matches the information query request in response to the information query request triggered by the target object comprises: Responding to an information inquiry request triggered by the target object, and converting the information inquiry request into vector representation to obtain an information inquiry vector; Obtaining index information pre-constructed based on a model context protocol, wherein the index information comprises a plurality of index vectors; And determining the at least one candidate processing unit based on the semantic similarity between the information query vector and each index vector.
- 3. The method according to claim 2, wherein the obtaining the index information pre-constructed based on the model context protocol comprises: Acquiring metadata information of a first processing unit based on the model context protocol, wherein the metadata information comprises data processing description information; converting the data processing description information into vector representation to obtain data processing description vectors corresponding to the first processing units; And associating the data processing description vector with the corresponding metadata information to generate the index information.
- 4. The method of claim 3, wherein the metadata information comprises an information classification tag, wherein the determining at least one candidate processing unit that matches the information query request in response to the information query request triggered by the target object further comprises: acquiring a target classification label corresponding to the information inquiry request; Determining the matching degree between the target classification label and each information classification label; Determining semantic similarity between an information query vector corresponding to the information query request and each index vector in the index information; and selecting at least one second processing unit from the index information based on the semantic similarity and the matching degree, and determining the second processing unit as the candidate processing unit.
- 5. The method of claim 4, wherein the information classification tag generation process comprises: And generating an information classification label corresponding to the metadata information in response to the classification editing operation for the metadata information.
- 6. The method of claim 1, wherein the retrieving the target processing unit from the at least one candidate processing unit based on the attribute description information corresponding to the candidate processing unit and the information query request comprises: converting the attribute description information corresponding to each candidate processing unit into a target calling format to obtain target attribute description information; Determining a target processing unit from the at least one candidate processing unit based on the target attribute description information and the information query request; Wherein the target call format includes at least one of a processing unit name, a processing unit description, and a parameter schema.
- 7. An information generating apparatus, characterized in that the apparatus comprises: the determining module is used for responding to an information inquiry request triggered by a target object and determining at least one candidate processing unit matched with the information inquiry request; the retrieval module is used for retrieving a target processing unit from the at least one candidate processing unit based on the attribute description information corresponding to the candidate processing unit and the information query request; and the generating module is used for calling the target processing unit to execute an information query process in response to the target processing unit retrieved from the at least one candidate processing unit, and generating target information matched with the information query request.
- 8. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the information generating method of any of claims 1 to 6.
- 9. A computer-readable storage medium having stored thereon computer instructions for causing a computer to execute the information generation method of any one of claims 1 to 6.
- 10. A computer program product comprising computer instructions for causing a computer to perform the information generating method of any one of claims 1 to 6.
Description
Information generation method, apparatus, electronic device, storage medium, and program product Technical Field The present application relates to the field of computer technology, and in particular, to an information generating method, an apparatus, an electronic device, a storage medium, and a program product. Background Currently, in large language model (Large Language Model, LLM) based intelligent application implementations, it is common practice to provide the model with definition information for all tools or services accessed at once to support their tool invocation when processing user requests. However, as the number of tools integrated by an application continues to increase, inputting all tool information to a model as a context at the same time tends to cause the hint word length to exceed the upper model processing limit, thereby affecting processing efficiency. In addition, when a plurality of tools with similar functions and only differences in detail exist in the system, the judgment of the model can be interfered by loading excessive tool information at one time, the difficulty of selection and matching is increased, and the accuracy and reliability of the generated result are challenged. Disclosure of Invention In view of the above, the present application provides an information generating method, apparatus, electronic device, storage medium and program product, so as to solve the problem of insufficient information processing efficiency and accuracy in the related art. In a first aspect, the application provides an information generation method, which comprises the steps of responding to an information query request triggered by a target object, determining at least one candidate processing unit matched with the information query request, retrieving the target processing unit from the at least one candidate processing unit based on attribute description information corresponding to the candidate processing unit and the information query request, and calling the target processing unit to execute an information query process in response to retrieving the target processing unit from the at least one candidate processing unit to generate target information matched with the information query request. In an alternative implementation manner, the method for determining at least one candidate processing unit matched with the information query request in response to the information query request triggered by the target object comprises the steps of converting the information query request into vector representations in response to the information query request triggered by the target object to obtain information query vectors, obtaining index information pre-constructed based on a model context protocol, wherein the index information comprises a plurality of index vectors, and determining the at least one candidate processing unit based on semantic similarity between the information query vectors and each index vector. In an alternative embodiment, obtaining the index information pre-constructed based on the model context protocol comprises obtaining metadata information of first processing units based on the model context protocol, wherein the metadata information comprises data processing description information, converting the data processing description information into vector representations to obtain data processing description vectors corresponding to the first processing units, and associating the data processing description vectors with the corresponding metadata information to generate the index information. In an alternative implementation mode, the metadata information comprises information classification labels, at least one candidate processing unit which is matched with the information query request is determined in response to the information query request triggered by the target object, the method further comprises the steps of obtaining the target classification labels corresponding to the information query request, determining the matching degree between the target classification labels and each information classification label, determining the semantic similarity between information query vectors corresponding to the information query request and each index vector in the index information, selecting at least one second processing unit from the index information based on the semantic similarity and the matching degree, and determining the second processing unit as the candidate processing unit. In an alternative embodiment, the generation process of the information classification label comprises the step of responding to the classification editing operation for the metadata information to generate the information classification label corresponding to the metadata information. In an alternative implementation mode, the target processing unit is retrieved from at least one candidate processing unit based on the attribute description information corresponding to the candidate p