Closed Strange-Knoll closed 9 months ago
Thank you for PR!
It requires a bit of updates - I left few comments.
I was able to review this today. There are bunch of warnings and requires a bit cleanup, do you mind taking a look please? I'd suggest leave the old example as it is and add this as a new example.
warning: unused imports: `ChatCompletionRequestSystemMessageArgs`, `CreateChatCompletionRequestArgs`, `CreateThreadAndRunRequestArgs`, `CreateThreadAndRunRequest`, `MessageContentTextObject`, `Role`, `config::OpenAIConfig`
--> examples/assistants/src/main.rs:2:86
|
2 | ...::{CreateMessageRequestArgs, CreateRunRequestArgs, CreateThreadRequestArgs, CreateThreadAndRunRequestArgs, CreateThreadAndRunRequest, CreateChatCompletionRequestArgs, ChatCompletionRequestSystemMessageArgs, Role, RunStatus, MessageContent, MessageContentTextObject, C...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
3 | ...t, config::OpenAIConfig,
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unreachable expression
--> examples/assistants/src/main.rs:144:5
|
39 | / loop{
40 | | println!("How can I help you?");
41 | | //get user input
42 | | let mut input = String::new();
... |
142 | | }
143 | | }
| |_____- any code following this expression is unreachable
144 | Ok(())
| ^^^^^^ unreachable expression
|
= note: `#[warn(unreachable_code)]` on by default
warning: unreachable pattern
--> examples/assistants/src/main.rs:136:17
|
136 | _ => {
| ^
|
= note: `#[warn(unreachable_patterns)]` on by default
warning: unused variable: `message_obj`
--> examples/assistants/src/main.rs:52:13
|
52 | let message_obj = client
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_message_obj`
|
= note: `#[warn(unused_variables)]` on by default
In addition few observations:
cargo run
and copy paste the inputs from README. Both are not required but good to have, makes it easier for anyone to run example and cleanup.
Hey this is well written example, I see you put great effort in writing README as well. Many many thanks!
Thank you for your patience too, this has been a long wait!
This example lets you chat with an assistant. It goes through the basic steps of sending queries, doing runs, and retrieving results.