Skip to content

Commit

Permalink
FROM development TO master (#116)
Browse files Browse the repository at this point in the history
* FROM feature/105-configure-mysql-for-db TO development (#106)

* Configured to use MySQL.. We need to make this configurable. Assess the changes for making it also work with SQLite

* Works with MYSQL, was having issues stroing the base64 before

* Close off traffic from everywhere

* Comment out other services

* Adds default user

* login form uses default user

* listen on 8080

* Update port in entyrpoint

* Can deploy to cloudrun

* Deployed to cloudrun

* FROM feature/108-cicd-pipeline-tests TO development (#109)

* Tests work but need to have runs happen before tests happen

* All but test_retrieve_file are passing

* Workflow added

* update

* update

* minio

* UPdate

* update

* add creds to pull image

* update

* env

* Install dev reqs

* Install dev reqs

* Install dev reqs

* Specify backend

* Make src module

* update

* Add another secret

* Create folder for sqlite

* Fixing pipeline

* Take out minio service, using s3

* Will deploy to cloud run when merged into dev

* Fix ci.yml

* Update deploy.yml

* needs build

* build is not going through

* Fix deploy

* Add arm platform

* Updates the v2 auth

* Fix build

* Specify port

* remove port

* Forgot to remote vrom vars

* update env.py

* revemo setvars

* revemo setvars

* Try hardcode

* hardcode

* Updates

* Stop pulling rom ini file

* Major cleanUP

* Believe fixes triggers

* didn't like flags

* Needs app_secret

* uses test secret

* Need Docker Creds

* Messed up docker image in deploy

* Changed some defaults

* Should not run if changes are not in backend folder

* Fix syntax

* Adjusts system message

* Missed one

* Should run tests

* Runs if changes are not in frontend

* Try cache again

* Test cache

* Skip if cached

* appears will need the cache

* FROM feature/101-latest-action-show-in-dropdown TO development (#110)

* init

* Add SearxNG tool

* Better logging and search_tool added

* Clean up Tool docs

* Add docs for tools

* Should run test

* run tests on pr

* Remove frontend constraint

* Should skip tool

* Should tests every push

* Guess it wont

* Can use search tool. Added some tool handling for image formats

* Fixed import statement

* Add search to tools

* update cicd

* Login has spinner (#114)

* FROM feature/113-add-spinner-to-login-button  TO development (#115)

* Login has spinner

* few Updates

* Remove memos

* Made updates, should not run

* Update Changelog

* More paths to ignore

* Forntend updates

* Add docs
  • Loading branch information
ryaneggz authored Jun 30, 2024
1 parent 02d10ea commit 86924a7
Show file tree
Hide file tree
Showing 32 changed files with 355 additions and 158 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ backend/.env*
backend/.dockerignore
backend/lint.py
backend/vercel.json
backend/__pycache__
backend/static
backend/__pycache__
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,26 @@ on:
push:
branches:
- "*"
paths-ignore:
- 'frontend/**'
- '.github/workflows/ci.yml'
- 'Changelog.md'
- 'docker/**'
- 'docker-compose.yml'
- docs/**
- '.dockerignore'
- 'README.md'
pull_request:
types: [opened, synchronize, reopened]

paths-ignore:
- 'frontend/**'
- '.github/workflows/ci.yml'
- 'Changelog.md'
- 'docker/**'
- 'docker-compose.yml'
- docs/**
- '.dockerignore'
- 'README.md'
jobs:

###############################################################
Expand Down
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- bugfix/42-redis-is-default-vector-db (2024-05-26)
- bugfix/33-groq-rag-not-working (2024-05-19)
### Changed
- feature/113-add-spinner-to-login-button (2024-06-29)
- feature/101-latest-action-show-in-dropdown (2024-06-29)
- feature/105-configure-mysql-for-db (2024-06-25)
- feature/98-web-loader-modal (2024-06-23)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Full LLM REST API with prompts, LLMs, Vector Databases, and Agents
</p>

<p align="center">
<img src="https://github.com/promptengineers-ai/llm-server/blob/master/backend/static/llm-server.gif?raw=true" width="600px" />
<img src="https://github.com/promptengineers-ai/llm-server/blob/master/docs/assets/llm-server.gif?raw=true" width="600px" />
</p>

## 🛠️ Setup API Server
Expand Down
Binary file added backend/public/assets/favicon.ico
Binary file not shown.
Binary file added backend/public/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions backend/public/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prompt Engineers AI - LLM Server</title>
<link rel="icon" href="/assets/favicon.ico" />
<style>
html, body {
height: 100%; /* New: Set the height of the html and body to 100% */
margin: 0; /* New: Remove default margin */
}

body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
display: flex; /* New: Set display to flex */
justify-content: center; /* New: Center horizontally */
align-items: center; /* New: Center vertically */
}

h1 {
color: #333;
}

p {
color: #666;
}

.container {
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

display: flex; /* New: Set display to flex */
flex-direction: column; /* New: Stack items vertically */
justify-content: center; /* New: Center items horizontally */
align-items: center; /* New: Center items vertically */
}

.links-container {
display: flex; /* Align children in a row */
justify-content: center; /* Center the links horizontally */
align-items: center; /* Align the links vertically */
gap: 10px; /* Add some space between the links */
}

</style>
</head>
<body>

<div class="container">
<!-- <h1>👨‍💻 Prompt Engineers AI - LLM Server</h1> -->
<img src="../assets/logo.png" />
<div class="links-container">
<a href="https://github.com/promptengineers-ai/llm-server/tree/development/docs"><img src="https://img.shields.io/badge/View%20Documentation-Docs-yellow"></a>
<a href="https://promptengineersai.slack.com/ssb/redirect"><img src="https://img.shields.io/badge/Join%20our%20community-Slack-blue"></a>
</div>
<p style="text-align: center; margin: 10px 0px 0px 0px">This is the beta open-source API for Prompt Engineeers AI</p>
<small style="text-align: center; margin: 5px 30px 30px 30px">Please contact <a href="emailto:ryaneggleston@promptengineers.ai">ryaneggleston@promptengineers.ai</a> for more questions.</small>
<div class="links-container">
<a href="/docs">API</a>
<a href="https://github.com/promptengineers-ai/llm-server">Github</a>
<a href="https://promptengineers.ai">Saas</a>
</div>
</div>

</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
20 changes: 20 additions & 0 deletions docs/general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h1 align="center">
🤖 Prompt Engineers AI - LLM Server
</h1>

<p align="center">
Full LLM REST API with prompts, LLMs, Vector Databases, and Agents
</p>

<p align="center">
<a href="https://promptengineers-ai.gitbook.io/documentation/open-source"><img src="https://img.shields.io/badge/View%20Documentation-Docs-yellow"></a>
<a href="https://join.slack.com/t/promptengineersai/shared_invite/zt-21upjsftv-gX~gNjTCU~2HfbeM_ZwTEQ"><img src="https://img.shields.io/badge/Join%20our%20community-Slack-blue"></a>
</p>

<p align="center">
<img src="https://github.com/promptengineers-ai/llm-server/blob/master/docs/assets/llm-server.gif?raw=true" width="600px" />
</p>


### Table of Contents
- [Tools](https://github.com/promptengineers-ai/llm-server/blob/master/docs/tools)
8 changes: 8 additions & 0 deletions docs/tools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1 align="center">
🛠️ Tools
</h1>

### Table of Contents

- Advanced
- [SearxNG Search](https://github.com/promptengineers-ai/llm-server/blob/master/docs/advanced/searxng_search.md)
17 changes: 9 additions & 8 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"console-feed": "^3.6.0",
"dompurify": "^3.0.9",
"fast-deep-equal": "^3.1.3",
"highlight.js": "^11.9.0",
"jwt-decode": "^4.0.0",
"next": "14.2.2",
"react": "^18",
Expand Down
Binary file added frontend/public/splashscreens/ipad_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/splashscreens/iphone5_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/splashscreens/iphone6_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/splashscreens/iphonex_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/splashscreens/iphonexr_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 55 additions & 1 deletion frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "./globals.css";
import 'highlight.js/styles/github-dark-dimmed.min.css';
import type { Metadata, Viewport } from "next";
import { Inter } from "next/font/google";
import { ThemeProvider } from "@/contexts/ThemeContext";
Expand Down Expand Up @@ -26,7 +27,60 @@ export default function RootLayout({
return (
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark-dimmed.css"></link>
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"
/>
<link
href="splashscreens/iphone5_splash.png"
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/iphone6_splash.png"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/iphoneplus_splash.png"
media="(device-width: 621px) and (device-height: 1104px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/iphonex_splash.png"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/iphonexr_splash.png"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/iphonexsmax_splash.png"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/ipad_splash.png"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/ipadpro1_splash.png"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/ipadpro3_splash.png"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
<link
href="splashscreens/ipadpro2_splash.png"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)"
rel="apple-touch-startup-image"
/>
</head>
<body className={inter.className}>
<ThemeProvider>
Expand Down
34 changes: 20 additions & 14 deletions frontend/src/components/forms/LoginForm.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"use client";
import { useAuthContext } from "@/contexts/AuthContext";
import { useTheme } from "@/contexts/ThemeContext"; // Make sure to import the theme context
import { useAppState } from "@/hooks/state/useAppState";
import { useState } from "react";
import { FaSpinner } from "react-icons/fa";

const LoginForm = () => {
const { theme } = useTheme(); // This will give us the current theme
const { theme } = useTheme();
const {loading, setLoading} = useAppState();
const { login } = useAuthContext();
const [payload, setPayload] = useState({
email: "admin@example.com",
Expand Down Expand Up @@ -44,11 +47,15 @@ const LoginForm = () => {
alert("Email and password are required");
return;
}

setLoading(true);
await login(payload.email, payload.password);
console.log("Login Successful");
// Navigate to dashboard or home page here
} catch (error) {
console.error("Login Failed:", error);
} finally {
setLoading(false);
}
};

Expand Down Expand Up @@ -135,23 +142,22 @@ const LoginForm = () => {
<button
type="submit"
className={`flex w-full justify-center rounded-md px-3 py-1.5 text-sm font-semibold leading-6 text-white ${themeClasses.button} ${themeClasses.shadow} focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-indigo-500`}
disabled={loading} // Disable button when loading
>
Sign in
{loading ? (
<>
<FaSpinner
className="animate-spin"
fontSize={18}
/>
<span className="ml-2">Processing...</span>
</>
) : (
"Sign in"
)}
</button>
</div>
</form>

{/* <p
className={`mt-10 text-center text-sm ${themeClasses.text}`}
>
Not a member?{" "}
<a
href="#"
className={`font-semibold leading-6 ${themeClasses.link}`}
>
Start a 14 day free trial
</a>
</p> */}
</div>
</div>
</>
Expand Down
Loading

0 comments on commit 86924a7

Please sign in to comment.