Unverified Commit b6a3b0c6 authored by ishandhanani's avatar ishandhanani Committed by GitHub
Browse files

refactor(2/3): rename dynamo-async-openai to dynamo-protocols (#7565)

parent c84c0934
...@@ -12,7 +12,7 @@ pub async fn try_tool_call_parse_aggregate( ...@@ -12,7 +12,7 @@ pub async fn try_tool_call_parse_aggregate(
parser_str: Option<&str>, parser_str: Option<&str>,
tools: Option<&[super::ToolDefinition]>, tools: Option<&[super::ToolDefinition]>,
) -> anyhow::Result<( ) -> anyhow::Result<(
Vec<dynamo_async_openai::types::ChatCompletionMessageToolCall>, Vec<dynamo_protocols::types::ChatCompletionMessageToolCall>,
Option<String>, Option<String>,
)> { )> {
if parser_str.is_none() { if parser_str.is_none() {
...@@ -28,10 +28,10 @@ pub async fn try_tool_call_parse_aggregate( ...@@ -28,10 +28,10 @@ pub async fn try_tool_call_parse_aggregate(
parsed parsed
.into_iter() .into_iter()
.map( .map(
|parsed| dynamo_async_openai::types::ChatCompletionMessageToolCall { |parsed| dynamo_protocols::types::ChatCompletionMessageToolCall {
id: parsed.id, id: parsed.id,
r#type: dynamo_async_openai::types::ChatCompletionToolType::Function, r#type: dynamo_protocols::types::ChatCompletionToolType::Function,
function: dynamo_async_openai::types::FunctionCall { function: dynamo_protocols::types::FunctionCall {
name: parsed.function.name, name: parsed.function.name,
arguments: parsed.function.arguments, arguments: parsed.function.arguments,
}, },
...@@ -50,7 +50,7 @@ pub async fn try_tool_call_parse_stream( ...@@ -50,7 +50,7 @@ pub async fn try_tool_call_parse_stream(
parser_str: Option<&str>, parser_str: Option<&str>,
tools: Option<&[super::ToolDefinition]>, tools: Option<&[super::ToolDefinition]>,
) -> anyhow::Result<( ) -> anyhow::Result<(
Vec<dynamo_async_openai::types::ChatCompletionMessageToolCallChunk>, Vec<dynamo_protocols::types::ChatCompletionMessageToolCallChunk>,
Option<String>, Option<String>,
)> { )> {
let (parsed, content) = detect_and_parse_tool_call(message, parser_str, tools).await?; let (parsed, content) = detect_and_parse_tool_call(message, parser_str, tools).await?;
...@@ -62,11 +62,11 @@ pub async fn try_tool_call_parse_stream( ...@@ -62,11 +62,11 @@ pub async fn try_tool_call_parse_stream(
.into_iter() .into_iter()
.enumerate() .enumerate()
.map( .map(
|(idx, parsed)| dynamo_async_openai::types::ChatCompletionMessageToolCallChunk { |(idx, parsed)| dynamo_protocols::types::ChatCompletionMessageToolCallChunk {
index: idx as u32, index: idx as u32,
id: Some(parsed.id), id: Some(parsed.id),
r#type: Some(dynamo_async_openai::types::ChatCompletionToolType::Function), r#type: Some(dynamo_protocols::types::ChatCompletionToolType::Function),
function: Some(dynamo_async_openai::types::FunctionCallStream { function: Some(dynamo_protocols::types::FunctionCallStream {
name: Some(parsed.function.name), name: Some(parsed.function.name),
arguments: Some(parsed.function.arguments), arguments: Some(parsed.function.arguments),
}), }),
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
# Licensed under Apache 2.0 # Licensed under Apache 2.0
[package] [package]
name = "dynamo-async-openai" name = "dynamo-protocols"
description = "Fork of async-openai customized for Dynamo." description = "Protocol types for OpenAI-compatible inference APIs, forked from async-openai."
license = "Apache-2.0 AND MIT" license = "Apache-2.0 AND MIT"
version.workspace = true version.workspace = true
edition.workspace = true edition.workspace = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment