- Introduction
- Architecture Overview
- Setting Up the Environment 3.1. Azure Setup 3.2. Snowflake Setup 3.3. DBT Setup 3.4. Python Environment Setup
This file contains 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 logging | |
import time | |
from typing import Dict, Any | |
import requests | |
from bs4 import BeautifulSoup | |
from openai import OpenAI | |
from requests.exceptions import RequestException | |
from tenacity import retry, stop_after_attempt, wait_random_exponential |
This file contains 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 base64 | |
import json | |
import logging | |
from datetime import datetime, timedelta | |
from typing import List | |
from google.oauth2.credentials import Credentials | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from googleapiclient.discovery import Resource, build | |
from googleapiclient.errors import HttpError |
This file contains 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 logging | |
import csv | |
from typing import List, Dict, Any, Optional | |
from pydantic import BaseModel, create_model, Field, validator, field_validator | |
from openai import OpenAI | |
import time | |
# Set up logging | |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') |
This file contains 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
#!/bin/bash | |
# Update and upgrade Homebrew | |
echo "Updating Homebrew..." | |
brew update | |
brew upgrade | |
# Install nvm (Node Version Manager) | |
echo "Installing nvm..." |
This file contains 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
# settings we’re about to change | |
osascript -e 'tell application "System Preferences" to quit' | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished | |
while true; do | |
sudo -n true | |
sleep 60 | |
kill -0 "$$" || exit |
This file contains 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 sys | |
from article_agent.config import my_api_key, my_cse_id | |
from googleapiclient.discovery import build | |
def get_search_results(search_term: str, num_search_results: int = 10) -> json: | |
"""Perform a Google search using Custom Search API""" | |
# Build request |
This file contains 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 {App, AutoBranchCreation} from '@aws-cdk/aws-amplify-alpha'; | |
import {CfnOutput, SecretValue, Stack, StackProps} from 'aws-cdk-lib'; | |
import {BuildSpec} from 'aws-cdk-lib/aws-codebuild'; | |
import {Construct} from 'constructs'; | |
import {ManagedPolicy, Role, ServicePrincipal} from 'aws-cdk-lib/aws-iam'; | |
import {GitHubSourceCodeProvider} from '@aws-cdk/aws-amplify-alpha/lib/source-code-providers'; | |
import {environmentVariables} from './environmentVariables'; | |
import {CfnApp, CfnBranch} from "aws-cdk-lib/aws-amplify"; | |
import {configuration} from "./config"; |
This file contains 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 serverlessExpress from '@vendia/serverless-express'; | |
import {app} from './app'; | |
let serverlessExpressInstance: any; | |
async function setup (event: any, context: any) { | |
serverlessExpressInstance = serverlessExpress({ app }) | |
return serverlessExpressInstance(event, context) | |
} |
This file contains 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 express from "express"; | |
import cors from "cors"; | |
import apiRoutes from "./api"; | |
import {errorResponder} from "./middleware/errorResponder"; | |
export const app = express(); | |
app.use(cors({origin: '*'})); | |
app.use(express.json()); | |
app.use(express.urlencoded({extended: true})) |