Skip to content

niraj-toad/ai-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIH (AI Hackathon Template)

A Laravel (10.x) project using Postgres

Setup

  1. Click use this template > Create a new repository
  2. Change owner to your personal account
  3. git clone [your github ssh url]
  4. Open project in your IDE
  5. Install SIDT, and have running.
  6. Configure a PAT for GPR.
  7. cp .env.example .env
  8. docker-compose up --build
  9. scripts/initial_setup.sh
  10. Edit the /etc/hosts file on your system and add 127.0.0.1 aihack.docker
  11. Request OpenAI key from Gregg
  12. Set key to OPENAI_API_KEY in .env
  13. Open aihack.docker/ in web browser (be sure to include the trailing /)

FAQ

How do I change the chatbot's prompt?

Go to app/Http/Controllers/Api/ChatSessionController.php and change the $systemPrompt variable.

How do I change the chatbot's prompt?

Go to app/Http/Controllers/Api/ChatSessionController.php and change the $systemPrompt variable.

How do I change the look of the chatbot?

Go to resources/scripts/common/components/chatbot and change any of the .vue files.

How do I create an embedding?

Go to app/Http/Controllers/Api/ChatMessageController.php and change the findRelatedQuote function.

How do I compare embeddings?

Go to app/Http/Controllers/Api/ChatMessageController.php and change the findRelatedQuote function.

How do I use the API key?

Open the .env file and change the OPENAI_API_KEY variable.

Tests

Unit and feature tests can be run through artisan using php artisan test. Dusk tests can be run using ./scripts/dusk.sh.

Both test commands support --filter <method or data provider label> to run a specific test case or passing a file relative to the project root to run a full test file.

Common Commands

Composer

  • composer install - Installs composer dependencies.
  • composer check-enums - Runs script to validate enums between PHP and TypeScript.
  • composer phpstan - Runs PHPStan for static analysis.
  • composer lint - Runs Pint for linting.
  • composer test - Runs PHPUnit tests.

Assets

  • npm run dev - Spawns Vite dev server for hot reloading.
  • npm run build - Builds assets for production.
  • npm run check-types - Runs vue-tsc to validate types.
  • npm run lint - Runs ESLint for .ts and .vue files.
  • npm run test - Runs Vitest tests.

Other Docs

Environment Variables

Sentry

Used for error collection, the following envs need to be set:

  • SENTRY_LARAVEL_DSN - The DSN for the environment
  • SENTRY_TRACES_SAMPLE_RATE - Percent in decimal (1.0 = 100%) for how many requests to trace.

Dependencies

Composer (Required)

Composer (Required Dev)

Features

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published