Rust AI Function Calling - Full Tutorial (with async-openai)

Опубликовано: 19 Октябрь 2024
на канале: Jeremy Chone
4,904
210

Full tutorial on coding AI function calling in Rust programming. We will be using the OpenAI API, but similar approaches can be applied with Mistral, Mixtral, LLAMA, Gemini, and many other LLMs.

GitHub repo: https://github.com/jeremychone-channe...

Rust10x extension: https://rust10x.com/vscode

This video includes 6 chapters coded as examples. See below for the chapter/section markers.

00:00:00 Overview
00:01:36 C00 - Setup - Cargo.toml / dependencies
00:03:50 C00 Setup - Error.rs
00:07:11 C01 - Simple Chat
00:23:09 C02 - Tool Calls
00:34:23 C03 - Tool Responses
00:52:11 C04 - Conv refactoring
01:03:36 C05.1 - Continue refactor for schema.rs
01:14:24 C05.2 - Schema.rs and Spec
01:31:09 C05.3 - into spec params
01:46:50 C06.1 - joinset - concurrent OpenAI Request
01:51:44 C06.2 - Bonus - rpc_router state (i.e. resources)

https://rust10x.com for more production coding in Rust.

Dev Note on Rust Analzyer - [16962 - Type inlays are not clickable anymore (since 2024-03-24 release)](https://github.com/rust-lang/rust-ana...)

== Jeremy Chone:

Patreon -   / jeremychone   - Any help is a big help (for Rust educational content)
Twitter -   / jeremychone  
Discord general-rust -   / discord  
Discord rust10x -   / discord  
Rust10x - https://rust10x.com - Rust resources for production coding.

Big thanks to CrabNebula (https://crabnebula.dev/) for sponsoring this channel.

== Rust10x AI / OpenAI / Ollama

Rust OpenAI API Tutorial:    • Learn Rust OpenAI API - Building AI B...  

Rust Ollama Tutorial:    • Rust Ollama By Examples - 4 Chapters ...  

== Rust10x Web App production coding:

Episode 01:    • Rust Axum Production Coding (E01 - Ru...  
Episode 02:    • Rust Sea-Query + SQLX + ModQL (E02 - ...  
Episode 03:    • Rust Workspace Production By Example ...  
Episode 04:    • Rust Argon 2 Password Hashing with Mu...  
Episode 05.1:    • Rust RPC Router - Axum/Tower/Bevy Sty...  


Web Site: https://rust10x.com/web-app
GitHub: https://github.com/rust10x/rust-web-app
Discord rust10x -   / discord  
Patreon -   / jeremychone   - Any help is a big help (for Rust Production Coding educational content)

== Other

Other popular Rust Programming videos:

Rust Web App Production Coding Blueprint -    • Rust Axum Production Coding (E01 - Ru...  
Rust Axum - Full Course -    • Rust Axum Full Course - Web Developme...  
Rust Type State Builder Pattern -    • Rust Programming: TypeState Builder P...  
Quick Start Code Layout -    • Rust - Simple Code Layout (start simp...  
AWESOME-APP Full Overview - Rust template for building Awesome Desktop Application:    • Building Awesome Desktop App with Rus...  
Tauri Quick Introduction (Desktop App wit Rust Programming):    • Rust Tauri 1.0 - Quick Intro - Rust D...  
Rust Web App tutorials series:    • Rust Web App - 1/3 - Data Access  
Rust Bevy Full Tutorial - Game Development with Rust:    • Rust Bevy Full Tutorial - Game Develo...  
Rust for Java Developers series:    • Rust for Java Developers 1/3 - Introd...  

Playlists:

Rust Web App Production Coding Series:    • JC - Rust Production Coding - Web App...  
Rust For Desktop App:    • JC - Rust Programming for Desktop App  
Everything Rust Programming - Tutorials, Courses, Tips, Examples:    • JC - Rust - Everything Rust Programmi...  
Rust Programming for Web Development:    • JC - Rust Programming for Web Develop...  
Rust Courses:    • Rust Course 2021 by the book | RustLang  
Rust for Java Developers:    • Rust for Java Developers  


Rust10x - Coding Resources for Production Coding in Rust. ➜ https://rust10x.com

Other notes:

ScreenBrush for the green lines. (Gromit seems to be the equivalent on Linux)
Sketchapp for some graphics.
Davinci Resolve and Fusion video editing.
VSCode with Google Material icon themes (with some customization)