CodeBites: AI Chat Bots

basic access to LLMs through AI platform provided web applications

“The real risk of AI is not that it starts thinking like us, but that we stop thinking because of it.”
- Perplexity.AI

1.0 - Introduction

AI Chat Bots.pdf
YouTube Video
Fig 1. Chatbot Data Flow
Chat Bots are AI applications consisting of: Chat Bots have skills that allow them to read zip files pasted in prompts, create and render HTML, MarkDown, and PDF files in a local sandbox, and send sandbox files to the local download directory. We will have more to say about creating and using skills in a later CodeBite.
Table 1 lists several of the most popular AI Chatbots and their platforms. The default LLM models cited are current as of 02/11/2026. Note that new models are made available frequently, so by the time you read this some of the default models may be updated.

Table 1. - ChatBot Links

Default LLM Model Chat Bot Link Provider Platform
OpenAI: ChatGPT 5.2 https://chatgpt.com/c chat.openai.com/docs
Anthropic: Claude Opus 4.6 https://claude.ai/chat platform.claude.com/docs
Google: Gemini 3 Flash https://gemini.google.com/app ai.google.dev
Perplexity: GPT 5.1 https://www.perplexity.ai/ perplexity.ai/hub/helpcenter
Models listed above and their predecessors have been used for this site. Many others are being used for specialized work. These are listed in the dropdown below.
Inclusive List of Platforms

Table 2. - Inclusive List of AI Platforms

Category AI Platforms
General-Purpose AI Chat Platforms ChatGPT, Claude, Gemini, Microsoft Copilot, Perplexity AI, Meta AI, Mistral Chat (Le Chat), Grok (xAI), You.com, Poe, Reka, ERNIE Bot, Tencent Hunyuan, Tongyi Qianwen, iFlytek Spark, Yandex Alice, HyperCLOVA X
Developer AI Platforms (APIs & SDKs) OpenAI Platform, Anthropic API, Google AI Studio, Vertex AI, Azure OpenAI Service, AWS Bedrock, Mistral API, Cohere, AI21 Labs, Together AI, Fireworks AI, Groq Cloud, DeepInfra, Anyscale, Replicate, Hugging Face Inference API, IBM watsonx.ai, Oracle OCI Generative AI
Open-Source Model Ecosystems Hugging Face, Ollama, LM Studio, vLLM, Text Generation Inference (TGI), KServe, Ray Serve, OpenLLM, LocalAI, SGLang, MLX
Agent & Workflow Platforms LangChain, LangGraph, LlamaIndex, AutoGen, CrewAI, Semantic Kernel, Haystack, DSPy, BabyAGI, MetaGPT, OpenAI Agents, Microsoft Copilot Studio, Vertex AI Agents, Salesforce Einstein Copilot, Zapier AI, n8n AI, Relevance AI, SuperAGI
IDE & Developer-Workflow AI GitHub Copilot, Copilot Chat, Cursor, Codeium, Tabnine, Amazon CodeWhisperer, JetBrains AI Assistant, Sourcegraph Cody, Replit AI, Continue.dev, Aider, CodeGPT
Enterprise & Business AI Platforms Microsoft Copilot for M365, Google Workspace AI, Salesforce Einstein, ServiceNow Now Assist, SAP Joule, Oracle AI, IBM watsonx, Palantir AIP, DataRobot, C3 AI, UiPath AI, Automation Anywhere AI, Workday AI, Notion AI, Slack AI, Zoom AI Companion
Search & Research AI Perplexity, Elicit, Consensus, Scite, Semantic Scholar AI, Connected Papers, Litmaps, You.com Search, Kagi Assistant
Creative & Media AI Midjourney, DALL·E, Stable Diffusion, Adobe Firefly, Leonardo AI, Ideogram, Playground AI, NightCafe, Runway, Pika, Luma AI, Synthesia, HeyGen, Sora, Veo, ElevenLabs, Suno, Udio, Descript, Murf, Resemble AI
Data Science & ML Platforms Vertex AI, AWS SageMaker, Azure ML, Databricks, Weights & Biases, MLflow, Neptune.ai, Kaggle, H2O.ai
Robotics, Vision & Edge AI NVIDIA Omniverse, NVIDIA Isaac, OpenCV AI Kit, ROS AI Stacks, Intel OpenVINO, Edge Impulse, Qualcomm AI Stack
Knowledge Management & Note-Taking AI Notion AI, Obsidian AI Plugins, Mem.ai, Reflect AI, Roam AI, Heptabase AI, Tana AI
Model Routers & Aggregators OpenRouter, Poe, Together AI, Fireworks, Replicate, Modal
AI-Powered CLIs & Local Tools OpenAI Codex CLI, Aider, Continue, Warp AI, ShellGPT, Cursor CLI, Ollama CLI, LM Studio CLI, Claude CLI (Anthropic), Gemini CLI (Google), Cohere CLI, Replicate CLI, LocalAI CLI, HuggingFace CLI, AWS Bedrock CLI, Azure OpenAI CLI, GPT-4All CLI

