This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from fastapi import FastAPI | |
| from ollama import AsyncClient | |
| OLLAMA_HOST = os.getenv('OLLAMA_HOST') | |
| ollama_client = AsyncClient(OLLAMA_HOST) | |
| app = FastAPI() | |
| @app.get("/") | |
| async def read_root(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import boto3 | |
| from fastapi import FastAPI | |
| S3_URL = os.getenv("AWS_ENDPOINT_URL_S3") | |
| svc = boto3.client('s3', endpoint_url=S3_URL) | |
| app = FastAPI() | |
| @app.get("/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import asyncpg | |
| from fastapi import FastAPI | |
| DATABASE_URL = os.getenv("DATABASE_URL") | |
| app = FastAPI() | |
| async def get_db_meta(): | |
| conn = await asyncpg.connect(DATABASE_URL) | |
| records = await conn.fetch("select nspname from pg_namespace;") |