Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from promptengineers-ai/development
Browse files Browse the repository at this point in the history
FROM development INTO master
  • Loading branch information
ryaneggz authored Aug 13, 2023
2 parents 40df111 + e571184 commit 27aa76e
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.env*
.env.local
__pycache__/
.venv/
.pytest_cache/
.vercel
.venv
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Ryan Eggleston

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Prompt Engineers AI - Serverless Chat
<h1 align="center">
🤖 Prompt Engineers AI - Serverless Chat
</h1>

### Useful Links
- [Blog Rocket - Deploying FastAPI to Vercel](https://blog.logrocket.com/deploying-fastapi-applications-to-vercel/)

## 🛠️ Setup and Usage
```bash
python main.py
```

## Deploy
1. Log in to vercel
```bash
vercel login
Expand All @@ -8,4 +19,18 @@ vercel login
2. Deploy to vercel
```bash
vercel .
```
```

## 💡 Issues

Feel free to submit issues and enhancement requests. We're always looking for feedback and suggestions.

## 🤓 Maintainers

- `Ryan Eggleston` - `ryan.adaptivebiz@gmail.com`

## 📜 License

This project is open-source, under the [MIT License](LICENSE). Feel free to use, modify, and distribute the code as you please.

Happy Coding! 🎉🎉
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
httpx
pytest-asyncio
Binary file modified server/__pycache__/api.cpython-310.pyc
Binary file not shown.
21 changes: 7 additions & 14 deletions server/api.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from fastapi.templating import Jinja2Templates
from typing import Any, Optional
from pydantic import BaseModel, Field

import openai
import os

app = FastAPI()
os.environ.get('OPENAI_API_KEY')
templates = Jinja2Templates(directory="static")

#######################################################################
### Pages
#######################################################################
@app.get("/", tags=["Pages"])
async def chat_interface(request: Request):
html_content = """
<html>
<head>
<title>My HTML Page</title>
</head>
<body>
<h1>Welcome to my HTML page!</h1>
<p>This is the content of my HTML page.</p>
</body>
</html>
"""
return HTMLResponse(content=html_content, status_code=200)
"""Serves the index page."""
return templates.TemplateResponse(
"pages/index.html",
{"request": request, "current_page": "home"}
)

#################################################
## ChatGPT
Expand Down
4 changes: 3 additions & 1 deletion static/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<body>

<div class="container">
<h1>Welcome to My Simple Index Page</h1>
<h1>Open AI Serverless Chat</h1>
<p>This is a basic HTML page. You can add your content here and customize it as needed.</p>
<a href="/docs">API Docs</a>
<a href="https://github.com/promptengineers-ai/serverless-chat">Github</a>
</div>

</body>
Expand Down

0 comments on commit 27aa76e

Please sign in to comment.