-module(glopenai@vector_store). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/glopenai/vector_store.gleam"). -export([static_chunking_strategy_to_json/1, static_chunking_strategy_decoder/0, comparison_type_to_json/1, comparison_type_decoder/0, compound_type_to_json/1, compound_type_decoder/0, filter_to_json/1, vector_store_status_to_json/1, vector_store_status_decoder/0, vector_store_file_counts_to_json/1, vector_store_file_counts_decoder/0, vector_store_expiration_after_to_json/1, vector_store_expiration_after_decoder/0, vector_store_object_decoder/0, chunking_strategy_request_param_to_json/1, chunking_strategy_request_param_decoder/0, chunking_strategy_response_to_json/1, chunking_strategy_response_decoder/0, vector_store_file_status_to_json/1, vector_store_file_status_decoder/0, vector_store_file_error_code_decoder/0, attribute_value_to_json/1, attribute_value_decoder/0, vector_store_file_attributes_to_json/1, vector_store_file_attributes_decoder/0, vector_store_file_object_decoder/0, vector_store_file_batch_status_decoder/0, vector_store_search_query_to_json/1, ranker_to_json/1, ranker_decoder/0, ranking_options_to_json/1, ranking_options_decoder/0, new_create_request/0, with_file_ids/2, with_name/2, with_description/2, with_expires_after/2, with_chunking_strategy/2, with_metadata/2, create_vector_store_request_to_json/1, new_update_request/0, update_with_name/2, update_with_expires_after/2, update_with_metadata/2, update_vector_store_request_to_json/1, new_create_file_request/1, file_with_chunking_strategy/2, file_with_attributes/2, create_vector_store_file_request_to_json/1, update_vector_store_file_attributes_request_to_json/1, new_create_file_batch_request/0, batch_with_file_ids/2, batch_with_files/2, batch_with_chunking_strategy/2, batch_with_attributes/2, create_vector_store_file_batch_request_to_json/1, new_search_request/1, search_with_rewrite_query/2, search_with_max_num_results/2, search_with_filters/2, search_with_ranking_options/2, vector_store_search_request_to_json/1, empty_list_vector_stores_query/0, empty_list_vector_store_files_query/0, empty_list_files_in_vector_store_batch_query/0, create_request/2, create_response/1, retrieve_request/2, retrieve_response/1, list_request/1, list_request_with_query/2, list_response/1, delete_request/2, delete_response/1, update_request/3, update_response/1, search_request/3, search_response/1, file_create_request/3, file_create_response/1, file_retrieve_request/3, file_retrieve_response/1, file_delete_request/3, file_delete_response/1, file_list_request/2, file_list_request_with_query/3, file_list_response/1, file_update_request/4, file_update_response/1, file_content_request/3, file_content_response/1, batch_create_request/3, batch_create_response/1, batch_retrieve_request/3, batch_retrieve_response/1, batch_cancel_request/3, batch_cancel_response/1, batch_list_files_request/3, batch_list_files_request_with_query/4, batch_list_files_response/1, filter_decoder/0]). -export_type([static_chunking_strategy/0, filter/0, comparison_filter_record/0, comparison_type/0, compound_filter_record/0, compound_type/0, vector_store_status/0, vector_store_file_counts/0, vector_store_expiration_after/0, vector_store_object/0, list_vector_stores_response/0, delete_vector_store_response/0, chunking_strategy_request_param/0, chunking_strategy_response/0, vector_store_file_status/0, vector_store_file_error_code/0, vector_store_file_error/0, attribute_value/0, vector_store_file_object/0, list_vector_store_files_response/0, delete_vector_store_file_response/0, vector_store_file_batch_status/0, vector_store_file_batch_counts/0, vector_store_file_batch_object/0, vector_store_file_content_object/0, vector_store_file_content_response/0, vector_store_search_query/0, ranker/0, ranking_options/0, vector_store_search_result_content_object/0, vector_store_search_result_item/0, vector_store_search_results_page/0, create_vector_store_request/0, update_vector_store_request/0, create_vector_store_file_request/0, update_vector_store_file_attributes_request/0, create_vector_store_file_batch_request/0, vector_store_search_request/0, list_order/0, list_vector_stores_query/0, list_files_filter/0, list_vector_store_files_query/0, list_files_in_vector_store_batch_query/0]). -type static_chunking_strategy() :: {static_chunking_strategy, integer(), integer()}. -type filter() :: {comparison_filter, comparison_filter_record()} | {compound_filter, compound_filter_record()}. -type comparison_filter_record() :: {comparison_filter_record, comparison_type(), binary(), gleam@dynamic:dynamic_()}. -type comparison_type() :: equals | not_equals | greater_than | greater_than_or_equal | less_than | less_than_or_equal | in | not_in. -type compound_filter_record() :: {compound_filter_record, compound_type(), list(filter())}. -type compound_type() :: 'and' | 'or'. -type vector_store_status() :: store_expired | store_in_progress | store_completed. -type vector_store_file_counts() :: {vector_store_file_counts, integer(), integer(), integer(), integer(), integer()}. -type vector_store_expiration_after() :: {vector_store_expiration_after, binary(), integer()}. -type vector_store_object() :: {vector_store_object, binary(), binary(), integer(), gleam@option:option(binary()), integer(), vector_store_file_counts(), vector_store_status(), gleam@option:option(vector_store_expiration_after()), gleam@option:option(integer()), gleam@option:option(integer()), gleam@option:option(gleam@dict:dict(binary(), binary()))}. -type list_vector_stores_response() :: {list_vector_stores_response, binary(), list(vector_store_object()), gleam@option:option(binary()), gleam@option:option(binary()), boolean()}. -type delete_vector_store_response() :: {delete_vector_store_response, binary(), binary(), boolean()}. -type chunking_strategy_request_param() :: auto_chunking | {static_chunking, static_chunking_strategy()}. -type chunking_strategy_response() :: other_chunking | {static_chunking_response, static_chunking_strategy()}. -type vector_store_file_status() :: file_in_progress | file_completed | file_cancelled | file_failed. -type vector_store_file_error_code() :: server_error | unsupported_file | invalid_file. -type vector_store_file_error() :: {vector_store_file_error, vector_store_file_error_code(), binary()}. -type attribute_value() :: {attribute_string, binary()} | {attribute_number, integer()} | {attribute_boolean, boolean()}. -type vector_store_file_object() :: {vector_store_file_object, binary(), binary(), integer(), integer(), binary(), vector_store_file_status(), gleam@option:option(vector_store_file_error()), gleam@option:option(chunking_strategy_response()), gleam@option:option(gleam@dict:dict(binary(), attribute_value()))}. -type list_vector_store_files_response() :: {list_vector_store_files_response, binary(), list(vector_store_file_object()), gleam@option:option(binary()), gleam@option:option(binary()), boolean()}. -type delete_vector_store_file_response() :: {delete_vector_store_file_response, binary(), binary(), boolean()}. -type vector_store_file_batch_status() :: batch_in_progress | batch_completed | batch_cancelled | batch_failed. -type vector_store_file_batch_counts() :: {vector_store_file_batch_counts, integer(), integer(), integer(), integer(), integer()}. -type vector_store_file_batch_object() :: {vector_store_file_batch_object, binary(), binary(), integer(), binary(), vector_store_file_batch_status(), vector_store_file_batch_counts()}. -type vector_store_file_content_object() :: {vector_store_file_content_object, binary(), binary()}. -type vector_store_file_content_response() :: {vector_store_file_content_response, binary(), list(vector_store_file_content_object()), boolean(), gleam@option:option(binary())}. -type vector_store_search_query() :: {text_query, binary()} | {array_query, list(binary())}. -type ranker() :: ranker_none | ranker_auto | ranker_default20241115. -type ranking_options() :: {ranking_options, gleam@option:option(ranker()), gleam@option:option(float())}. -type vector_store_search_result_content_object() :: {vector_store_search_result_content_object, binary(), binary()}. -type vector_store_search_result_item() :: {vector_store_search_result_item, binary(), binary(), float(), gleam@dict:dict(binary(), attribute_value()), list(vector_store_search_result_content_object())}. -type vector_store_search_results_page() :: {vector_store_search_results_page, binary(), list(binary()), list(vector_store_search_result_item()), boolean(), gleam@option:option(binary())}. -type create_vector_store_request() :: {create_vector_store_request, gleam@option:option(list(binary())), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(vector_store_expiration_after()), gleam@option:option(chunking_strategy_request_param()), gleam@option:option(gleam@dict:dict(binary(), binary()))}. -type update_vector_store_request() :: {update_vector_store_request, gleam@option:option(binary()), gleam@option:option(vector_store_expiration_after()), gleam@option:option(gleam@dict:dict(binary(), binary()))}. -type create_vector_store_file_request() :: {create_vector_store_file_request, binary(), gleam@option:option(chunking_strategy_request_param()), gleam@option:option(gleam@dict:dict(binary(), attribute_value()))}. -type update_vector_store_file_attributes_request() :: {update_vector_store_file_attributes_request, gleam@dict:dict(binary(), attribute_value())}. -type create_vector_store_file_batch_request() :: {create_vector_store_file_batch_request, gleam@option:option(list(binary())), gleam@option:option(list(create_vector_store_file_request())), gleam@option:option(chunking_strategy_request_param()), gleam@option:option(gleam@dict:dict(binary(), attribute_value()))}. -type vector_store_search_request() :: {vector_store_search_request, vector_store_search_query(), gleam@option:option(boolean()), gleam@option:option(integer()), gleam@option:option(filter()), gleam@option:option(ranking_options())}. -type list_order() :: asc | desc. -type list_vector_stores_query() :: {list_vector_stores_query, gleam@option:option(integer()), gleam@option:option(list_order()), gleam@option:option(binary()), gleam@option:option(binary())}. -type list_files_filter() :: filter_in_progress | filter_completed | filter_failed | filter_cancelled. -type list_vector_store_files_query() :: {list_vector_store_files_query, gleam@option:option(integer()), gleam@option:option(list_order()), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(list_files_filter())}. -type list_files_in_vector_store_batch_query() :: {list_files_in_vector_store_batch_query, gleam@option:option(integer()), gleam@option:option(list_order()), gleam@option:option(binary()), gleam@option:option(binary()), gleam@option:option(list_files_filter())}. -file("src/glopenai/vector_store.gleam", 37). -spec static_chunking_strategy_to_json(static_chunking_strategy()) -> gleam@json:json(). static_chunking_strategy_to_json(Strategy) -> gleam@json:object( [{<<"max_chunk_size_tokens"/utf8>>, gleam@json:int(erlang:element(2, Strategy))}, {<<"chunk_overlap_tokens"/utf8>>, gleam@json:int(erlang:element(3, Strategy))}] ). -file("src/glopenai/vector_store.gleam", 46). -spec static_chunking_strategy_decoder() -> gleam@dynamic@decode:decoder(static_chunking_strategy()). static_chunking_strategy_decoder() -> gleam@dynamic@decode:field( <<"max_chunk_size_tokens"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Max_chunk_size_tokens) -> gleam@dynamic@decode:field( <<"chunk_overlap_tokens"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Chunk_overlap_tokens) -> gleam@dynamic@decode:success( {static_chunking_strategy, Max_chunk_size_tokens, Chunk_overlap_tokens} ) end ) end ). -file("src/glopenai/vector_store.gleam", 96). -spec comparison_type_to_json(comparison_type()) -> gleam@json:json(). comparison_type_to_json(Comparison_type) -> gleam@json:string(case Comparison_type of equals -> <<"eq"/utf8>>; not_equals -> <<"ne"/utf8>>; greater_than -> <<"gt"/utf8>>; greater_than_or_equal -> <<"gte"/utf8>>; less_than -> <<"lt"/utf8>>; less_than_or_equal -> <<"lte"/utf8>>; in -> <<"in"/utf8>>; not_in -> <<"nin"/utf8>> end). -file("src/glopenai/vector_store.gleam", 109). -spec comparison_type_decoder() -> gleam@dynamic@decode:decoder(comparison_type()). comparison_type_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"eq"/utf8>> -> gleam@dynamic@decode:success(equals); <<"ne"/utf8>> -> gleam@dynamic@decode:success(not_equals); <<"gt"/utf8>> -> gleam@dynamic@decode:success(greater_than); <<"gte"/utf8>> -> gleam@dynamic@decode:success(greater_than_or_equal); <<"lt"/utf8>> -> gleam@dynamic@decode:success(less_than); <<"lte"/utf8>> -> gleam@dynamic@decode:success(less_than_or_equal); <<"in"/utf8>> -> gleam@dynamic@decode:success(in); <<"nin"/utf8>> -> gleam@dynamic@decode:success(not_in); _ -> gleam@dynamic@decode:failure( equals, <<"ComparisonType"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 124). -spec compound_type_to_json(compound_type()) -> gleam@json:json(). compound_type_to_json(Compound_type) -> gleam@json:string(case Compound_type of 'and' -> <<"and"/utf8>>; 'or' -> <<"or"/utf8>> end). -file("src/glopenai/vector_store.gleam", 131). -spec compound_type_decoder() -> gleam@dynamic@decode:decoder(compound_type()). compound_type_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"and"/utf8>> -> gleam@dynamic@decode:success('and'); <<"or"/utf8>> -> gleam@dynamic@decode:success('or'); _ -> gleam@dynamic@decode:failure('and', <<"CompoundType"/utf8>>) end end ). -file("src/glopenai/vector_store.gleam", 140). -spec filter_to_json(filter()) -> gleam@json:json(). filter_to_json(Filter) -> case Filter of {comparison_filter, Record} -> gleam@json:object( [{<<"type"/utf8>>, comparison_type_to_json(erlang:element(2, Record))}, {<<"key"/utf8>>, gleam@json:string(erlang:element(3, Record))}, {<<"value"/utf8>>, glopenai_codec_ffi:dynamic_to_json( erlang:element(4, Record) )}] ); {compound_filter, Record@1} -> gleam@json:object( [{<<"type"/utf8>>, compound_type_to_json(erlang:element(2, Record@1))}, {<<"filters"/utf8>>, gleam@json:array( erlang:element(3, Record@1), fun filter_to_json/1 )}] ) end. -file("src/glopenai/vector_store.gleam", 160). -spec comparison_filter_decoder() -> gleam@dynamic@decode:decoder(filter()). comparison_filter_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, comparison_type_decoder(), fun(Comparison_type) -> gleam@dynamic@decode:field( <<"key"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Key) -> gleam@dynamic@decode:field( <<"value"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_dynamic/1}, fun(Value) -> gleam@dynamic@decode:success( {comparison_filter, {comparison_filter_record, Comparison_type, Key, Value}} ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 194). -spec vector_store_status_to_json(vector_store_status()) -> gleam@json:json(). vector_store_status_to_json(Status) -> gleam@json:string(case Status of store_expired -> <<"expired"/utf8>>; store_in_progress -> <<"in_progress"/utf8>>; store_completed -> <<"completed"/utf8>> end). -file("src/glopenai/vector_store.gleam", 202). -spec vector_store_status_decoder() -> gleam@dynamic@decode:decoder(vector_store_status()). vector_store_status_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"expired"/utf8>> -> gleam@dynamic@decode:success(store_expired); <<"in_progress"/utf8>> -> gleam@dynamic@decode:success(store_in_progress); <<"completed"/utf8>> -> gleam@dynamic@decode:success(store_completed); _ -> gleam@dynamic@decode:failure( store_in_progress, <<"VectorStoreStatus"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 222). -spec vector_store_file_counts_to_json(vector_store_file_counts()) -> gleam@json:json(). vector_store_file_counts_to_json(Counts) -> gleam@json:object( [{<<"in_progress"/utf8>>, gleam@json:int(erlang:element(2, Counts))}, {<<"completed"/utf8>>, gleam@json:int(erlang:element(3, Counts))}, {<<"failed"/utf8>>, gleam@json:int(erlang:element(4, Counts))}, {<<"cancelled"/utf8>>, gleam@json:int(erlang:element(5, Counts))}, {<<"total"/utf8>>, gleam@json:int(erlang:element(6, Counts))}] ). -file("src/glopenai/vector_store.gleam", 234). -spec vector_store_file_counts_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_counts()). vector_store_file_counts_decoder() -> gleam@dynamic@decode:field( <<"in_progress"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(In_progress) -> gleam@dynamic@decode:field( <<"completed"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Completed) -> gleam@dynamic@decode:field( <<"failed"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Failed) -> gleam@dynamic@decode:field( <<"cancelled"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Cancelled) -> gleam@dynamic@decode:field( <<"total"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Total) -> gleam@dynamic@decode:success( {vector_store_file_counts, In_progress, Completed, Failed, Cancelled, Total} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 256). -spec vector_store_expiration_after_to_json(vector_store_expiration_after()) -> gleam@json:json(). vector_store_expiration_after_to_json(Expiration) -> gleam@json:object( [{<<"anchor"/utf8>>, gleam@json:string(erlang:element(2, Expiration))}, {<<"days"/utf8>>, gleam@json:int(erlang:element(3, Expiration))}] ). -file("src/glopenai/vector_store.gleam", 265). -spec vector_store_expiration_after_decoder() -> gleam@dynamic@decode:decoder(vector_store_expiration_after()). vector_store_expiration_after_decoder() -> gleam@dynamic@decode:field( <<"anchor"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Anchor) -> gleam@dynamic@decode:field( <<"days"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Days) -> gleam@dynamic@decode:success( {vector_store_expiration_after, Anchor, Days} ) end ) end ). -file("src/glopenai/vector_store.gleam", 289). -spec vector_store_object_decoder() -> gleam@dynamic@decode:decoder(vector_store_object()). vector_store_object_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"created_at"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:optional_field( <<"name"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Name) -> gleam@dynamic@decode:field( <<"usage_bytes"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Usage_bytes) -> gleam@dynamic@decode:field( <<"file_counts"/utf8>>, vector_store_file_counts_decoder( ), fun(File_counts) -> gleam@dynamic@decode:field( <<"status"/utf8>>, vector_store_status_decoder( ), fun(Status) -> gleam@dynamic@decode:optional_field( <<"expires_after"/utf8>>, none, gleam@dynamic@decode:optional( vector_store_expiration_after_decoder( ) ), fun( Expires_after ) -> gleam@dynamic@decode:optional_field( <<"expires_at"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_int/1} ), fun( Expires_at ) -> gleam@dynamic@decode:optional_field( <<"last_active_at"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_int/1} ), fun( Last_active_at ) -> gleam@dynamic@decode:optional_field( <<"metadata"/utf8>>, none, gleam@dynamic@decode:optional( gleam@dynamic@decode:dict( {decoder, fun gleam@dynamic@decode:decode_string/1}, {decoder, fun gleam@dynamic@decode:decode_string/1} ) ), fun( Metadata ) -> gleam@dynamic@decode:success( {vector_store_object, Id, Object, Created_at, Name, Usage_bytes, File_counts, Status, Expires_after, Expires_at, Last_active_at, Metadata} ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 349). -spec list_vector_stores_response_decoder() -> gleam@dynamic@decode:decoder(list_vector_stores_response()). list_vector_stores_response_decoder() -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"data"/utf8>>, gleam@dynamic@decode:list(vector_store_object_decoder()), fun(Data) -> gleam@dynamic@decode:optional_field( <<"first_id"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(First_id) -> gleam@dynamic@decode:optional_field( <<"last_id"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Last_id) -> gleam@dynamic@decode:field( <<"has_more"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Has_more) -> gleam@dynamic@decode:success( {list_vector_stores_response, Object, Data, First_id, Last_id, Has_more} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 378). -spec delete_vector_store_response_decoder() -> gleam@dynamic@decode:decoder(delete_vector_store_response()). delete_vector_store_response_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"deleted"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Deleted) -> gleam@dynamic@decode:success( {delete_vector_store_response, Id, Object, Deleted} ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 399). -spec chunking_strategy_request_param_to_json(chunking_strategy_request_param()) -> gleam@json:json(). chunking_strategy_request_param_to_json(Strategy) -> case Strategy of auto_chunking -> gleam@json:object( [{<<"type"/utf8>>, gleam@json:string(<<"auto"/utf8>>)}] ); {static_chunking, Config} -> gleam@json:object( [{<<"type"/utf8>>, gleam@json:string(<<"static"/utf8>>)}, {<<"static"/utf8>>, static_chunking_strategy_to_json(Config)}] ) end. -file("src/glopenai/vector_store.gleam", 412). -spec chunking_strategy_request_param_decoder() -> gleam@dynamic@decode:decoder(chunking_strategy_request_param()). chunking_strategy_request_param_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Tag) -> case Tag of <<"auto"/utf8>> -> gleam@dynamic@decode:success(auto_chunking); <<"static"/utf8>> -> gleam@dynamic@decode:field( <<"static"/utf8>>, static_chunking_strategy_decoder(), fun(Config) -> gleam@dynamic@decode:success( {static_chunking, Config} ) end ); _ -> gleam@dynamic@decode:failure( auto_chunking, <<"ChunkingStrategyRequestParam"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 433). -spec chunking_strategy_response_to_json(chunking_strategy_response()) -> gleam@json:json(). chunking_strategy_response_to_json(Strategy) -> case Strategy of other_chunking -> gleam@json:object( [{<<"type"/utf8>>, gleam@json:string(<<"other"/utf8>>)}] ); {static_chunking_response, Config} -> gleam@json:object( [{<<"type"/utf8>>, gleam@json:string(<<"static"/utf8>>)}, {<<"static"/utf8>>, static_chunking_strategy_to_json(Config)}] ) end. -file("src/glopenai/vector_store.gleam", 446). -spec chunking_strategy_response_decoder() -> gleam@dynamic@decode:decoder(chunking_strategy_response()). chunking_strategy_response_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Tag) -> case Tag of <<"other"/utf8>> -> gleam@dynamic@decode:success(other_chunking); <<"static"/utf8>> -> gleam@dynamic@decode:field( <<"static"/utf8>>, static_chunking_strategy_decoder(), fun(Config) -> gleam@dynamic@decode:success( {static_chunking_response, Config} ) end ); _ -> gleam@dynamic@decode:failure( other_chunking, <<"ChunkingStrategyResponse"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 469). -spec vector_store_file_status_to_json(vector_store_file_status()) -> gleam@json:json(). vector_store_file_status_to_json(Status) -> gleam@json:string(case Status of file_in_progress -> <<"in_progress"/utf8>>; file_completed -> <<"completed"/utf8>>; file_cancelled -> <<"cancelled"/utf8>>; file_failed -> <<"failed"/utf8>> end). -file("src/glopenai/vector_store.gleam", 480). -spec vector_store_file_status_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_status()). vector_store_file_status_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"in_progress"/utf8>> -> gleam@dynamic@decode:success(file_in_progress); <<"completed"/utf8>> -> gleam@dynamic@decode:success(file_completed); <<"cancelled"/utf8>> -> gleam@dynamic@decode:success(file_cancelled); <<"failed"/utf8>> -> gleam@dynamic@decode:success(file_failed); _ -> gleam@dynamic@decode:failure( file_in_progress, <<"VectorStoreFileStatus"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 499). -spec vector_store_file_error_code_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_error_code()). vector_store_file_error_code_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"server_error"/utf8>> -> gleam@dynamic@decode:success(server_error); <<"unsupported_file"/utf8>> -> gleam@dynamic@decode:success(unsupported_file); <<"invalid_file"/utf8>> -> gleam@dynamic@decode:success(invalid_file); _ -> gleam@dynamic@decode:failure( server_error, <<"VectorStoreFileErrorCode"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 515). -spec vector_store_file_error_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_error()). vector_store_file_error_decoder() -> gleam@dynamic@decode:field( <<"code"/utf8>>, vector_store_file_error_code_decoder(), fun(Code) -> gleam@dynamic@decode:field( <<"message"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Message) -> gleam@dynamic@decode:success( {vector_store_file_error, Code, Message} ) end ) end ). -file("src/glopenai/vector_store.gleam", 528). -spec attribute_value_to_json(attribute_value()) -> gleam@json:json(). attribute_value_to_json(Value) -> case Value of {attribute_string, S} -> gleam@json:string(S); {attribute_number, N} -> gleam@json:int(N); {attribute_boolean, B} -> gleam@json:bool(B) end. -file("src/glopenai/vector_store.gleam", 536). -spec attribute_value_decoder() -> gleam@dynamic@decode:decoder(attribute_value()). attribute_value_decoder() -> gleam@dynamic@decode:one_of( begin gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(S) -> gleam@dynamic@decode:success({attribute_string, S}) end ) end, [begin gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(N) -> gleam@dynamic@decode:success({attribute_number, N}) end ) end, begin gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(B) -> gleam@dynamic@decode:success({attribute_boolean, B}) end ) end] ). -file("src/glopenai/vector_store.gleam", 560). -spec vector_store_file_attributes_to_json( gleam@dict:dict(binary(), attribute_value()) ) -> gleam@json:json(). vector_store_file_attributes_to_json(Attributes) -> gleam@json:object( begin _pipe = maps:to_list(Attributes), gleam@list:map( _pipe, fun(Pair) -> {erlang:element(1, Pair), attribute_value_to_json(erlang:element(2, Pair))} end ) end ). -file("src/glopenai/vector_store.gleam", 569). -spec vector_store_file_attributes_decoder() -> gleam@dynamic@decode:decoder(gleam@dict:dict(binary(), attribute_value())). vector_store_file_attributes_decoder() -> gleam@dynamic@decode:dict( {decoder, fun gleam@dynamic@decode:decode_string/1}, attribute_value_decoder() ). -file("src/glopenai/vector_store.gleam", 589). -spec vector_store_file_object_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_object()). vector_store_file_object_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"usage_bytes"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Usage_bytes) -> gleam@dynamic@decode:field( <<"created_at"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:field( <<"vector_store_id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Vector_store_id) -> gleam@dynamic@decode:field( <<"status"/utf8>>, vector_store_file_status_decoder( ), fun(Status) -> gleam@dynamic@decode:optional_field( <<"last_error"/utf8>>, none, gleam@dynamic@decode:optional( vector_store_file_error_decoder( ) ), fun(Last_error) -> gleam@dynamic@decode:optional_field( <<"chunking_strategy"/utf8>>, none, gleam@dynamic@decode:optional( chunking_strategy_response_decoder( ) ), fun( Chunking_strategy ) -> gleam@dynamic@decode:optional_field( <<"attributes"/utf8>>, none, gleam@dynamic@decode:optional( vector_store_file_attributes_decoder( ) ), fun( Attributes ) -> gleam@dynamic@decode:success( {vector_store_file_object, Id, Object, Usage_bytes, Created_at, Vector_store_id, Status, Last_error, Chunking_strategy, Attributes} ) end ) end ) end ) end ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 636). -spec list_vector_store_files_response_decoder() -> gleam@dynamic@decode:decoder(list_vector_store_files_response()). list_vector_store_files_response_decoder() -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"data"/utf8>>, gleam@dynamic@decode:list(vector_store_file_object_decoder()), fun(Data) -> gleam@dynamic@decode:optional_field( <<"first_id"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(First_id) -> gleam@dynamic@decode:optional_field( <<"last_id"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Last_id) -> gleam@dynamic@decode:field( <<"has_more"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Has_more) -> gleam@dynamic@decode:success( {list_vector_store_files_response, Object, Data, First_id, Last_id, Has_more} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 668). -spec delete_vector_store_file_response_decoder() -> gleam@dynamic@decode:decoder(delete_vector_store_file_response()). delete_vector_store_file_response_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"deleted"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Deleted) -> gleam@dynamic@decode:success( {delete_vector_store_file_response, Id, Object, Deleted} ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 690). -spec vector_store_file_batch_status_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_batch_status()). vector_store_file_batch_status_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"in_progress"/utf8>> -> gleam@dynamic@decode:success(batch_in_progress); <<"completed"/utf8>> -> gleam@dynamic@decode:success(batch_completed); <<"cancelled"/utf8>> -> gleam@dynamic@decode:success(batch_cancelled); <<"failed"/utf8>> -> gleam@dynamic@decode:success(batch_failed); _ -> gleam@dynamic@decode:failure( batch_in_progress, <<"VectorStoreFileBatchStatus"/utf8>> ) end end ). -file("src/glopenai/vector_store.gleam", 713). -spec vector_store_file_batch_counts_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_batch_counts()). vector_store_file_batch_counts_decoder() -> gleam@dynamic@decode:field( <<"in_progress"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(In_progress) -> gleam@dynamic@decode:field( <<"completed"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Completed) -> gleam@dynamic@decode:field( <<"failed"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Failed) -> gleam@dynamic@decode:field( <<"cancelled"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Cancelled) -> gleam@dynamic@decode:field( <<"total"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Total) -> gleam@dynamic@decode:success( {vector_store_file_batch_counts, In_progress, Completed, Failed, Cancelled, Total} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 741). -spec vector_store_file_batch_object_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_batch_object()). vector_store_file_batch_object_decoder() -> gleam@dynamic@decode:field( <<"id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Id) -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"created_at"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_int/1}, fun(Created_at) -> gleam@dynamic@decode:field( <<"vector_store_id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Vector_store_id) -> gleam@dynamic@decode:field( <<"status"/utf8>>, vector_store_file_batch_status_decoder(), fun(Status) -> gleam@dynamic@decode:field( <<"file_counts"/utf8>>, vector_store_file_batch_counts_decoder( ), fun(File_counts) -> gleam@dynamic@decode:success( {vector_store_file_batch_object, Id, Object, Created_at, Vector_store_id, Status, File_counts} ) end ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 769). -spec vector_store_file_content_object_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_content_object()). vector_store_file_content_object_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Content_type) -> gleam@dynamic@decode:field( <<"text"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Text) -> gleam@dynamic@decode:success( {vector_store_file_content_object, Content_type, Text} ) end ) end ). -file("src/glopenai/vector_store.gleam", 789). -spec vector_store_file_content_response_decoder() -> gleam@dynamic@decode:decoder(vector_store_file_content_response()). vector_store_file_content_response_decoder() -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"data"/utf8>>, gleam@dynamic@decode:list( vector_store_file_content_object_decoder() ), fun(Data) -> gleam@dynamic@decode:field( <<"has_more"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Has_more) -> gleam@dynamic@decode:optional_field( <<"next_page"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Next_page) -> gleam@dynamic@decode:success( {vector_store_file_content_response, Object, Data, Has_more, Next_page} ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 819). -spec vector_store_search_query_to_json(vector_store_search_query()) -> gleam@json:json(). vector_store_search_query_to_json(Query) -> case Query of {text_query, Q} -> gleam@json:string(Q); {array_query, Qs} -> gleam@json:array(Qs, fun gleam@json:string/1) end. -file("src/glopenai/vector_store.gleam", 834). -spec ranker_to_json(ranker()) -> gleam@json:json(). ranker_to_json(Ranker) -> gleam@json:string(case Ranker of ranker_none -> <<"none"/utf8>>; ranker_auto -> <<"auto"/utf8>>; ranker_default20241115 -> <<"default-2024-11-15"/utf8>> end). -file("src/glopenai/vector_store.gleam", 842). -spec ranker_decoder() -> gleam@dynamic@decode:decoder(ranker()). ranker_decoder() -> gleam@dynamic@decode:then( {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Value) -> case Value of <<"none"/utf8>> -> gleam@dynamic@decode:success(ranker_none); <<"auto"/utf8>> -> gleam@dynamic@decode:success(ranker_auto); <<"default-2024-11-15"/utf8>> -> gleam@dynamic@decode:success(ranker_default20241115); _ -> gleam@dynamic@decode:failure(ranker_auto, <<"Ranker"/utf8>>) end end ). -file("src/glopenai/vector_store.gleam", 856). -spec ranking_options_to_json(ranking_options()) -> gleam@json:json(). ranking_options_to_json(Options) -> glopenai@internal@codec:object_with_optional( [], [glopenai@internal@codec:optional_field( <<"ranker"/utf8>>, erlang:element(2, Options), fun ranker_to_json/1 ), glopenai@internal@codec:optional_field( <<"score_threshold"/utf8>>, erlang:element(3, Options), fun gleam@json:float/1 )] ). -file("src/glopenai/vector_store.gleam", 863). -spec ranking_options_decoder() -> gleam@dynamic@decode:decoder(ranking_options()). ranking_options_decoder() -> gleam@dynamic@decode:optional_field( <<"ranker"/utf8>>, none, gleam@dynamic@decode:optional(ranker_decoder()), fun(Ranker) -> gleam@dynamic@decode:optional_field( <<"score_threshold"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_float/1} ), fun(Score_threshold) -> gleam@dynamic@decode:success( {ranking_options, Ranker, Score_threshold} ) end ) end ). -file("src/glopenai/vector_store.gleam", 884). -spec vector_store_search_result_content_object_decoder() -> gleam@dynamic@decode:decoder(vector_store_search_result_content_object()). vector_store_search_result_content_object_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Content_type) -> gleam@dynamic@decode:field( <<"text"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Text) -> gleam@dynamic@decode:success( {vector_store_search_result_content_object, Content_type, Text} ) end ) end ). -file("src/glopenai/vector_store.gleam", 905). -spec vector_store_search_result_item_decoder() -> gleam@dynamic@decode:decoder(vector_store_search_result_item()). vector_store_search_result_item_decoder() -> gleam@dynamic@decode:field( <<"file_id"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(File_id) -> gleam@dynamic@decode:field( <<"filename"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Filename) -> gleam@dynamic@decode:field( <<"score"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_float/1}, fun(Score) -> gleam@dynamic@decode:field( <<"attributes"/utf8>>, vector_store_file_attributes_decoder(), fun(Attributes) -> gleam@dynamic@decode:field( <<"content"/utf8>>, gleam@dynamic@decode:list( vector_store_search_result_content_object_decoder( ) ), fun(Content) -> gleam@dynamic@decode:success( {vector_store_search_result_item, File_id, Filename, Score, Attributes, Content} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 938). -spec vector_store_search_results_page_decoder() -> gleam@dynamic@decode:decoder(vector_store_search_results_page()). vector_store_search_results_page_decoder() -> gleam@dynamic@decode:field( <<"object"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_string/1}, fun(Object) -> gleam@dynamic@decode:field( <<"search_query"/utf8>>, gleam@dynamic@decode:list( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Search_query) -> gleam@dynamic@decode:field( <<"data"/utf8>>, gleam@dynamic@decode:list( vector_store_search_result_item_decoder() ), fun(Data) -> gleam@dynamic@decode:field( <<"has_more"/utf8>>, {decoder, fun gleam@dynamic@decode:decode_bool/1}, fun(Has_more) -> gleam@dynamic@decode:optional_field( <<"next_page"/utf8>>, none, gleam@dynamic@decode:optional( {decoder, fun gleam@dynamic@decode:decode_string/1} ), fun(Next_page) -> gleam@dynamic@decode:success( {vector_store_search_results_page, Object, Search_query, Data, Has_more, Next_page} ) end ) end ) end ) end ) end ). -file("src/glopenai/vector_store.gleam", 979). -spec new_create_request() -> create_vector_store_request(). new_create_request() -> {create_vector_store_request, none, none, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 990). -spec with_file_ids(create_vector_store_request(), list(binary())) -> create_vector_store_request(). with_file_ids(Request, File_ids) -> {create_vector_store_request, {some, File_ids}, erlang:element(3, Request), erlang:element(4, Request), erlang:element(5, Request), erlang:element(6, Request), erlang:element(7, Request)}. -file("src/glopenai/vector_store.gleam", 997). -spec with_name(create_vector_store_request(), binary()) -> create_vector_store_request(). with_name(Request, Name) -> {create_vector_store_request, erlang:element(2, Request), {some, Name}, erlang:element(4, Request), erlang:element(5, Request), erlang:element(6, Request), erlang:element(7, Request)}. -file("src/glopenai/vector_store.gleam", 1004). -spec with_description(create_vector_store_request(), binary()) -> create_vector_store_request(). with_description(Request, Description) -> {create_vector_store_request, erlang:element(2, Request), erlang:element(3, Request), {some, Description}, erlang:element(5, Request), erlang:element(6, Request), erlang:element(7, Request)}. -file("src/glopenai/vector_store.gleam", 1011). -spec with_expires_after( create_vector_store_request(), vector_store_expiration_after() ) -> create_vector_store_request(). with_expires_after(Request, Expires_after) -> {create_vector_store_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), {some, Expires_after}, erlang:element(6, Request), erlang:element(7, Request)}. -file("src/glopenai/vector_store.gleam", 1018). -spec with_chunking_strategy( create_vector_store_request(), chunking_strategy_request_param() ) -> create_vector_store_request(). with_chunking_strategy(Request, Chunking_strategy) -> {create_vector_store_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), erlang:element(5, Request), {some, Chunking_strategy}, erlang:element(7, Request)}. -file("src/glopenai/vector_store.gleam", 1028). -spec with_metadata( create_vector_store_request(), gleam@dict:dict(binary(), binary()) ) -> create_vector_store_request(). with_metadata(Request, Metadata) -> {create_vector_store_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), erlang:element(5, Request), erlang:element(6, Request), {some, Metadata}}. -file("src/glopenai/vector_store.gleam", 1035). -spec create_vector_store_request_to_json(create_vector_store_request()) -> gleam@json:json(). create_vector_store_request_to_json(Request) -> glopenai@internal@codec:object_with_optional( [], [glopenai@internal@codec:optional_field( <<"file_ids"/utf8>>, erlang:element(2, Request), fun(Ids) -> gleam@json:array(Ids, fun gleam@json:string/1) end ), glopenai@internal@codec:optional_field( <<"name"/utf8>>, erlang:element(3, Request), fun gleam@json:string/1 ), glopenai@internal@codec:optional_field( <<"description"/utf8>>, erlang:element(4, Request), fun gleam@json:string/1 ), glopenai@internal@codec:optional_field( <<"expires_after"/utf8>>, erlang:element(5, Request), fun vector_store_expiration_after_to_json/1 ), glopenai@internal@codec:optional_field( <<"chunking_strategy"/utf8>>, erlang:element(6, Request), fun chunking_strategy_request_param_to_json/1 ), glopenai@internal@codec:optional_field( <<"metadata"/utf8>>, erlang:element(7, Request), fun(Metadata) -> gleam@json:object( begin _pipe = maps:to_list(Metadata), gleam@list:map( _pipe, fun(Pair) -> {erlang:element(1, Pair), gleam@json:string( erlang:element(2, Pair) )} end ) end ) end )] ). -file("src/glopenai/vector_store.gleam", 1073). -spec new_update_request() -> update_vector_store_request(). new_update_request() -> {update_vector_store_request, none, none, none}. -file("src/glopenai/vector_store.gleam", 1077). -spec update_with_name(update_vector_store_request(), binary()) -> update_vector_store_request(). update_with_name(Request, Name) -> {update_vector_store_request, {some, Name}, erlang:element(3, Request), erlang:element(4, Request)}. -file("src/glopenai/vector_store.gleam", 1084). -spec update_with_expires_after( update_vector_store_request(), vector_store_expiration_after() ) -> update_vector_store_request(). update_with_expires_after(Request, Expires_after) -> {update_vector_store_request, erlang:element(2, Request), {some, Expires_after}, erlang:element(4, Request)}. -file("src/glopenai/vector_store.gleam", 1091). -spec update_with_metadata( update_vector_store_request(), gleam@dict:dict(binary(), binary()) ) -> update_vector_store_request(). update_with_metadata(Request, Metadata) -> {update_vector_store_request, erlang:element(2, Request), erlang:element(3, Request), {some, Metadata}}. -file("src/glopenai/vector_store.gleam", 1098). -spec update_vector_store_request_to_json(update_vector_store_request()) -> gleam@json:json(). update_vector_store_request_to_json(Request) -> glopenai@internal@codec:object_with_optional( [], [glopenai@internal@codec:optional_field( <<"name"/utf8>>, erlang:element(2, Request), fun gleam@json:string/1 ), glopenai@internal@codec:optional_field( <<"expires_after"/utf8>>, erlang:element(3, Request), fun vector_store_expiration_after_to_json/1 ), glopenai@internal@codec:optional_field( <<"metadata"/utf8>>, erlang:element(4, Request), fun(Metadata) -> gleam@json:object( begin _pipe = maps:to_list(Metadata), gleam@list:map( _pipe, fun(Pair) -> {erlang:element(1, Pair), gleam@json:string( erlang:element(2, Pair) )} end ) end ) end )] ). -file("src/glopenai/vector_store.gleam", 1127). -spec new_create_file_request(binary()) -> create_vector_store_file_request(). new_create_file_request(File_id) -> {create_vector_store_file_request, File_id, none, none}. -file("src/glopenai/vector_store.gleam", 1135). -spec file_with_chunking_strategy( create_vector_store_file_request(), chunking_strategy_request_param() ) -> create_vector_store_file_request(). file_with_chunking_strategy(Request, Chunking_strategy) -> {create_vector_store_file_request, erlang:element(2, Request), {some, Chunking_strategy}, erlang:element(4, Request)}. -file("src/glopenai/vector_store.gleam", 1145). -spec file_with_attributes( create_vector_store_file_request(), gleam@dict:dict(binary(), attribute_value()) ) -> create_vector_store_file_request(). file_with_attributes(Request, Attributes) -> {create_vector_store_file_request, erlang:element(2, Request), erlang:element(3, Request), {some, Attributes}}. -file("src/glopenai/vector_store.gleam", 1152). -spec create_vector_store_file_request_to_json( create_vector_store_file_request() ) -> gleam@json:json(). create_vector_store_file_request_to_json(Request) -> glopenai@internal@codec:object_with_optional( [{<<"file_id"/utf8>>, gleam@json:string(erlang:element(2, Request))}], [glopenai@internal@codec:optional_field( <<"chunking_strategy"/utf8>>, erlang:element(3, Request), fun chunking_strategy_request_param_to_json/1 ), glopenai@internal@codec:optional_field( <<"attributes"/utf8>>, erlang:element(4, Request), fun vector_store_file_attributes_to_json/1 )] ). -file("src/glopenai/vector_store.gleam", 1175). -spec update_vector_store_file_attributes_request_to_json( update_vector_store_file_attributes_request() ) -> gleam@json:json(). update_vector_store_file_attributes_request_to_json(Request) -> gleam@json:object( [{<<"attributes"/utf8>>, vector_store_file_attributes_to_json(erlang:element(2, Request))}] ). -file("src/glopenai/vector_store.gleam", 1194). -spec new_create_file_batch_request() -> create_vector_store_file_batch_request(). new_create_file_batch_request() -> {create_vector_store_file_batch_request, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 1203). -spec batch_with_file_ids( create_vector_store_file_batch_request(), list(binary()) ) -> create_vector_store_file_batch_request(). batch_with_file_ids(Request, File_ids) -> {create_vector_store_file_batch_request, {some, File_ids}, erlang:element(3, Request), erlang:element(4, Request), erlang:element(5, Request)}. -file("src/glopenai/vector_store.gleam", 1210). -spec batch_with_files( create_vector_store_file_batch_request(), list(create_vector_store_file_request()) ) -> create_vector_store_file_batch_request(). batch_with_files(Request, Files) -> {create_vector_store_file_batch_request, erlang:element(2, Request), {some, Files}, erlang:element(4, Request), erlang:element(5, Request)}. -file("src/glopenai/vector_store.gleam", 1217). -spec batch_with_chunking_strategy( create_vector_store_file_batch_request(), chunking_strategy_request_param() ) -> create_vector_store_file_batch_request(). batch_with_chunking_strategy(Request, Chunking_strategy) -> {create_vector_store_file_batch_request, erlang:element(2, Request), erlang:element(3, Request), {some, Chunking_strategy}, erlang:element(5, Request)}. -file("src/glopenai/vector_store.gleam", 1227). -spec batch_with_attributes( create_vector_store_file_batch_request(), gleam@dict:dict(binary(), attribute_value()) ) -> create_vector_store_file_batch_request(). batch_with_attributes(Request, Attributes) -> {create_vector_store_file_batch_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), {some, Attributes}}. -file("src/glopenai/vector_store.gleam", 1234). -spec create_vector_store_file_batch_request_to_json( create_vector_store_file_batch_request() ) -> gleam@json:json(). create_vector_store_file_batch_request_to_json(Request) -> glopenai@internal@codec:object_with_optional( [], [glopenai@internal@codec:optional_field( <<"file_ids"/utf8>>, erlang:element(2, Request), fun(Ids) -> gleam@json:array(Ids, fun gleam@json:string/1) end ), glopenai@internal@codec:optional_field( <<"files"/utf8>>, erlang:element(3, Request), fun(Files) -> gleam@json:array( Files, fun create_vector_store_file_request_to_json/1 ) end ), glopenai@internal@codec:optional_field( <<"chunking_strategy"/utf8>>, erlang:element(4, Request), fun chunking_strategy_request_param_to_json/1 ), glopenai@internal@codec:optional_field( <<"attributes"/utf8>>, erlang:element(5, Request), fun vector_store_file_attributes_to_json/1 )] ). -file("src/glopenai/vector_store.gleam", 1269). -spec new_search_request(vector_store_search_query()) -> vector_store_search_request(). new_search_request(Query) -> {vector_store_search_request, Query, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 1281). -spec search_with_rewrite_query(vector_store_search_request(), boolean()) -> vector_store_search_request(). search_with_rewrite_query(Request, Rewrite_query) -> {vector_store_search_request, erlang:element(2, Request), {some, Rewrite_query}, erlang:element(4, Request), erlang:element(5, Request), erlang:element(6, Request)}. -file("src/glopenai/vector_store.gleam", 1288). -spec search_with_max_num_results(vector_store_search_request(), integer()) -> vector_store_search_request(). search_with_max_num_results(Request, Max_num_results) -> {vector_store_search_request, erlang:element(2, Request), erlang:element(3, Request), {some, Max_num_results}, erlang:element(5, Request), erlang:element(6, Request)}. -file("src/glopenai/vector_store.gleam", 1295). -spec search_with_filters(vector_store_search_request(), filter()) -> vector_store_search_request(). search_with_filters(Request, Filters) -> {vector_store_search_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), {some, Filters}, erlang:element(6, Request)}. -file("src/glopenai/vector_store.gleam", 1302). -spec search_with_ranking_options( vector_store_search_request(), ranking_options() ) -> vector_store_search_request(). search_with_ranking_options(Request, Ranking_options) -> {vector_store_search_request, erlang:element(2, Request), erlang:element(3, Request), erlang:element(4, Request), erlang:element(5, Request), {some, Ranking_options}}. -file("src/glopenai/vector_store.gleam", 1309). -spec vector_store_search_request_to_json(vector_store_search_request()) -> gleam@json:json(). vector_store_search_request_to_json(Request) -> glopenai@internal@codec:object_with_optional( [{<<"query"/utf8>>, vector_store_search_query_to_json(erlang:element(2, Request))}], [glopenai@internal@codec:optional_field( <<"rewrite_query"/utf8>>, erlang:element(3, Request), fun gleam@json:bool/1 ), glopenai@internal@codec:optional_field( <<"max_num_results"/utf8>>, erlang:element(4, Request), fun gleam@json:int/1 ), glopenai@internal@codec:optional_field( <<"filters"/utf8>>, erlang:element(5, Request), fun filter_to_json/1 ), glopenai@internal@codec:optional_field( <<"ranking_options"/utf8>>, erlang:element(6, Request), fun ranking_options_to_json/1 )] ). -file("src/glopenai/vector_store.gleam", 1336). -spec order_to_string(list_order()) -> binary(). order_to_string(Order) -> case Order of asc -> <<"asc"/utf8>>; desc -> <<"desc"/utf8>> end. -file("src/glopenai/vector_store.gleam", 1352). -spec empty_list_vector_stores_query() -> list_vector_stores_query(). empty_list_vector_stores_query() -> {list_vector_stores_query, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 1376). -spec list_files_filter_to_string(list_files_filter()) -> binary(). list_files_filter_to_string(Filter) -> case Filter of filter_in_progress -> <<"in_progress"/utf8>>; filter_completed -> <<"completed"/utf8>>; filter_failed -> <<"failed"/utf8>>; filter_cancelled -> <<"cancelled"/utf8>> end. -file("src/glopenai/vector_store.gleam", 1395). -spec empty_list_vector_store_files_query() -> list_vector_store_files_query(). empty_list_vector_store_files_query() -> {list_vector_store_files_query, none, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 1427). -spec empty_list_files_in_vector_store_batch_query() -> list_files_in_vector_store_batch_query(). empty_list_files_in_vector_store_batch_query() -> {list_files_in_vector_store_batch_query, none, none, none, none, none}. -file("src/glopenai/vector_store.gleam", 1449). -spec optional_string_pair( binary(), gleam@option:option(PGC), fun((PGC) -> binary()) ) -> list({binary(), binary()}). optional_string_pair(Key, Value, Encode) -> case Value of {some, V} -> [{Key, Encode(V)}]; none -> [] end. -file("src/glopenai/vector_store.gleam", 1356). -spec list_vector_stores_query_pairs(list_vector_stores_query()) -> list({binary(), binary()}). list_vector_stores_query_pairs(Query) -> lists:append( [optional_string_pair( <<"limit"/utf8>>, erlang:element(2, Query), fun erlang:integer_to_binary/1 ), optional_string_pair( <<"order"/utf8>>, erlang:element(3, Query), fun order_to_string/1 ), optional_string_pair( <<"after"/utf8>>, erlang:element(4, Query), fun(S) -> S end ), optional_string_pair( <<"before"/utf8>>, erlang:element(5, Query), fun(S@1) -> S@1 end )] ). -file("src/glopenai/vector_store.gleam", 1405). -spec list_vector_store_files_query_pairs(list_vector_store_files_query()) -> list({binary(), binary()}). list_vector_store_files_query_pairs(Query) -> lists:append( [optional_string_pair( <<"limit"/utf8>>, erlang:element(2, Query), fun erlang:integer_to_binary/1 ), optional_string_pair( <<"order"/utf8>>, erlang:element(3, Query), fun order_to_string/1 ), optional_string_pair( <<"after"/utf8>>, erlang:element(4, Query), fun(S) -> S end ), optional_string_pair( <<"before"/utf8>>, erlang:element(5, Query), fun(S@1) -> S@1 end ), optional_string_pair( <<"filter"/utf8>>, erlang:element(6, Query), fun list_files_filter_to_string/1 )] ). -file("src/glopenai/vector_store.gleam", 1437). -spec list_files_in_vector_store_batch_query_pairs( list_files_in_vector_store_batch_query() ) -> list({binary(), binary()}). list_files_in_vector_store_batch_query_pairs(Query) -> lists:append( [optional_string_pair( <<"limit"/utf8>>, erlang:element(2, Query), fun erlang:integer_to_binary/1 ), optional_string_pair( <<"order"/utf8>>, erlang:element(3, Query), fun order_to_string/1 ), optional_string_pair( <<"after"/utf8>>, erlang:element(4, Query), fun(S) -> S end ), optional_string_pair( <<"before"/utf8>>, erlang:element(5, Query), fun(S@1) -> S@1 end ), optional_string_pair( <<"filter"/utf8>>, erlang:element(6, Query), fun list_files_filter_to_string/1 )] ). -file("src/glopenai/vector_store.gleam", 1466). -spec create_request(glopenai@config:config(), create_vector_store_request()) -> gleam@http@request:request(binary()). create_request(Config, Request) -> glopenai@internal:post_request( Config, <<"/vector_stores"/utf8>>, create_vector_store_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1477). -spec create_response(gleam@http@response:response(binary())) -> {ok, vector_store_object()} | {error, glopenai@error:glopenai_error()}. create_response(Response) -> glopenai@internal:parse_response(Response, vector_store_object_decoder()). -file("src/glopenai/vector_store.gleam", 1483). -spec retrieve_request(glopenai@config:config(), binary()) -> gleam@http@request:request(binary()). retrieve_request(Config, Vector_store_id) -> glopenai@internal:get_request( Config, <<"/vector_stores/"/utf8, Vector_store_id/binary>> ). -file("src/glopenai/vector_store.gleam", 1490). -spec retrieve_response(gleam@http@response:response(binary())) -> {ok, vector_store_object()} | {error, glopenai@error:glopenai_error()}. retrieve_response(Response) -> glopenai@internal:parse_response(Response, vector_store_object_decoder()). -file("src/glopenai/vector_store.gleam", 1496). -spec list_request(glopenai@config:config()) -> gleam@http@request:request(binary()). list_request(Config) -> glopenai@internal:get_request(Config, <<"/vector_stores"/utf8>>). -file("src/glopenai/vector_store.gleam", 1500). -spec list_request_with_query( glopenai@config:config(), list_vector_stores_query() ) -> gleam@http@request:request(binary()). list_request_with_query(Config, Query) -> _pipe = glopenai@internal:get_request(Config, <<"/vector_stores"/utf8>>), gleam@http@request:set_query(_pipe, list_vector_stores_query_pairs(Query)). -file("src/glopenai/vector_store.gleam", 1508). -spec list_response(gleam@http@response:response(binary())) -> {ok, list_vector_stores_response()} | {error, glopenai@error:glopenai_error()}. list_response(Response) -> glopenai@internal:parse_response( Response, list_vector_stores_response_decoder() ). -file("src/glopenai/vector_store.gleam", 1514). -spec delete_request(glopenai@config:config(), binary()) -> gleam@http@request:request(binary()). delete_request(Config, Vector_store_id) -> glopenai@internal:delete_request( Config, <<"/vector_stores/"/utf8, Vector_store_id/binary>> ). -file("src/glopenai/vector_store.gleam", 1521). -spec delete_response(gleam@http@response:response(binary())) -> {ok, delete_vector_store_response()} | {error, glopenai@error:glopenai_error()}. delete_response(Response) -> glopenai@internal:parse_response( Response, delete_vector_store_response_decoder() ). -file("src/glopenai/vector_store.gleam", 1527). -spec update_request( glopenai@config:config(), binary(), update_vector_store_request() ) -> gleam@http@request:request(binary()). update_request(Config, Vector_store_id, Request) -> glopenai@internal:post_request( Config, <<"/vector_stores/"/utf8, Vector_store_id/binary>>, update_vector_store_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1539). -spec update_response(gleam@http@response:response(binary())) -> {ok, vector_store_object()} | {error, glopenai@error:glopenai_error()}. update_response(Response) -> glopenai@internal:parse_response(Response, vector_store_object_decoder()). -file("src/glopenai/vector_store.gleam", 1545). -spec search_request( glopenai@config:config(), binary(), vector_store_search_request() ) -> gleam@http@request:request(binary()). search_request(Config, Vector_store_id, Request) -> glopenai@internal:post_request( Config, <<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/search"/utf8>>, vector_store_search_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1557). -spec search_response(gleam@http@response:response(binary())) -> {ok, vector_store_search_results_page()} | {error, glopenai@error:glopenai_error()}. search_response(Response) -> glopenai@internal:parse_response( Response, vector_store_search_results_page_decoder() ). -file("src/glopenai/vector_store.gleam", 1565). -spec file_create_request( glopenai@config:config(), binary(), create_vector_store_file_request() ) -> gleam@http@request:request(binary()). file_create_request(Config, Vector_store_id, Request) -> glopenai@internal:post_request( Config, <<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files"/utf8>>, create_vector_store_file_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1577). -spec file_create_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_object()} | {error, glopenai@error:glopenai_error()}. file_create_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1583). -spec file_retrieve_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). file_retrieve_request(Config, Vector_store_id, File_id) -> glopenai@internal:get_request( Config, <<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files/"/utf8>>/binary, File_id/binary>> ). -file("src/glopenai/vector_store.gleam", 1594). -spec file_retrieve_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_object()} | {error, glopenai@error:glopenai_error()}. file_retrieve_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1600). -spec file_delete_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). file_delete_request(Config, Vector_store_id, File_id) -> glopenai@internal:delete_request( Config, <<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files/"/utf8>>/binary, File_id/binary>> ). -file("src/glopenai/vector_store.gleam", 1611). -spec file_delete_response(gleam@http@response:response(binary())) -> {ok, delete_vector_store_file_response()} | {error, glopenai@error:glopenai_error()}. file_delete_response(Response) -> glopenai@internal:parse_response( Response, delete_vector_store_file_response_decoder() ). -file("src/glopenai/vector_store.gleam", 1617). -spec file_list_request(glopenai@config:config(), binary()) -> gleam@http@request:request(binary()). file_list_request(Config, Vector_store_id) -> glopenai@internal:get_request( Config, <<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files"/utf8>> ). -file("src/glopenai/vector_store.gleam", 1624). -spec file_list_request_with_query( glopenai@config:config(), binary(), list_vector_store_files_query() ) -> gleam@http@request:request(binary()). file_list_request_with_query(Config, Vector_store_id, Query) -> _pipe = glopenai@internal:get_request( Config, <<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files"/utf8>> ), gleam@http@request:set_query( _pipe, list_vector_store_files_query_pairs(Query) ). -file("src/glopenai/vector_store.gleam", 1633). -spec file_list_response(gleam@http@response:response(binary())) -> {ok, list_vector_store_files_response()} | {error, glopenai@error:glopenai_error()}. file_list_response(Response) -> glopenai@internal:parse_response( Response, list_vector_store_files_response_decoder() ). -file("src/glopenai/vector_store.gleam", 1639). -spec file_update_request( glopenai@config:config(), binary(), binary(), update_vector_store_file_attributes_request() ) -> gleam@http@request:request(binary()). file_update_request(Config, Vector_store_id, File_id, Request) -> glopenai@internal:post_request( Config, <<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files/"/utf8>>/binary, File_id/binary>>, update_vector_store_file_attributes_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1652). -spec file_update_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_object()} | {error, glopenai@error:glopenai_error()}. file_update_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1658). -spec file_content_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). file_content_request(Config, Vector_store_id, File_id) -> glopenai@internal:get_request( Config, <<<<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/files/"/utf8>>/binary, File_id/binary>>/binary, "/content"/utf8>> ). -file("src/glopenai/vector_store.gleam", 1669). -spec file_content_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_content_response()} | {error, glopenai@error:glopenai_error()}. file_content_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_content_response_decoder() ). -file("src/glopenai/vector_store.gleam", 1680). -spec batch_create_request( glopenai@config:config(), binary(), create_vector_store_file_batch_request() ) -> gleam@http@request:request(binary()). batch_create_request(Config, Vector_store_id, Request) -> glopenai@internal:post_request( Config, <<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/file_batches"/utf8>>, create_vector_store_file_batch_request_to_json(Request) ). -file("src/glopenai/vector_store.gleam", 1692). -spec batch_create_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_batch_object()} | {error, glopenai@error:glopenai_error()}. batch_create_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_batch_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1698). -spec batch_retrieve_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). batch_retrieve_request(Config, Vector_store_id, Batch_id) -> glopenai@internal:get_request( Config, <<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/file_batches/"/utf8>>/binary, Batch_id/binary>> ). -file("src/glopenai/vector_store.gleam", 1709). -spec batch_retrieve_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_batch_object()} | {error, glopenai@error:glopenai_error()}. batch_retrieve_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_batch_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1715). -spec batch_cancel_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). batch_cancel_request(Config, Vector_store_id, Batch_id) -> glopenai@internal:post_request( Config, <<<<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/file_batches/"/utf8>>/binary, Batch_id/binary>>/binary, "/cancel"/utf8>>, gleam@json:object([]) ). -file("src/glopenai/vector_store.gleam", 1731). -spec batch_cancel_response(gleam@http@response:response(binary())) -> {ok, vector_store_file_batch_object()} | {error, glopenai@error:glopenai_error()}. batch_cancel_response(Response) -> glopenai@internal:parse_response( Response, vector_store_file_batch_object_decoder() ). -file("src/glopenai/vector_store.gleam", 1737). -spec batch_list_files_request(glopenai@config:config(), binary(), binary()) -> gleam@http@request:request(binary()). batch_list_files_request(Config, Vector_store_id, Batch_id) -> glopenai@internal:get_request( Config, <<<<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/file_batches/"/utf8>>/binary, Batch_id/binary>>/binary, "/files"/utf8>> ). -file("src/glopenai/vector_store.gleam", 1752). -spec batch_list_files_request_with_query( glopenai@config:config(), binary(), binary(), list_files_in_vector_store_batch_query() ) -> gleam@http@request:request(binary()). batch_list_files_request_with_query(Config, Vector_store_id, Batch_id, Query) -> _pipe = glopenai@internal:get_request( Config, <<<<<<<<"/vector_stores/"/utf8, Vector_store_id/binary>>/binary, "/file_batches/"/utf8>>/binary, Batch_id/binary>>/binary, "/files"/utf8>> ), gleam@http@request:set_query( _pipe, list_files_in_vector_store_batch_query_pairs(Query) ). -file("src/glopenai/vector_store.gleam", 1769). -spec batch_list_files_response(gleam@http@response:response(binary())) -> {ok, list_vector_store_files_response()} | {error, glopenai@error:glopenai_error()}. batch_list_files_response(Response) -> glopenai@internal:parse_response( Response, list_vector_store_files_response_decoder() ). -file("src/glopenai/vector_store.gleam", 173). -spec compound_filter_decoder() -> gleam@dynamic@decode:decoder(filter()). compound_filter_decoder() -> gleam@dynamic@decode:field( <<"type"/utf8>>, compound_type_decoder(), fun(Compound_type) -> gleam@dynamic@decode:field( <<"filters"/utf8>>, gleam@dynamic@decode:list(filter_decoder()), fun(Filters) -> gleam@dynamic@decode:success( {compound_filter, {compound_filter_record, Compound_type, Filters}} ) end ) end ). -file("src/glopenai/vector_store.gleam", 156). -spec filter_decoder() -> gleam@dynamic@decode:decoder(filter()). filter_decoder() -> gleam@dynamic@decode:one_of( compound_filter_decoder(), [comparison_filter_decoder()] ).