added gitnore

This commit is contained in:
CHIEFSOFT\ameye
2024-08-15 08:41:27 -04:00
parent f6c2249f77
commit 95c1bc7574
4 changed files with 36 additions and 4 deletions
+1
View File
@@ -0,0 +1 @@
.idea
+2 -1
View File
@@ -1,2 +1,3 @@
uvicorn
fastapi
fastapi
openai
+32 -3
View File
@@ -1,12 +1,41 @@
import uvicorn
from fastapi import FastAPI
from fastapi import FastAPI, HTTPException
from openai import OpenAI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
ask: str
@app.get("/")
def central_function():
return {"Neural":"Nine"}
client = OpenAI()
stream = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "create 10 science questions with answers"}
]
)
return {"Neural":"Nine", "TOTAL": stream }
@app.get("/askai")
def central_function(item: Item):
#print(item.ask)
client = OpenAI()
stream = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "create 10 science questions with answers"}
]
)
return {"Neural":"Nine", "TOTAL": stream }
# return {"Neural":"Nine", "Res2":chunk.choices[0].delta.content, "TOTAL": stream }
if __name__ == "__main__":
uvicorn.run(app, port=3035,host="0.0.0.0")
+1
View File
@@ -11,5 +11,6 @@ services:
- 3035:3035
environment:
- PORT=3035
- OPENAI_API_KEY=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
volumes:
src: