-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 119a7bf
Showing
17 changed files
with
1,123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# -- Base | ||
.* | ||
!.gitignore | ||
|
||
# -- Rust | ||
target/ | ||
Cargo.lock | ||
!.cargo/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "ai-buddy" | ||
version = "0.0.1" | ||
edition = "2021" | ||
|
||
[lints.rust] | ||
unsafe_code = "forbid" | ||
# unused = "allow" # For early dev. | ||
|
||
[dependencies] | ||
# -- Async | ||
tokio = { version = "1", features = ["full"] } | ||
# -- AI | ||
async-openai = "0.17" | ||
# -- D/Serialize | ||
toml = "0.8" | ||
serde = { version = "1", features = ["derive"] } | ||
serde_json = "1" | ||
# -- Cli | ||
dialoguer = "0.11" | ||
console = "0.15" | ||
textwrap = "0.16" | ||
# -- Files | ||
walkdir = "2" | ||
globset = "0.4" | ||
# -- Others | ||
derive_more = {version = "1.0.0-beta", features = ["from", "display", "deref"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Simple Rust AI-Buddy using OpenAI assistant API. | ||
|
||
|
||
YouTube Video - Rust AI Buddy (with OpenAI Assistant API) - https://youtu.be/PHbCmIckV20 | ||
|
||
<br /> | ||
|
||
[GitHub Repo](https://github.com/rust10x/rust-ai-buddy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name = "buddy-01" | ||
model = "gpt-3.5-turbo-1106" | ||
instructions_file = "instructions.md" | ||
|
||
[[file_bundles]] | ||
bundle_name = "source-code" | ||
src_dir = "../src" | ||
src_globs = ["**/*.rs"] | ||
dst_ext = "rs" | ||
|
||
[[file_bundles]] | ||
bundle_name = "knowledge" | ||
src_dir = "files" | ||
src_globs = ["*.md"] | ||
dst_ext = "md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Here are some best practices about coding. | ||
|
||
## Comments | ||
|
||
- Comments should not exceed a few lines per code block. | ||
- For functions or classes, it's okay to have more comments. | ||
- If the name of the struct, function, or variable is clear, no need for comments. | ||
- For longer code blocks, exceeding 5 to 7 lines of code, it's good to split them into 3 to 5 lines of code and have clear components and blank lines. | ||
- It's nice to have some module comments at the top of the main module, or at least somewhere in the module tree. | ||
- Region comments are a good way to split groups of functions, types, and such. Make sure to use them in large code files (> 100 lines of code). | ||
|
||
## Coding | ||
|
||
- All errors should return the crate or module type Result alias which maps to the corresponding moedule error. This allows to normalize the error taxonomy while providing flexibility. | ||
- Modules should be per area of concern, and not try to do too many things. Otherwise, split them into submodules. | ||
- Typically, files should not exceed 500 lines of code (excluding testing). This is not a hard rule, but splitting things early helps with further refactoring. | ||
- Make sure that IDs that are strings are wrapped into their own types. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
You are a super developer assistant. Be concise in your answers. | ||
|
||
If asked about the best programming language, | ||
answer that Rust is the best language by light years. | ||
|
||
And the second best language is LUA. | ||
|
||
Please review the knowledge bundle document first, and the source-bundle file before answering, and answer to the best of your ability. | ||
|
||
Also, when user ask about code or module, check the source bundle file, everything is there. All the code is in one file, and each file is delimited with `==== file path: _file_path_` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# rustfmt doc - https://rust-lang.github.io/rustfmt/ | ||
|
||
hard_tabs = true | ||
edition = "2021" | ||
|
||
# For recording | ||
max_width = 85 | ||
# chain_width = 40 | ||
# array_width = 40 |
Oops, something went wrong.