Interface WellsOfWisdom

All Known Implementing Classes:
GoogleGeminiWellsOfWisdomOverVertexAI, GooglePalm2WellsOfWisdomOverVertexAI, OllamaWellsOfWisdom, OpenAIWellsOfWisdom

public interface WellsOfWisdom
The WellsOfWisdom interface represents a builder for creating a HTTP request object used for making API requests.
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Request
    buildRequest(Context context, org.json.JSONArray odinMessages, org.json.JSONObject gptSettingsJsonObject)
    Builds a HTTP request based on the provided context and Odin messages.
    okhttp3.Response
    executeRequest(okhttp3.Request request)
    Executes a HTTP request and returns the Response object.
    static String
    A utility function designed to facilitate compliance with the expected return format in the readFromResponseStream method.
    readFromResponseStream(okhttp3.Response response)
    Reads from the Response object.
  • Method Details

    • buildRequest

      okhttp3.Request buildRequest(Context context, org.json.JSONArray odinMessages, org.json.JSONObject gptSettingsJsonObject) throws Exception
      Builds a HTTP request based on the provided context and Odin messages.
      Parameters:
      context - The context containing captured data and user options.
      odinMessages - The messages exchanged between the user and the assistant.
      Returns:
      A built HTTP request object, or null if no new prompt is present.
      Throws:
      Exception
    • executeRequest

      okhttp3.Response executeRequest(okhttp3.Request request)
      Executes a HTTP request and returns the Response object.
      Parameters:
      request - The context containing captured data and user options.
      Returns:
      A built HTTP response object, or null if no response.
    • readFromResponseStream

      String readFromResponseStream(okhttp3.Response response)
      Reads from the Response object.
      Parameters:
      response - The response object.
      Returns:
      A string generated by the gpt provider and read from the HTTP response object.
    • finalStringFormatHelper

      static String finalStringFormatHelper(String model, String contentStr)
      A utility function designed to facilitate compliance with the expected return format in the readFromResponseStream method.
      Parameters:
      model - The GPT model name.
      contentStr - A partial response string from the GPT provider.
      Returns:
      A string formatted appropriately for use as a return value in implementations of the readFromResponseStream method.