File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed
Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ publish = false
88# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99
1010[dependencies ]
11- dioxus = {version = " ~0.5 " , features = [" web" ]}
11+ dioxus = {version = " 0.7 " , features = [" web" ]}
1212futures = " 0.3.30"
1313async-openai-wasm = { path = " ../../async-openai" }
1414# Debug
1515tracing = " 0.1.40"
16- dioxus-logger = " ~0.5 "
16+ dioxus-logger = " 0.7 "
1717serde_json = " 1.0.117"
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ pub const API_KEY: &str = "...";
1616pub fn App ( ) -> Element {
1717 const QUERY : & str = "What's the weather in San Francisco today and the likelihood it'll rain?" ;
1818 let reply = use_signal ( String :: new) ;
19- let _run_assistant: Coroutine < ( ) > = use_coroutine ( |_rx| {
19+ let _run_assistant: Coroutine < ( ) > = use_coroutine ( move |_rx| {
2020 let client = get_client ( ) ;
2121 async move {
2222 //
Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ publish = false
88# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99
1010[dependencies ]
11- dioxus = {version = " ~0.5 " , features = [" web" ]}
11+ dioxus = {version = " 0.7 " , features = [" web" ]}
1212futures = " 0.3.30"
1313async-openai-wasm = { path = " ../../async-openai" }
1414# Debug
1515tracing = " 0.1.40"
16- dioxus-logger = " ~0.5 "
16+ dioxus-logger = " 0.7 "
Original file line number Diff line number Diff line change @@ -15,20 +15,20 @@ const API_KEY: &str = "...";
1515
1616pub fn App ( ) -> Element {
1717 const GREETING : & str = "Hello! How are you?" ;
18- let request = CreateChatCompletionRequestArgs :: default ( )
19- . max_tokens ( 512u16 )
20- . model ( "gpt-3.5-turbo" )
21- . messages ( [ ChatCompletionRequestMessage :: User (
22- ChatCompletionRequestUserMessageArgs :: default ( )
23- . content ( GREETING )
24- . build ( )
25- . unwrap ( ) ,
26- ) ] )
27- . build ( )
28- . unwrap ( ) ;
2918 let response_string = use_signal ( String :: new) ;
30- let _fetch_completion_chunks: Coroutine < ( ) > = use_coroutine ( |_rx| {
19+ let _fetch_completion_chunks: Coroutine < ( ) > = use_coroutine ( move |_rx| {
3120 let mut response_string = response_string. to_owned ( ) ;
21+ let request = CreateChatCompletionRequestArgs :: default ( )
22+ . max_tokens ( 512u16 )
23+ . model ( "gpt-3.5-turbo" )
24+ . messages ( [ ChatCompletionRequestMessage :: User (
25+ ChatCompletionRequestUserMessageArgs :: default ( )
26+ . content ( GREETING )
27+ . build ( )
28+ . unwrap ( ) ,
29+ ) ] )
30+ . build ( )
31+ . unwrap ( ) ;
3232 async move {
3333 let config = OpenAIConfig :: new ( ) . with_api_key ( API_KEY ) ;
3434 let config = if API_BASE != "..." {
You can’t perform that action at this time.
0 commit comments