liveBook · Manning

Conversational ai

As explained in LLMs in Production

An AI assistant is software that interacts with users and performs tasks through artificial-intelligence capabilities.

Conversational AI uses language interaction to make communication easier or automate tasks. An HR help bot can answer recurring questions, while a coding copilot can turn plain-English objectives into code, help recall syntax, write tests, or support learning a language. section 4.5 section 1.1

Some assistants handle specific tasks, such as asking about a gift recipient’s interests and budget before suggesting presents. Other chatbots mainly offer conversation or entertainment. section 1.1

Practical patterns include:

  • An FAQ chatbot trained using prepared company Slack data. section 4.5
  • A coding copilot integrated into VS Code and focused on Python. section 10.0
Listing 4.12 Example of pulling Slack data
import slack_sdk
import pandas

token_slack = "Your Token Here"
client = slack_sdk.WebClient(token=token_slack)

auth = client.auth_test()
self_user = auth["user_id"]

dm_channels_response = client.conversations_list(types="im")

all_messages = {}

for channel in dm_channels_response["channels"]:
    history_response = client.conversations_history(channel=channel["id"])
    all_messages[channel["id"]] = history_response["messages"]

txts = []

for channel_id, messages in all_messages.items():
    for message in messages:
        try:
            text = message["text"]
            user = message["user"]
            timestamp = message["ts"]
            txts.append([timestamp, user, text])
        except Exception:
            pass

slack_dataset = pandas.DataFrame(txts)
slack_dataset.columns = ["timestamp", "user", "text"]
df = slack_dataset[slack_dataset.user == self_user]

df[["text"]].to_parquet("slack_dataset.gzip", compression="gzip")

The example extracts Slack messages, organizes them into a dataset, and filters for the user’s messages as preparation for chatbot training. section 4.5

A Python coding copilot

Build the extension around an already-trained open-source coding model. Use retrieval-augmented generation (RAG), rather than fine-tuning, to make the system easier to update. section 10.0

How LLMs in Production covers it

How deep it goes
Links chatbot dataset preparation to a VS Code copilot built around an existing model and RAG, without detailing assistant internals.
Examples
Uses an HR FAQ chatbot and a Python-focused VS Code copilot to illustrate practical applications.
What it assumes
Requires a Slack token to retrieve Slack messages; specifies no broader background prerequisites.
What you can do after
Build a Python-focused VS Code copilot around an existing coding model and RAG, or prepare Slack data for chatbot training.
How it connects
Connects conversational AI with large language models, retrieval-augmented generation, dataset preparation, and code completion.

Also explained in

Compare how 20 books explain conversational ai →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLMs in Production. The section links point to the parts of the book it draws on.