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
FROM --platform=linux/amd64 node:alpine | |
RUN corepack enable | |
WORKDIR /app | |
COPY package.json pnpm-lock.yaml . | |
RUN pnpm install | |
COPY client.ts . |
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
/** | |
* Deploy with: | |
* | |
* ```bash | |
* pnpx aws-cdk deploy --app 'pnpx tsx infra.ts' | |
* ``` | |
* | |
* When finished, run: | |
* | |
* ```bash |
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
KAMAL_REGISTRY_USERNAME=$KAMAL_REGISTRY_USERNAME | |
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD |
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
FROM python:3.12-slim | |
WORKDIR /app | |
RUN pip install uvicorn fastapi prefect | |
COPY app.py . | |
COPY task.py . | |
EXPOSE 8000 |
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 boto3 | |
def get_s3_client(): | |
# Adapted from: | |
# https://gist.github.com/heitorlessa/5b709df96ea6ac5ddc600545c0683d3b?permalink_comment_id=4314586#gistcomment-431458 | |
return boto3.client( | |
service_name="s3", | |
endpoint_url="localhost:9000", | |
aws_access_key_id="root", | |
aws_secret_access_key="password", |
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 datetime as dt | |
from typing import Any, List, Optional | |
import sqlalchemy as sa | |
import sqlalchemy.orm as orm | |
from llama_index.core.llms import ChatMessage | |
from llama_index.core.storage.chat_store import BaseChatStore | |
from llama_index.core.memory import ChatMemoryBuffer | |
from llama_index.agent.openai import OpenAIAgent |
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
from langchain.schema import StrOutputParser | |
from langchain.prompts import ChatPromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate | |
from langchain_core.runnables import RunnablePassthrough | |
from langchain_community.chat_models import ChatOpenAI | |
llm = ChatOpenAI(api_key='MY_COOL_API_KEY') | |
PROMPT_SYSTEM = ''' | |
You are an experienced SQL developer and database specialist. |
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 json | |
import fiona | |
import shapely | |
import shapely.geometry | |
with fiona.open('data/test.geojson', 'r') as f: | |
geom = next(iter(f)) | |
geom = shapely.geometry.shape(geom.geometry) |
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
CONFIG_SENSOR = { | |
'job': jobs.daily, | |
'monitored_assets': [AssetKey(['b3', 'history', 'daily'])], | |
} | |
@multi_asset_sensor(**CONFIG_SENSOR) | |
def daily(context): | |
""" |
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 io | |
import itertools | |
class IteratorIO(io.RawIOBase): | |
def __init__(self, iterator: [bytes]): | |
super(IteratorIO, self).__init__() | |
self.iterator = iterator | |
def read(self, n: int = -1) -> bytes: |
NewerOlder