Set a provider for embedding model

  • Freigeben Version: Australia
  • Aktualisiert 12. März 2026
  • 1 Minute Lesedauer
  • Determine which AI provider to use for your embedding model to work in the AI Search RAG application.

    Vorbereitungen

    Configure a connection and credential alias for your preferred provider. See Create a Connection & Credential alias.

    Role required: admin

    Prozedur

    1. Navigate to All, and then enter sys_one_extend_capability.list in the filter to go to the OneExtend Capabilities table.
    2. Select the Bring Your Own Embedding Model capability to configure.
    3. In the OneExtend Capability Definitions related list, select New.
    4. In the Name field, enter the name of the capability definition.
    5. In the API type field, select system.
    6. In the API field, select the search icon to select the document.
      1. In the Table name field, select One API System Executor [one_api_system_executor].
      2. In the Document field, select Generic Embedder.
      3. Select OK.
    7. In the Connection And Credential Alias, select the alias that you want to integrate with your custom embedding model.
    8. Select the Advanced option.
    9. Write pre-processing and post-processing scripts.
      To have AI Search RAG application understand the format of the inputs and outputs of your embedding model, you must write pre-processing and post-processing scripts. These scripts depend on the expected request and response objects that are interpreted by your model.

      For example, the Azure OpenAI request structure looks like the following script:

      {"messages": [{"role":"user", "content":"Summarize the following text: <<content>>"}], "max_tokens": 800, "temperature": 0.7}
      The preprocessor script for that request structure is the following script:
      (function(inputs) {
          /* write code here to transform capability input to definition input.*/     
      	     
      	inputs = JSON.parse(inputs);     
      	     
      	return inputs;     
      })(inputs);
      The response structure from Azure OpenAI looks like this script: <tbd>
      {
          "choices": [{
          "finish_reason": "stop",
          "index": 0,
          "message": {
              "content": "<<response>>",
              "role": "assistant"
              }
          }],
          "created": 1714994995,
          "id": "chatcmpl-9LqpXeLVXDAi6kciPfLeIDjmALeea",
          "model": "gpt-35-turbo-16k",
          "object": "chat.completion",
          "usage": {    
              "completion_tokens": 47,
              "prompt_tokens": 70,
              "total_tokens": 117
          }
      }
      Because of that response structure, the response postprocessor script looks like this script:
      (function(inputs) {
          /* write code here to transform definition output to capability output.*/ to transform the llm response into an array of text responses, using the inputs object
          inputs structure: {
              inputs = JSON.parse(inputs);     
      	     
      	return inputs;   
      
      })(inputs);
    10. Select Submit.