When working with static corpuses, you can apply the following types of transforms:
- Query transforms to fine-tune the AI-Native Interface reasoning and refine its decision-making logic
- Output transforms to modify and format responses provided by the AI-Native Interface
Query transforms
Query transforms used with static corpuses allow you to refine the AI-Native Interface's decision-making and direct it to the appropriate data corpus. To adjust the AI reasoning process, you can:
- Instruct the AI-Native Interface which corpus to use for particular types of queries
- Instruct the AI-Native Interface to omit specific data corpuses
Example of use
Assume you have two corpuses that provide information about HTTP requests:
HTTP basicsHTTP status codes
corpus({
title: `HTTP basics`,
urls: [`https://www.tutorialspoint.com/http/http_responses.htm`],
depth: 1,
maxPages: 10,
priority: 1,
});
corpus({
title: `HTTP status codes`,
urls: [`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status`],
depth: 1,
maxPages: 1,
priority: 2,
});The AI-Native Interface should retrieve information from corpuses in the following way:
- If the user asks question about status codes, the AI-Native Interface should use the
HTTP status codescorpus. - For all other questions, the AI-Native Interface should refer to the
HTTP basicscorpus.
Output transforms
Assume you want the AI-Native Interface to format responses in a specific way. For this, you can do the following:
- To the dialog script, add the
corpus()function, specify the data source and name of the transform that will be used to format the answer. In this example, we will use a transform namedoutput.corpus({ urls: [ `https://developer.mozilla.org/en-US/docs/Web/HTTP/Status`, ], transforms: transforms.output, maxPages: 3, depth: 1 }); - In the AI-Native Interface project, under Transforms, create the
outputtransform with the appropriate instructions and examples. - Use the Debugging Chat to test your transforms and refine them using the Transforms Explorer.