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 pymongo | |
import os | |
from openai import AzureOpenAI | |
# Replace with your actual values | |
AZURE_OPENAI_ENDPOINT = "https://DEMO.openai.azure.com" | |
AZURE_OPENAI_API_KEY = "DEMO" | |
deployment_name = "gpt-4-32k" # The name of your model deployment | |
MDB_URI = "" | |
# Authenticate and create client |
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
API_KEY = "API_KEY_HERE" | |
MODEL = "accounts/fireworks/models/mixtral-8x7b-instruct" | |
QUESTION = "What is MongoDB?" | |
MONGODB_URI = "mongodb+srv://<uri-goes-here>" | |
import openai | |
from pydantic import BaseModel | |
import json | |
class Result(BaseModel): |
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 requests | |
import scrapetube | |
import json | |
def get_video_urls_from_channel_or_playlist(id, type): | |
if type == 'channel': | |
videos = scrapetube.get_channel(channel_username=id) | |
elif type == 'playlist': | |
videos = scrapetube.get_playlist(id) | |
else: |
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 requests | |
import scrapetube | |
import json | |
def get_video_urls_from_channel_or_playlist(id, type): | |
if type == 'channel': | |
videos = scrapetube.get_channel(id) | |
elif type == 'playlist': | |
videos = scrapetube.get_playlist(id) | |
else: |
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 logging | |
import os | |
import openai | |
import itertools | |
import inspect | |
from actionweaver import action | |
from typing import List | |
from pymongo import MongoClient | |
import json | |
import inspect |
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
exports = async function(FUNCTION_TO_CALL){ | |
const axios = require('axios').default; | |
const OSO_authToken = String(context.values.get("Value-OSO_API")); // Replace with your actual authorization token | |
const OSO_userId = context.user.data.email; | |
let checkOSO = async function(){ | |
const apiUrl = 'https://cloud.osohq.com/api/list'; | |
const requestData = { | |
actor_type: "User", | |
actor_id: OSO_userId, | |
action: "view", |
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 logging | |
import os | |
import openai | |
import itertools | |
import inspect | |
from actionweaver import action | |
from typing import List | |
from pymongo import MongoClient | |
import json |
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
exports = async function(arg){ | |
const axios = require('axios').default; | |
const OSO_authToken = String(context.values.get("Value-OSO_API")); // Replace with your actual authorization token | |
const OSO_userId = context.user.data.email; | |
let checkOSO = async function(){ | |
const apiUrl = 'https://cloud.osohq.com/api/list'; | |
const requestData = { | |
actor_type: "User", |
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 oso_cloud import Oso | |
import pymongo | |
api_key = "<api-key-goes-here>" | |
oso = Oso(url="https://cloud.osohq.com", api_key=api_key) | |
def test_oso(): | |
actor = {"type": "User", "id": "1233"} | |
resource = {"type": "Repository", "id": "456"} |
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 pymongo | |
import pandas as pd | |
import params | |
import openai | |
MONGODB_URI = params.MONGODB_URI | |
DATABASE_NAME = params.DATABASE_NAME | |
COLLECTION_NAME = params.COLLECTION_NAME |