2.0 - Chat Bot Usage

Fig 2. Example Chatbot Code Analysis
Complete Chat Text
USER PROMPT
============
Analyze the project contained in the zip file pasted below:


ASSISTANT RESPONSE
==================
Here's what's in the uploaded zip and what the project does.

What this project is
--------------------
RustDirNav is a small Rust library crate (rust_dir_nav, v1.1.0, Rust 2018 edition) that performs
a depth-first traversal (DFS) of a directory tree and calls back into an application-defined
handler whenever it encounters:
- a directory (do_dir)
- a file (do_file)

That handler is supplied via a generic type parameter constrained by the DirEvent trait.

Project layout
--------------
- Cargo.toml, Cargo.lock
- src/lib.rs - library implementation
- examples/test1.rs - demo program
- test_dir/ - test directory tree
- README.md, RustDirNav.md, Output.txt
- Pictures/ - screenshots
- *.rs.html - rendered HTML source

Core API
--------
The DirEvent trait defines callbacks:
  fn do_dir(&mut self, d: &str);
  fn do_file(&mut self, f: &str);

DirNav<App> manages:
- file-extension patterns
- recursion and visibility options
- directory and file counters

Traversal behavior
------------------
The visit method performs a depth-first traversal, filtering files by extension, invoking
callbacks, and optionally recursing into subdirectories.

Demo and tests
--------------
The example program demonstrates usage and reports counts. Unit tests validate traversal,
pattern handling, and clear behavior.

Code metrics
------------
- src/lib.rs: ~258 lines
- examples/test1.rs: ~77 lines
- visit() is the most complex function (~10 brace complexity)

Observations
------------
- Uses bitwise OR (|) instead of logical OR (||) for booleans
- Path handling could rely more on PathBuf instead of string replacement
- Extension matching is case-sensitive

Overall
-------
The project cleanly separates traversal logic from application behavior and serves as both
a practical utility and a clear instructional example.
      

3.0 - Limitations

4.0 - Workarounds

AI Agents and Consoles are different environments from the Bots that eliminate some of this need for workargounds. We will discuss each of these in upcoming Bites.

5.0 - Thread Pool Code Analysis Example

