Compare commits
No commits in common. "develop" and "main" have entirely different histories.
|
@ -1,2 +1 @@
|
||||||
/target
|
/target
|
||||||
/.env
|
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,14 +0,0 @@
|
||||||
# Rust GPT Assistant
|
|
||||||
|
|
||||||
## ToDo
|
|
||||||
|
|
||||||
- [ ] Create a Menu using enum
|
|
||||||
- [ ] Create module to read and write to .env (assistants)
|
|
||||||
- [ ] Create module for upload files.
|
|
||||||
- [ ] Create a module for [websearch](https://community.openai.com/t/how-to-enable-web-search-results-with-chatgpt-api/318118/2)
|
|
||||||
- [ ] Add library for markdown in terminal
|
|
||||||
- [ ] Create [code interpreter](https://platform.openai.com/docs/assistants/tools/code-interpreter) Module
|
|
||||||
|
|
||||||
## Reference
|
|
||||||
|
|
||||||
|
|
48
src/main.rs
48
src/main.rs
|
@ -15,37 +15,27 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let thread_request = CreateThreadRequestArgs::default().build()?;
|
let thread_request = CreateThreadRequestArgs::default().build()?;
|
||||||
let thread = client.threads().create(thread_request.clone()).await?;
|
let thread = client.threads().create(thread_request.clone()).await?;
|
||||||
|
|
||||||
////ask the user for the name of the assistant
|
//ask the user for the name of the assistant
|
||||||
//println!("--- Enter the name of your assistant");
|
println!("--- Enter the name of your assistant");
|
||||||
////get user input
|
|
||||||
//let mut assistant_name = String::new();
|
|
||||||
//std::io::stdin().read_line(&mut assistant_name).unwrap();
|
|
||||||
|
|
||||||
////ask the user for the instruction set for the assistant
|
|
||||||
//println!("--- Enter the instruction set for your new assistant");
|
|
||||||
////get user input
|
|
||||||
//let mut instructions = String::new();
|
|
||||||
//std::io::stdin().read_line(&mut instructions).unwrap();
|
|
||||||
//
|
|
||||||
////create the assistant
|
|
||||||
//let assistant_request = CreateAssistantRequestArgs::default()
|
|
||||||
// .name(&assistant_name)
|
|
||||||
// .instructions(&instructions)
|
|
||||||
// .model("gpt-3.5-turbo-1106")
|
|
||||||
// .build()?;
|
|
||||||
//let assistant = client.assistants().create(assistant_request).await?;
|
|
||||||
////get the id of the assistant
|
|
||||||
//let assistant_id = &assistant.id;
|
|
||||||
|
|
||||||
println!("--- Enter the your assistant ID");
|
|
||||||
//get user input
|
//get user input
|
||||||
let mut assistant_id = String::new();
|
let mut assistant_name = String::new();
|
||||||
std::io::stdin().read_line(&mut assistant_id).unwrap();
|
std::io::stdin().read_line(&mut assistant_name).unwrap();
|
||||||
|
|
||||||
// retrives the assistant using the assistant_id
|
//ask the user for the instruction set for the assistant
|
||||||
let assistant = client.assistants().retrieve(&assistant_id).await?;
|
println!("--- Enter the instruction set for your new assistant");
|
||||||
//get the id of the assistant by shadowing from the assistant instance
|
//get user input
|
||||||
let assistant_id: &str = &assistant.id;
|
let mut instructions = String::new();
|
||||||
|
std::io::stdin().read_line(&mut instructions).unwrap();
|
||||||
|
|
||||||
|
//create the assistant
|
||||||
|
let assistant_request = CreateAssistantRequestArgs::default()
|
||||||
|
.name(&assistant_name)
|
||||||
|
.instructions(&instructions)
|
||||||
|
.model("gpt-3.5-turbo-1106")
|
||||||
|
.build()?;
|
||||||
|
let assistant = client.assistants().create(assistant_request).await?;
|
||||||
|
//get the id of the assistant
|
||||||
|
let assistant_id = &assistant.id;
|
||||||
|
|
||||||
loop{
|
loop{
|
||||||
println!("--- How can I help you?");
|
println!("--- How can I help you?");
|
||||||
|
|
Loading…
Reference in New Issue