Skip to content

Instantly share code, notes, and snippets.

View fsndzomga's full-sized avatar

Franck Stéphane Ndzomga fsndzomga

View GitHub Profile
from langchain.agents import load_tools
from langchain.llms import OpenAI
from langchain.tools.render import render_text_description
from langchain.agents.output_parsers import ReActSingleInputOutputParser
from langchain.agents.format_scratchpad import format_log_to_str
from langchain import hub
from langchain.agents import AgentExecutor
from config import OPENAI_API_KEY, SERPAPI_API_KEY
import os
import chess
import chess.engine
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents import AgentType
from langchain.llms import OpenAI
from config import OPENAI_API_KEY, SERPAPI_API_KEY
import os
os.environ['OPENAI_API_KEY'] = OPENAI_API_KEY
import wikipedia
import torch
from transformers import BertTokenizer, BertModel
from elasticsearch import Elasticsearch
from config import USER, ELASTIC_PASSWORD
import warnings
warnings.simplefilter(action='ignore', category=Warning)
import wikipedia
import torch
from transformers import BertTokenizer, BertModel
from elasticsearch import Elasticsearch
from config import USER, ELASTIC_PASSWORD
import warnings
import numpy as np
warnings.simplefilter(action='ignore', category=Warning)
# 1. Grouping and organizing imports
from typing import Any
import os
import time
import warnings
from config import OPENAI_API_KEY, USER, ELASTIC_PASSWORD
from pdf2image import convert_from_path
import pytesseract
import autogen
from autogen.retrieve_utils import TEXT_FORMATS
from autogen.agentchat.contrib.retrieve_assistant_agent import RetrieveAssistantAgent
from autogen.agentchat.contrib.retrieve_user_proxy_agent import RetrieveUserProxyAgent
import chromadb
# Define the configuration list for different models
config_list = [
{
# Generate secrets
rails secret:generate
rails secret:generate
# Edit credentials
rails encrypted:edit
active_record_encryption:
primary_key: [generated_primary_key]
deterministic_key: [generated_deterministic_key]
key_deriving_salt: some_salt
class Document < ApplicationRecord
encrypts :content
end
input_features:
- name: genres
type: set
preprocessing:
tokenizer: comma
- name: content_rating
type: category
- name: top_critic
type: binary
- name: runtime