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
from langchain_community.llms import Ollama | |
from langchain_community.document_loaders import WebBaseLoader | |
from langchain_community.document_loaders import DirectoryLoader | |
from langchain_community.embeddings import OllamaEmbeddings | |
from langchain_community.vectorstores import FAISS | |
from langchain_core.prompts import ChatPromptTemplate | |
from langchain_text_splitters import RecursiveCharacterTextSplitter | |
from langchain.chains.combine_documents import create_stuff_documents_chain | |
from langchain.chains import create_retrieval_chain | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler |
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
# You will need to install https://github.com/cpursley/html2markdown | |
defmodule Webpage do | |
@moduledoc false | |
defstruct [:url, :title, :description, :summary, :page_age] | |
end | |
defmodule WebSearch do | |
@moduledoc """ | |
Web search summarization chain |
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
#cogs / test.py | |
from discord.ext import commands | |
class Test(commands.Cog): | |
def __init__(self, client): | |
self.client = client | |
@commands.hybrid_command() | |
@commands.cooldown(1, 10, commands.BucketType.user) |