Chatoyant_provider.AnthropicSourceRaw Anthropic Messages API request shapes.
type cache_control = | Ephemeral_cache of cache_ttl option| Raw_cache_control of Chatoyant_runtime.Json.tPrompt caching marker. Anthropic accepts cache_control at the request top level, on cacheable content blocks, and on tool definitions.
type content_block = | Text of string| Cached_block of {block : content_block;cache_control : cache_control;}| Thinking of string| Redacted_thinking of string| Tool_use of {id : string;name : string;input : Chatoyant_runtime.Json.t;}| Tool_result of {}| Server_tool_use of {id : string;name : string;input : Chatoyant_runtime.Json.t;raw : Chatoyant_runtime.Json.t;}| Web_search_tool_result of {tool_use_id : string;content : Chatoyant_runtime.Json.t;raw : Chatoyant_runtime.Json.t;}| Web_fetch_tool_result of {tool_use_id : string;content : Chatoyant_runtime.Json.t;raw : Chatoyant_runtime.Json.t;}| Code_execution_tool_result of {tool_use_id : string;content : Chatoyant_runtime.Json.t;raw : Chatoyant_runtime.Json.t;}| Container_upload of {file_id : string option;raw : Chatoyant_runtime.Json.t;}| Raw_block of Chatoyant_runtime.Json.ttype tool = {tool_name : string;tool_description : string option;input_schema : Chatoyant_runtime.Json.t;tool_cache_control : cache_control option;}type request = {model : string;messages : message list;system : string option;system_blocks : content_block list;max_tokens : int;stream : bool;temperature : float option;top_p : float option;top_k : int option;stop_sequences : string list;metadata_user_id : string option;tools : tool list;tool_choice : tool_choice option;thinking : thinking option;cache_control : cache_control option;extra : (string * Chatoyant_runtime.Json.t) list;}type response = {response_id : string option;response_model : string option;response_role : role option;response_content : content_block list;response_stop_reason : stop_reason option;response_stop_sequence : string option;response_usage : usage;response_raw : Chatoyant_runtime.Json.t;}type api_error = {error_type : string option;error_message : string;error_raw : Chatoyant_runtime.Json.t option;}type model = {model_id : string;model_display_name : string option;model_created_at : string option;model_type : string option;model_raw : Chatoyant_runtime.Json.t;}type model_list = {models : model list;first_id : string option;last_id : string option;has_more : bool;raw : Chatoyant_runtime.Json.t;}type message_batch = {batch_id : string;batch_type : string option;processing_status : batch_status;request_counts : batch_counts;ended_at : string option;created_at : string option;expires_at : string option;archived_at : string option;cancel_initiated_at : string option;results_url : string option;raw : Chatoyant_runtime.Json.t;}type batch_list = {batches : message_batch list;first_id : string option;last_id : string option;has_more : bool;raw : Chatoyant_runtime.Json.t;}type batch_result = | Batch_succeeded of response| Batch_errored of api_error| Batch_canceled| Batch_expired| Batch_unknown of Chatoyant_runtime.Json.ttype batch_result_line = {result_custom_id : string;result : batch_result;result_raw : Chatoyant_runtime.Json.t;}type file_metadata = {file_id : string;file_type : string option;filename : string option;mime_type : string option;size_bytes : int option;created_at : string option;downloadable : bool option;file_raw : Chatoyant_runtime.Json.t;}type file_list = {files : file_metadata list;first_id : string option;last_id : string option;has_more : bool;raw : Chatoyant_runtime.Json.t;}type file_delete = {deleted_file_id : string option;deleted : bool;raw : Chatoyant_runtime.Json.t;}type stream_delta = | Text_delta of string| Thinking_delta of string| Signature_delta of string| Input_json_delta of string| Unknown_delta of Chatoyant_runtime.Json.ttype stream_event = | Message_start of response| Content_block_start of {index : int;block : content_block;}| Content_block_delta of {index : int;delta : stream_delta;}| Content_block_stop of int| Message_delta of {stop_reason : stop_reason option;stop_sequence : string option;usage : usage;}| Message_stop| Ping| Error of api_error| Unknown_event of {event_type : string option;raw : Chatoyant_runtime.Json.t;}val web_search_tool_json :
?name:string ->
?cache_control:cache_control ->
?max_uses:int ->
?allowed_domains:string list ->
?blocked_domains:string list ->
?user_location:Chatoyant_runtime.Json.t ->
unit ->
Chatoyant_runtime.Json.tval web_fetch_tool_json :
?name:string ->
?cache_control:cache_control ->
unit ->
Chatoyant_runtime.Json.tval code_execution_tool_json :
?name:string ->
?cache_control:cache_control ->
unit ->
Chatoyant_runtime.Json.tval request_json_with_raw_tools :
request ->
Chatoyant_runtime.Json.t list ->
Chatoyant_runtime.Json.tmodule Make_provider
(Http : Chatoyant_runtime.Effect.HTTP)
(Config : sig ... end) :
Provider.CHAT