Crate batch_mode_3p

Crate batch_mode_3p 

Source

Re-exports§

pub use structopt;
pub use strum;
pub use async_openai;
pub use tokio;
pub use regex;
pub use tracing;
pub use tempfile;
pub use uuid;
pub use futures;
pub use serde_json;
pub use strsim;
pub use rand;
pub use crossbeam;

Modules§

colored
Coloring terminal so simple, you already know how to do it !
de
Generic data structure deserialization framework.
fs
Asynchronous file utilities.
instrument
Attach a span to a std::future::Future.
io
Traits, helpers, and type definitions for asynchronous I/O functionality.
mpsc
A multi-producer, single-consumer queue for sending values between asynchronous tasks.
once_cell
Overview
oneshot
A one-shot channel is used for sending a single message between asynchronous tasks. The channel function is used to create a Sender and Receiver handle pair that form the channel.
thread
Native threads.

Macros§

arc
debug
Constructs an event at the debug level.
delegate
error
Constructs an event at the error level.
error_tree
formatdoc
Unindent and call format!.
indoc
Unindent and produce &'static str or &'static [u8].
info
Constructs an event at the info level.
ix
json
Construct a serde_json::Value from a JSON literal.
lazy_static
name
Macro to create a name with an optional separator.
pretty_assert_eq
Asserts that two expressions are equal to each other (using PartialEq).
rand_construct_env
setup_test_logger
trace
Constructs an event at the trace level.
warn
Constructs an event at the warn level.
x
xp

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AssertUnwindSafe
A simple wrapper around a type to assert that it is unwind safe.
AsyncMutex
An asynchronous Mutex-like type.
AsyncRwLock
An asynchronous reader-writer lock.
AsyncRwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
AsyncRwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.
AtomicI32
An integer type which can be safely shared between threads.
AtomicUsize
An integer type which can be safely shared between threads.
Batch
BatchRequest
BatchRequestInput
The per-line object of the batch input file
BatchRequestOutput
The per-line object of the batch output and error files
BatchRequestOutputResponse
BufReader
The BufReader struct adds buffering to any reader.
BufWriter
Wraps a writer and buffers its output.
BufferedLayer
BufferedSubscriberLayer
Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
Captures
Represents the capture groups for a single match.
Chars
An iterator over the chars of a string slice.
ChatCompletionRequestMessageContentPartImage
ChatCompletionResponseMessage
A chat completion message generated by the model.
Chunks
An iterator over a slice in (non-overlapping) chunks (chunk_size elements at a time), starting at the beginning of the slice.
Client
Client is a container for config, backoff and http_client used to make API calls.
CreateFileRequest
Duration
A Duration type to represent a span of time, typically used for system timeouts.
Enumerate
An iterator that yields the current count and the element during iteration.
File
A reference to an open file on the filesystem.
FileLoggingConfiguration
FloatOrd
A wrapper for floats, that implements total equality and ordering and hashing.
Formatter
Configuration for formatting.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
ImageUrl
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
JoinHandle
An owned permission to join on a task (await its termination).
JoinSet
A collection of tasks spawned on a Tokio runtime.
Lazy
A value which is initialized on the first access.
NameValidator
Validator struct to validate names using a regular expression.
NamedTempFile
A named temporary file.
OnceCell
A cell which can be written to only once. It is not thread safe.
OpenAIApiError
OpenAI API returns error object on failure
OpenAIConfig
Configuration for OpenAI API
OpenAIFile
The File object represents a document that has been uploaded to OpenAI.
OwnedSemaphorePermit
An owned permit from the semaphore.
Path
A slice of a path (akin to str).
PathBuf
An owned, mutable path (akin to String).
Peekable
An iterator with a peek() that returns an optional reference to the next element.
PhantomData
Zero-sized type used to mark things that “act like” they own a T.
Pin
A pointer which pins its pointee in place.
Rc
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
Receiver
Receives values from the associated Sender.
RefCell
A mutable memory location with dynamically checked borrow rules
Regex
A compiled regular expression for searching Unicode haystacks.
Runtime
The Tokio runtime.
RwLock
A reader-writer lock
Scope
A scope to spawn scoped threads in.
ScopedJoinHandle
An owned permission to join on a scoped thread (block on its termination).
Semaphore
Counting semaphore performing asynchronous permit acquisition.
Sender
Sends values to the associated Receiver.
StdMutex
A mutual exclusion primitive useful for protecting shared data
TempDir
A directory in the filesystem that is automatically deleted when it goes out of scope.
UniqueNameEnforcer
Trait for ensuring unique names across a collection or context.
Uuid
A Universally Unique Identifier (UUID).
VecDeque
A double-ended queue implemented with a growable ring buffer.

Enums§

AtomicOrdering
Atomic memory orderings
BatchCompletionWindow
BatchEndpoint
BatchRequestInputMethod
BatchStatus
ChatCompletionRequestUserMessageContent
Cow
A clone-on-write smart pointer.
ErrorKind
A list specifying general categories of I/O error.
EventPrinter
FilePurpose
ImageDetail
JsonParsingStrategy
Enum to specify parsing strategy.
JsonRepairError
JsonValue
Represents any valid JSON value.
LogLevel
NameError
Custom error type for handling name-related issues.
OpenAIError
OpenAIFilePurpose
Ordering
An Ordering is the result of a comparison between two values.
Role
StructuredLanguageForm
Token
TrySendError
This enumeration is the list of the possible error outcomes for the try_send method.
Value
Represents any valid JSON value.

Traits§

AIDescriptor
AsyncBufReadExt
An extension trait which adds utility methods to AsyncBufRead types.
AsyncWriteExt
Writes bytes to a sink.
BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
BufferedSubscriber
Debug
? formatting.
DefaultName
Trait for providing a default name.
Deref
Used for immutable dereferencing operations, like *v.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
DeserializeOwned
A data structure that can be deserialized without borrowing any data from the deserializer.
Deserializer
A data format that can deserialize any data structure supported by Serde.
Display
Format trait for an empty format, {}.
Error
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>.
Flushable
FromStr
Parse a value from a string
Inflector
IntoEnumIterator
This trait designates that an Enum can be iterated over. It can be auto generated using strum_macros on your behalf.
ItemFeature
ItemWithFeatures
LazyStatic
Support trait for enabling a few common operation on lazy static values.
MultilingualName
Trait for supporting names in multiple languages.
NameHistory
Provides a history of names an item has had.
Named
Trait for getting the name of an item.
NamedAlias
Trait for handling multiple names or aliases.
NamespaceName
Trait for namespacing names.
NormalizeName
Trait for normalizing the case of a name (e.g., lowercase).
PluralDisplay
RandConstruct
RandConstructEnum
RandConstructEnumWithEnv
RandConstructEnvironment
RandConstructProbabilityMapProvider
ResetName
Trait for resetting the name of an item to its default.
Serialize
A data structure that can be serialized into any data format supported by Serde.
Serializer
A data format that can serialize any data structure supported by Serde.
SetName
Trait for setting the name of an item with error handling.
SetNameWithHistory
Trait for setting the name while maintaining a history of changes.
StructOpt
A struct that is converted from command line arguments.
ValidateName
Trait for validating a name, returning a Result.
VariantNames
A trait for retrieving the names of each variant in Enum. This trait can be autoderived by strum_macros.
Write
A trait for objects which are byte-oriented sinks.
Zero
Defines an additive identity element for Self.
__Deref
Used for immutable dereferencing operations, like *v.

Functions§

assert_expected_matches_output_result
assert_expected_value_matches_output_result
attempt_repair_json_string
block_on
Run a future to completion on the current thread.
catch_unwind
Invokes a closure, capturing the cause of an unwinding panic if one occurs.
channel
Creates a bounded mpsc channel for communicating between asynchronous tasks with backpressure.
configure_tracing
Initializes the logging subscriber.
create_file_logging_subscriber
init_default_file_logging
init_file_logging
init_test_logger
init_test_logger_with_max_level_filter
initialize
Takes a shared reference to a lazy static and initializes it if it has not been already.
is_test_mode
is_valid_json_value_start
join_all
Creates a future which represents a collection of the outputs of the futures given.
parse_array
parse_object
parse_value
remove_control_characters_in_value
repair_json_accidental_single_quote_instead_of_double_quote
repair_json_add_missing_quotes
repair_json_close_unexpected_eof
repair_json_close_unexpected_eof_in_array_item
repair_json_close_unexpected_eof_in_array_tag
repair_json_comma_behavior
repair_json_control_characters
repair_json_fix_mismatched_quotes
repair_json_handle_eof_between_lists
repair_json_mismatched_brackets
Repairs mismatched or unbalanced brackets and braces in a JSON-like input.
repair_json_missing_closing_quotes
repair_json_missing_commas_in_list
repair_json_remove_duplicate_quotes
repair_json_string
applies all known fixes in order until one proves to work
repair_json_string_heavy
this one will try all of the fixes in parallel first before falling back to serial application.
repair_json_string_parallel
repair_json_string_series
repair_json_truncated_boolean_behavior
repair_json_with_known_capitalized_sentence_fragment_list_items
this one we use for certain cases where the JSON is known to have list items which are all Sentence fragments of this format
repair_standard_list_items_with_possible_splits
Repairs arrays of strings in a JSON value by merging items split across multiple lines. A new item starts with an uppercase first character. Subsequent lines that start lowercase are appended to the current item until another uppercase line is found.
sample_variants_with_probabilities
sanitize_json_str
setup_buffered_tracing
setup_default_buffered_tracing
setup_dynamic_tracing
skip_whitespace
sleep
Waits until duration has elapsed.
tempdir
Create a new temporary directory. Also see tempdir_in.
to_snake_case
Converts a &str to snake_case String
tokenize
unescape_string

Type Aliases§

FmtResult
The type returned by formatter methods.

Attribute Macros§

async_trait
disable
instrument
Instruments a function to create and enter a tracing span every time the function is called.
traced_test

Derive Macros§

Builder
Create a builder struct for the deriving struct.
CopyGetters
Debug
Derive macro generating an impl of the trait Debug.
Deserialize
EnumIter
Creates a new type that iterates of the variants of an enum.
EnumString
Converts strings to enum variants based on their name.
EnumVariantNames
Implements Strum::VariantNames which adds an associated constant VARIANTS which is an array of discriminant names.
Getters
ItemFeature
ItemWithFeatures
MutGetters
NamedItem
The attribute macro to derive Named, DefaultName, SetName, etc. behaviors.
Plural
Procedural macro to derive PluralDisplay.
RandConstruct
RandConstructEnvironment
Serialize
Setters
StructOpt
Generates the StructOpt impl.
StrumDisplay
Converts enum variants to strings.
WithSetters