AIBites: Chat Bot AI

access, prompting, usage patterns, limitations, workarounds, examples

“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

A chat bot session is the simplest form of AI-assisted development: open a browser, describe a problem in plain language, and get a response. No API key, no install, no code required.
Fig 1. Chatbot Data Flow
Chat bots are AI applications consisting of: Fig 1 traces the round trip for a single prompt. The browser sends user’s text to the platform’s HTTPS endpoint along with a session token that identifies the current conversation. The platform prepends a system prompt and the full conversation history, then forwards the combined context to the LLM container. The model generates a response one token at a time; those tokens are streamed back through the API and rendered progressively in the browser rather than delivered all at once. The platform also writes the new exchange to its session store so that subsequent prompts in the same chat carry the accumulated context without the user re-supplying it.
Why start with chat bots?
  1. Zero setup - the fastest path from a question to an answer.
  2. Good for understanding an unfamiliar API, pattern, or error message before writing any code.
  3. Prompting for a chat bot and prompting for the API use the same vocabulary - roles, context, constraints - so skills transfer directly.
  4. The limitations of a chat session (no file access, fixed context window, no tool use) make the step up to a CLI agent feel motivated rather than arbitrary.
Table 1 lists several of the most popular AI chat bots and their platforms. Default LLM models are current as of 02/11/2026; new models are released frequently.

Table 1. - Chat Bot Links

Default LLM Model Chat Bot Link Provider Platform
OpenAI: ChatGPT 5.5 https://chatgpt.com/c chat.openai.com/docs
Anthropic: Claude Opus 4.8 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 available for specialized work.
Inclusive list of AI platforms

Table 2. - Inclusive List of AI Platforms

Category AI Platforms
General-Purpose Chat 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, HyperCLOVA X
Developer 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, Replicate, Hugging Face Inference API, IBM watsonx.ai
Open-Source Ecosystems Hugging Face, Ollama, LM Studio, vLLM, Text Generation Inference, KServe, Ray Serve, OpenLLM, LocalAI, SGLang, MLX
Agent & Workflow Platforms LangChain, LangGraph, LlamaIndex, AutoGen, CrewAI, Semantic Kernel, Haystack, DSPy, MetaGPT, OpenAI Agents, Microsoft Copilot Studio, Vertex AI Agents, Zapier AI, n8n AI, SuperAGI
IDE & Developer Workflow GitHub Copilot, Cursor, Codeium, Tabnine, Amazon CodeWhisperer, JetBrains AI Assistant, Sourcegraph Cody, Replit AI, Continue.dev, Aider, CodeGPT
AI-Powered CLIs OpenAI Codex CLI, Aider, Continue, Warp AI, ShellGPT, Claude CLI (Anthropic), Gemini CLI (Google), Ollama CLI, LM Studio CLI, HuggingFace CLI

2.0 - Effective Prompting

Give the bot the code, then ask a specific question. Vague prompts get vague answers. Always specify the language and version; include one concrete example where relevant; state what the code must NOT do.

2.1 - Code Analysis

Effective patterns for code analysis prompts:
Example code-analysis chat (RustDirNav)
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

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

Code metrics
------------
- src/lib.rs: ~258 lines
- examples/test1.rs: ~77 lines

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.

2.2 - Code Generation

State the function signature, the inputs, the expected output, and any constraints. The more precise the spec in the prompt, the less revision the output needs.

2.3 - Documentation

Chat bots produce good first-draft documentation when given the code and the target audience.

3.0 - Usage Patterns

4.0 - Thread Pool Analysis Example

RustThreadPool Repository This example started by downloading the RustThreadPool code as a zip file, then supplying 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 Source
  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 }
ChatGPT 5.2 response artifacts (styles edited for display):
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.rsnew34234
src/lib.rswait58172
src/lib.rspost_message7641
src/lib.rsget_message8161
src/lib.rstest_new93113
examples/test1.rstest_message_in_pool21135
examples/test1.rspost_message_to_pool35152
examples/test1.rsnew5852
examples/test1.rsexecute6352
examples/test1.rsquit6831
examples/test1.rstest_workitem_in_pool74113
examples/test1.rspost_workitem_to_pool87152
examples/test1.rstest01034311
examples/test1.rsmain147111
Note: This analysis works less well for C++ because C++ is harder to parse than Rust and supports function overloading. A dedicated parser such as CppParser handles C++ more reliably.

5.0 - Limitations

Know when to switch tools: When you hit these limits, move to a CLI agent or the API.

6.0 - Workarounds

AI agents and consoles are environments that eliminate most of these workarounds by providing direct filesystem access, tool use, and persistent context. See Code Story: Chat Bots and Code Story: Code AI CLI for next steps.

7.0 - Takeaways

8.0 - References

Resource Description
Claude Anthropic’s chat interface. Best for long-context code tasks.
ChatGPT OpenAI’s chat interface. Large model family with code interpreter.
Gemini Google’s chat interface. Strong at multi-modal and search-grounded tasks.
Perplexity Search-augmented chat interface. Good for current events and citations.
Code Story: Chat Bots Narrative chapter covering prompting strategy and when to move to an agent.
Code Story: Code AI CLI Next step up from chat bots: a CLI agent with file access and tool use.
RustThreadPool Repo Source code used in the Section 4.0 analysis example.