Skip to content

Commit

Permalink
More spell checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jpalvarezl committed Sep 30, 2024
1 parent fe004b7 commit 314dc75
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"downcasted",
"downcasting",
"entra",
"endregion",
"etag",
"eventhub",
"eventhubs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn main() {
.await
.unwrap();

// this pins the stream to the stack so it is safe to poll it (namely, it won't be dealloacted or moved)
// this pins the stream to the stack so it is safe to poll it (namely, it won't be de-alloacted or moved)
futures::pin_mut!(response);

while let Some(result) = response.next().await {
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/inference/examples/chat_completions_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn main() {
.await
.unwrap();

// this pins the stream to the stack so it is safe to poll it (namely, it won't be dealloacted or moved)
// this pins the stream to the stack so it is safe to poll it (namely, it won't be de-alloacted or moved)
futures::pin_mut!(response);

while let Some(result) = response.next().await {
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/inference/src/clients/azure_openai_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl AzureOpenAIClient {
///
/// # Parameters
/// * `endpoint` - The full URL of the Azure OpenAI resource endpoint.
/// * `secret` - The key creadential used for authentication. Passed as header parameter in the request.
/// * `secret` - The key credential used for authentication. Passed as header parameter in the request.
/// * `client_options` - Optional configuration for the client. The [`AzureServiceVersion`](crate::options::AzureServiceVersion) can be provided here.
///
/// # Example
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/inference/src/clients/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use azure_openai_client::{AzureOpenAIClient, AzureOpenAIClientMethods};
pub use chat_completions_client::{ChatCompletionsClient, ChatCompletionsClientMethods};
pub use openai_client::{OpenAIClient, OpenAIClientMethods};

/// A trait that defines the common behaviour expected from an [`OpenAIClient`] and an [`AzureOpenAIClient`].
/// A trait that defines the common behavior expected from an [`OpenAIClient`] and an [`AzureOpenAIClient`].
/// This trait will be used as a boxed types for any clients such as [`ChatCompletionsClient`] so they issue HTTP requests.
trait BaseOpenAIClientMethods {
/// Returns the base [`Url`] of the underlying client.
Expand Down
6 changes: 3 additions & 3 deletions sdk/openai/inference/src/helpers/streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) fn string_chunks<'a>(

return if let Ok(yielded_value) = std::str::from_utf8(&bytes) {
// We strip the "data: " portion of the event. The rest is always JSON and will be deserialized
// by a subsquent mapping function for this stream
// by a subsequent mapping function for this stream
let yielded_value = yielded_value.trim_start_matches("data:").trim();
if yielded_value == "[DONE]" {
return None;
Expand Down Expand Up @@ -95,7 +95,7 @@ pub(crate) fn string_chunks<'a>(
},
);

// We specifically allow the Error::with_messagge(ErrorKind::DataConversion, || "Incomplete chunk")
// We specifically allow the Error::with_message(ErrorKind::DataConversion, || "Incomplete chunk")
// So that we are able to continue pushing bytes to the buffer until we find the next delimiter
return stream.filter(|it| {
std::future::ready(
Expand Down Expand Up @@ -186,7 +186,7 @@ mod tests {
}

#[tokio::test]
async fn event_delimeter_split_across_chunks() {
async fn event_delimiter_split_across_chunks() {
let mut source_stream = futures::stream::iter(vec![
Ok(bytes::Bytes::from_static(b"data: piece 1\n")),
Ok(bytes::Bytes::from_static(b"\ndata: [DONE]")),
Expand Down

0 comments on commit 314dc75

Please sign in to comment.