GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - oscarmmi/support-tool-chatbot: Support chatbot with tool calling: lookup orders, open tickets, store hours (Laravel + Vue).

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
app
app
 
 
bootstrap
bootstrap
 
 
config
config
 
 
database
database
 
 
public
public
 
 
resources
resources
 
 
routes
routes
 
 
storage
storage
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
README.md
README.md
 
 
artisan
artisan
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
phpstan.neon
phpstan.neon
 
 
phpunit.xml
phpunit.xml
 
 
pint.json
pint.json
 
 
pnpm-workspace.yaml
pnpm-workspace.yaml
 
 
tsconfig.json
tsconfig.json
 
 
vite.config.ts
vite.config.ts
 
 

Repository files navigation

Support Tool Chatbot

A small, recruiter-ready customer-support demo built with Laravel 13 and Vue 3. A guest can ask about a sample order, get store hours, or open a support ticket. The assistant can call three explicitly defined tools, and the interface exposes every tool call and result in a live trace panel.

The demo uses sample order data only. It has no customer login, payment flow, carrier integration, or real customer information.

How the AI works

The model does not query the database directly. SupportAgent gives an LlmClient the conversation and strict JSON schemas for the allowed tools. It validates and executes each requested tool through SupportToolRegistry, stores the tool result as a chat message, and asks the model to formulate a final response. Tool errors are returned as structured results, and each request is limited to three tool rounds.

flowchart LR
    User[Guest user] --> UI[Vue chat UI]
    UI -->|message| Agent[SupportAgent]
    Agent -->|conversation + JSON tool schemas| LLM[LlmClient]
    LLM -->|tool request or final reply| Agent
    Agent -->|validated call| Tools[SupportToolRegistry]
    Tools --> Orders[(Sample orders)]
    Tools --> Tickets[(Support tickets)]
    Tools --> Hours[Store hours]
    Tools -->|result| Agent
    Agent -->|assistant reply + persisted tool trace| DB[(SQLite / configured database)]
    DB --> UI
    LLM -. no API key .-> Fake[Deterministic FakeLlmClient]
    LLM -. GEMINI_API_KEY set .-> Gemini[Gemini API, 12s timeout]
Loading

Tools

The tool schemas are defined in app/Services/Support/SupportToolRegistry.php. All tools reject arguments outside their documented schema and return JSON-compatible results.

Tool Strict JSON arguments Result
lookup_order {"order_ref":"ORD-1001"} Order reference, status, estimated delivery date, and item summary. Unknown references return order_not_found instead of throwing.
create_ticket {"subject":"Damaged item","body":"The lamp arrived broken.","order_ref":"ORD-1005"} (order_ref optional) Persists an open support ticket and returns its id and status.
store_hours {} Monday–Saturday, 08:00–18:00; closed Sunday.

App\Services\Llm\LlmClient is the provider boundary. GeminiLlmClient uses Gemini function calling when GEMINI_API_KEY is configured. The HTTP request has a 12-second timeout. Without a key, FakeLlmClient provides a deterministic no-network demo for the supported phrases below; if the provider throws or returns an invalid response, the agent gives the guest a friendly fallback rather than an unhandled 500.

Run locally (no API key required)

Requirements: PHP 8.3+, Composer, Node.js, and npm.

composer install
cp .env.example .env
php artisan key:generate
php -r "file_exists('database/database.sqlite') || touch('database/database.sqlite');"
php artisan migrate --seed
npm install
npm run build
php artisan serve

On Windows PowerShell, replace cp .env.example .env with Copy-Item .env.example .env. Open http://127.0.0.1:8000. The default .env.example uses SQLite, local sessions, and the deterministic fake assistant, so no Gemini account or background service is needed.

For frontend hot reload, run npm run dev in another terminal instead of building assets first. To use Gemini, set GEMINI_API_KEY in .env (optionally set GEMINI_MODEL, which defaults to gemini-2.5-flash) and restart the Laravel server. The key is read server-side and is never sent to the browser.

Demo phrases and seed data

The database seeder adds six fictional orders, including:

  • ORD-1001 — shipped, estimated delivery October 29, 2026.
  • ORD-1002 — delayed, estimated delivery November 2, 2026.

Try these phrases in the guest chat:

  • “Where is order ORD-1001?” — calls lookup_order.
  • “Hours?” or “What are your store hours?” — calls store_hours.
  • “This is broken” — calls create_ticket and saves an open ticket.
  • “Where is order ORD-9999?” — demonstrates a graceful unknown-order tool result.

No account or demo credentials are required. Chat history is scoped to the visitor's browser session.

Tests

Run php artisan test. The feature suite explicitly binds FakeLlmClient, so tests never depend on network access or API credentials. It verifies that:

  • lookup_order returns seeded-format order details.
  • create_ticket persists an open ticket.
  • A guest can send a message and the response includes the tool name and structured result for the UI trace.
  • An unknown order is exposed as a handled tool error and still returns HTTP 200.
  • The assistant can complete a ticket request through the full agent loop.

composer test also runs Pint and Larastan checks before the test suite.

Stack

  • Laravel 13, PHP 8.3+
  • Vue 3, TypeScript, Inertia, Tailwind CSS
  • SQLite by default (other Laravel-supported database connections can be configured)
  • Pest/PHPUnit-compatible Laravel tests

About

Support chatbot with tool calling: lookup orders, open tickets, store hours (Laravel + Vue).

Topics

aichatbotlaravelphpvue

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.