RustThreadPool Repository Work for this example started by downloading the code for a Rust ThreadPool from my github repository as a zip file. I then supplied an equivalent to the following prompt to ChatGPT 5.2:
Generate a list of function line counts and complexities for all of the functions in the zip file I've pasted below.
Line count is the total number of lines in each function including code, whitespace, and comments.
Complexity is simply the number of open braces in each function.
Also provide count totals for each file.
Display the lists in an html file using fixed layout tables with colgroup width styles.
Rust ThreadPool Code Figure 1. Rust Thread Pool
    1 /////////////////////////////////////////////////////////////
    2 // rust_thread_pool::lib.rs - threadpool wit BlockingQueue //
    3 //                                                         //
    4 // Jim Fawcett, https://JimFawcett.github.com, 29 Jun 2020 //
    5 /////////////////////////////////////////////////////////////
    6 /*
    7    There are two undefined methods for ThreadPool<M>
    8    that need to be implemented before this design is
    9    complete, e.g.:
   10    - post_work_item posts a function object to input queue
   11    - get_message retrieves results from an output queue
   12 */
   13 #![allow(dead_code)]
   14 use std::fmt::*;
   15 use rust_blocking_queue::*;
   16 use std::thread::*;
   17 use std::sync::*;
   18 use std::default::{Default};
   19
   20 #[derive(Debug)]
   21 pub struct ThreadPool<M>
   22 {
   23     sbq: Arc<BlockingQueue<M>>,
   24     thrd: Vec<Option<JoinHandle<()>>>
   25     /* see note below about Option */
   26 }
   27 impl<M> ThreadPool<M>
   28 where M: Send + 'static
   29 {
   30     /*-----------------------------------------------------
   31       construct threadpool, starting nt threads,
   32       provide threadpool processing as f:F in new
   33     */
   34     pub fn new<F>(nt:u8, f:F) -> ThreadPool<M>
   35     where F: FnOnce(&BlockingQueue<M>) -> () + Send + 'static + Copy
   36     {
   37         /* safely share BlockingQueue with Arc */
   38         let sqm = Arc::new(BlockingQueue::<M>::new());
   39         let mut vt = Vec::<Option<JoinHandle<()>>>::new();
   40         /* start nt threads */
   41         for _i in 0..nt {
   42             /*-----------------------------------------------
   43               ref sq to master shared queue (sqm) is captured
   44               by thread proc closure
   45             */
   46             let sq = Arc::clone(&sqm);
   47             let handle = std::thread::spawn( move || {
   48                 f(&sq);  // thread_pool_processing
   49             });
   50             vt.push(Some(handle));
   51         }
   52         Self { // return newly created threadpool
   53             sbq: sqm,
   54             thrd: vt,
   55         }
   56     }
   57     /*-- wait for threads to finish --*/
   58     pub fn wait(&mut self) {
   59
   60         for handle in &mut self.thrd {
   61             let _ = handle.take().unwrap().join();
   62             /*
   63               This is a hack!
   64               Without the Option, wrapping threadhandle, can't move threadhandle
   65               out of Vec<JoinHandle<()>>, so error in line above.
   66
   67               Can move out of the option as long as we replace
   68               the moved value (take swaps None for Some in option).
   69
   70               I was stumpted until I saw this link.  Apparently a well known hack.
   71               https://users.rust-lang.org/t/spawn-threads-and-join-in-destructor/1613
   72             */
   73         }
   74     }
   75     /*-- post to ThreadPool queue --*/
   76     pub fn post_message(&mut self, _msg:M)
   77     where M:Debug + Clone {
   78         self.sbq.en_q(_msg);
   79     }
   80     /*-- return results to caller --*/
   81     pub fn get_message(&mut self) -> M
   82     where M:Debug + Clone + Default {
   83         /* to be defined */
   84         let m:M = M::default();
   85         m
   86     }
   87 }
   88
   89 #[cfg(test)]
   90 mod tests {
   91     use super::*;
   92     #[test]
   93     fn test_new() {
   94         let test = |bq:&BlockingQueue<String>| {
   95             let msg = bq.de_q();
   96             print!("\n  {:?}", msg);
   97         };
   98         let mut tp = ThreadPool::<String>::new(2, test);
   99         let msg = "test message".to_string();
  100         tp.post_message(msg);
  101         tp.post_message("quit".to_string());
  102         tp.wait();
  103     }
  104 }    
Here are the ChatGPT 5.2 response artifacts. I've edited styles for display.

RustThreadPool Function Line Counts and Complexities

Per-file Summary
File Total lines Function count Sum of complexities
examples/test1.rs 157 9 29
src/lib.rs 104 5 11
Per-function Metrics
File Function Start line Line count Complexity
src/lib.rs new 34 23 4
src/lib.rs wait 58 17 2
src/lib.rs post_message 76 4 1
src/lib.rs get_message 81 6 1
src/lib.rs test_new 93 11 3
examples/test1.rs test_message_in_pool 21 13 5
examples/test1.rs post_message_to_pool 35 15 2
examples/test1.rs new 58 5 2
examples/test1.rs execute 63 5 2
examples/test1.rs quit 68 3 1
examples/test1.rs test_workitem_in_pool 74 11 3
examples/test1.rs post_workitem_to_pool 87 15 2
examples/test1.rs test0 103 43 11
examples/test1.rs main 147 11 1
Note:
This analysis might not work as well for C++ because it is significantly harder to parse than Rust and, unlike Rust, supports function overloading.
It may be easier to write a parser specifically for C++ code analysis. You will find an example in the github Repository: CppParser.

6.0 - takeaways