File tree Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Expand file tree Collapse file tree 5 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,7 @@ where
485485 if message. data == "[DONE]" {
486486 break ;
487487 }
488-
488+ println ! ( "message: {:?}" , message . data ) ;
489489 let response = match serde_json:: from_str :: < O > ( & message. data ) {
490490 Err ( e) => Err ( map_deserialization_error ( e, message. data . as_bytes ( ) ) ) ,
491491 Ok ( output) => Ok ( output) ,
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ mod projects;
149149mod runs;
150150mod steps;
151151mod threads;
152- mod tools;
152+ pub mod tools;
153153pub mod traits;
154154pub mod types;
155155mod uploads;
@@ -181,7 +181,6 @@ pub use projects::Projects;
181181pub use runs:: Runs ;
182182pub use steps:: Steps ;
183183pub use threads:: Threads ;
184- pub use tools:: { Tool , ToolManager , ToolCallStreamManager } ;
185184pub use uploads:: Uploads ;
186185pub use users:: Users ;
187186pub use vector_store_file_batches:: VectorStoreFileBatches ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ pub trait Tool: Send + Sync {
6565
6666/// A dynamic trait for tools that allows for runtime tool management.
6767/// This trait provides a way to work with tools without knowing their concrete types at compile time.
68- trait ToolDyn : Send + Sync {
68+ pub trait ToolDyn : Send + Sync {
6969 /// Returns the tool's definition as a ChatCompletionTool.
7070 fn definition ( & self ) -> ChatCompletionTool ;
7171
Original file line number Diff line number Diff line change 11use std:: error:: Error ;
22use std:: io:: { stdout, Write } ;
33
4+ use async_openai:: tools:: { Tool , ToolCallStreamManager , ToolManager } ;
45use async_openai:: types:: {
56 ChatCompletionRequestAssistantMessageArgs , ChatCompletionRequestMessage ,
67 ChatCompletionRequestUserMessageArgs , FinishReason ,
78} ;
89use async_openai:: { types:: CreateChatCompletionRequestArgs , Client } ;
9- use async_openai:: { Tool , ToolCallStreamManager , ToolManager } ;
1010use futures:: StreamExt ;
1111use rand:: seq:: SliceRandom ;
1212use rand:: { thread_rng, Rng } ;
@@ -67,7 +67,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
6767 }
6868
6969 if !is_end_with_tool_call {
70- return Err ( "The response is not ended with tool call" . into ( ) ) ;
70+ println ! ( "The response is not ended with tool call" ) ;
7171 }
7272 let tool_calls = tool_call_stream_manager. finish_stream ( ) ;
7373 let function_responses = tool_manager. call ( tool_calls. clone ( ) ) . await ;
Original file line number Diff line number Diff line change 11use std:: io:: { stdout, Write } ;
22
3+ use async_openai:: tools:: { Tool , ToolManager } ;
34use async_openai:: types:: {
45 ChatCompletionRequestAssistantMessageArgs , ChatCompletionRequestMessage ,
56 ChatCompletionRequestUserMessageArgs ,
67} ;
78use async_openai:: { types:: CreateChatCompletionRequestArgs , Client } ;
8- use async_openai:: { Tool , ToolManager } ;
99use futures:: StreamExt ;
1010use rand:: seq:: SliceRandom ;
1111use rand:: { thread_rng, Rng } ;
You can’t perform that action at this time.
0 commit comments