package ocaml-ai-sdk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ai_provider_openrouter.Convert_promptSource

include module type of Ai_provider_openai.Convert_prompt
Sourcetype openai_content_part = Ai_provider_openai.Convert_prompt.openai_content_part =
  1. | O_text of {
    1. text : string;
    }
  2. | O_image_url of {
    1. url : string;
    }
Sourcetype openai_function_call = Ai_provider_openai.Convert_prompt.openai_function_call = {
  1. name : string;
  2. arguments : string;
}
Sourcetype openai_tool_call = Ai_provider_openai.Convert_prompt.openai_tool_call = {
  1. id : string;
  2. type_ : string;
  3. function_ : openai_function_call;
}
Sourcetype openai_message = Ai_provider_openai.Convert_prompt.openai_message =
  1. | System_msg of {
    1. content : string;
    }
  2. | Developer_msg of {
    1. content : string;
    }
  3. | User_msg of {
    1. content : openai_content_part list;
    }
  4. | Assistant_msg of {
    1. content : string option;
    2. tool_calls : openai_tool_call list;
    }
  5. | Tool_msg of {
    1. tool_call_id : string;
    2. content : string;
    }

Convert SDK messages to OpenAI format. Returns converted messages and any warnings generated.

Sourceval openai_message_to_json : openai_message -> Yojson.Basic.t

Serialize an OpenAI message to JSON.