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 typing import List | |
from actionweaver import RequireNext, action, SelectOne | |
from actionweaver.llms.azure.chat import ChatCompletion | |
from actionweaver.llms.openai.tools.chat import OpenAIChatCompletion | |
from actionweaver.llms.openai.functions.tokens import TokenUsageTracker | |
from langchain.embeddings import GPT4AllEmbeddings | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
import json | |
import os | |
import pymongo |
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 the necessary libraries | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
from bs4 import BeautifulSoup | |
# Set up the headless browser | |
options = Options() | |
options.headless = True | |
options.add_argument("--headless") | |
options.add_argument('--disable-gpu') |
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 | |
from langchain.embeddings import AzureOpenAIEmbeddings | |
MONGODB_URI = "" | |
client = pymongo.MongoClient(MONGODB_URI) | |
db = client["sample_mflix"] | |
collection = db["embedded_movies"] | |
azureEmbeddings = AzureOpenAIEmbeddings( | |
deployment="", |
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 enum import Enum | |
from typing import List, Optional, Tuple | |
from actionweaver import RequireNext, SelectOne, action | |
from actionweaver.llms.azure.chat import ChatCompletion | |
from actionweaver.llms.openai.tokens import TokenUsageTracker | |
from langchain.vectorstores import MongoDBAtlasVectorSearch | |
from langchain.embeddings import GPT4AllEmbeddings | |
from langchain.document_loaders import PlaywrightURLLoader | |
from llama_index import Document, ServiceContext |
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 tiktoken | |
import openai | |
from bs4 import BeautifulSoup | |
import requests | |
class OpenAISummarize(object): | |
def __init__(self, api_key:str="", model:str="gpt-3.5-turbo",max_words:int=200,max_sections:int=2,deployment_id:str="", api_version:str="", api_base:str="" ) -> None: | |
self.api_key = api_key | |
self.deployment_id = deployment_id | |
self.api_version = api_version |
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 tiktoken | |
import openai | |
from bs4 import BeautifulSoup | |
import requests | |
class OpenAISummarize(object): | |
def __init__(self, api_key:str="", model:str="gpt-3.5-turbo",max_words:int=200,max_sections:int=2,deployment_id:str="", api_version:str="", api_base:str="" ) -> None: | |
self.api_key = api_key | |
self.deployment_id = deployment_id | |
self.api_version = api_version |
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 autogen.agentchat.contrib.retrieve_assistant_agent import RetrieveAssistantAgent | |
from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent | |
import autogen | |
config_list = [ | |
{ | |
'model': 'gpt-3.5-turbo', | |
'api_key': 'sk-', | |
}, | |
] |
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 openai import AzureOpenAI | |
from openai import OpenAI | |
#v1 beta openai https://github.com/openai/openai-python/discussions/631 | |
#assistants: https://platform.openai.com/docs/assistants/how-it-works | |
#AZURE | |
# gets the API Key from environment variable AZURE_OPENAI_API_KEY | |
client = AzureOpenAI( | |
api_version="2023-09-01-preview", | |
azure_endpoint="https://.openai.azure.com", |
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 council.agents import Agent | |
from council.chains import Chain | |
from council.llm import AzureLLM | |
from council.skills import LLMSkill | |
from council.agents import Agent | |
from council.filters import BasicFilter | |
from council.controllers import LLMController | |
from council.evaluators import LLMEvaluator | |
import os |
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 itertools | |
import openai | |
from actionweaver.llms.openai.chat import OpenAIChatCompletion | |
from actionweaver import action, RequireNext,SelectOne | |
openai.api_key = "sk-" #os.getenv("OPENAI_API_KEY") | |
from pymongo import MongoClient | |
import json | |
connection_string="mongodb+srv://abc123:[email protected]/?retryWrites=true&w=majority" | |
mongodb_client = MongoClient(connection_string) |