Skip to content

Commit

Permalink
order
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Jan 3, 2024
1 parent 3183327 commit 1afa075
Show file tree
Hide file tree
Showing 67 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatAnthropic
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import ConfigurableField

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from langchain.agents import AgentExecutor
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatAnthropic
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

from .agent_scratchpad import format_agent_scratchpad
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from typing import Any, Dict, Sequence

from langchain.chains.openai_functions import convert_to_openai_function
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field, ValidationError, conint
from langchain_core.runnables import (
Runnable,
Expand Down
2 changes: 1 addition & 1 deletion templates/bedrock-jcvd/bedrock_jcvd/chain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import BedrockChat
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import ConfigurableField

# For a description of each inference parameter, see
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os

import cassio
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Cassandra
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough

from .populate_vector_store import populate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import cassio
import langchain
from langchain.cache import CassandraCache
from langchain_core.prompts import ChatPromptTemplate
from langchain.schema import BaseMessage
from langchain_community.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnableLambda

use_cassandra = int(os.environ.get("USE_CASSANDRA_CLUSTER", "0"))
Expand Down
2 changes: 1 addition & 1 deletion templates/chat-bot-feedback/chat_bot_feedback/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from langchain.callbacks.tracers.evaluation import EvaluatorCallbackHandler
from langchain.callbacks.tracers.schemas import Run
from langchain.output_parsers.openai_functions import JsonOutputFunctionsParser
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain.schema import (
AIMessage,
BaseMessage,
Expand All @@ -15,6 +14,7 @@
get_buffer_string,
)
from langchain_community.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.runnables import Runnable
from langsmith.evaluation import EvaluationResult, RunEvaluator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import csv

from langchain.chains.question_answering import load_qa_chain
from langchain_core.prompts import PromptTemplate
from langchain_community.embeddings import CohereEmbeddings
from langchain_community.vectorstores import Chroma
from langchain_core.prompts import PromptTemplate

from .chat import chat

Expand Down
2 changes: 1 addition & 1 deletion templates/cohere-librarian/cohere_librarian/router.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnableBranch

from .blurb_matcher import book_rec_chain
Expand Down
2 changes: 1 addition & 1 deletion templates/csv-agent/csv_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import pandas as pd
from langchain.agents import AgentExecutor, OpenAIFunctionsAgent
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain.tools.retriever import create_retriever_tool
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_experimental.tools import PythonAstREPLTool

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Optional

from langchain.output_parsers.openai_functions import JsonKeyOutputFunctionsParser
from langchain_core.prompts import ChatPromptTemplate
from langchain.utils.openai_functions import convert_pydantic_to_openai_function
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_experimental.llms.anthropic_functions import AnthropicFunctions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
from typing import List, Optional

from langchain_core.prompts import ChatPromptTemplate
from langchain.utils.openai_functions import convert_pydantic_to_openai_function
from langchain_community.chat_models import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel

template = """A article will be passed to you. Extract from it all papers that are mentioned by this article.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from langchain.output_parsers import GuardrailsOutputParser
from langchain_core.prompts import PromptTemplate
from langchain_community.llms import OpenAI
from langchain_core.prompts import PromptTemplate

# Define rail string

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

import weaviate
from langchain_core.prompts import ChatPromptTemplate
from langchain.retrievers.weaviate_hybrid_search import WeaviateHybridSearchRetriever
from langchain_community.chat_models import ChatOpenAI
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

# Check env vars
Expand Down
2 changes: 1 addition & 1 deletion templates/hyde/hyde/chain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Chroma
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel

Expand Down
2 changes: 1 addition & 1 deletion templates/llama2-functions/llama2_functions/chain.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.llms import Replicate
from langchain_core.prompts import ChatPromptTemplate

# LLM
replicate_id = "andreasjansson/llama-2-13b-chat-gguf:60ec5dda9ff9ee0b6f786c9d1157842e6ab3cc931139ad98fe99e08a35c5d4d4" # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os

from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import MongoDBAtlasVectorSearch
from langchain_core.documents import Document
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough
from pymongo import MongoClient
Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-advanced-rag/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from typing import List

from langchain.chains.openai_functions import create_structured_output_chain
from langchain_core.prompts import ChatPromptTemplate
from langchain.text_splitter import TokenTextSplitter
from langchain_community.chat_models import ChatOpenAI
from langchain_community.document_loaders import TextLoader
from langchain_community.embeddings.openai import OpenAIEmbeddings
from langchain_community.graphs import Neo4jGraph
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field
from neo4j.exceptions import ClientError

Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-advanced-rag/neo4j_advanced_rag/chain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from operator import itemgetter

from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import ConfigurableField, RunnableParallel

Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-cypher-ft/neo4j_cypher_ft/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from langchain.chains.graph_qa.cypher_utils import CypherQueryCorrector, Schema
from langchain.chains.openai_functions import create_structured_output_chain
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.graphs import Neo4jGraph
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.runnables import RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-cypher-memory/neo4j_cypher_memory/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

from langchain.chains.graph_qa.cypher_utils import CypherQueryCorrector, Schema
from langchain.memory import ChatMessageHistory
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_community.chat_models import ChatOpenAI
from langchain_community.graphs import Neo4jGraph
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-cypher/neo4j_cypher/chain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from langchain.chains.graph_qa.cypher_utils import CypherQueryCorrector, Schema
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.graphs import Neo4jGraph
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-generation/neo4j_generation/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from langchain.chains.openai_functions import (
create_structured_output_chain,
)
from langchain_core.prompts import ChatPromptTemplate
from langchain.schema import Document
from langchain_community.chat_models import ChatOpenAI
from langchain_community.graphs import Neo4jGraph
from langchain_community.graphs.graph_document import GraphDocument
from langchain_core.prompts import ChatPromptTemplate

from neo4j_generation.utils import (
KnowledgeGraph,
Expand Down
2 changes: 1 addition & 1 deletion templates/neo4j-parent/neo4j_parent/chain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Neo4jVector
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

Expand Down
8 changes: 4 additions & 4 deletions templates/neo4j-vector-memory/neo4j_vector_memory/chain.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from operator import itemgetter

from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Neo4jVector
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import (
ChatPromptTemplate,
MessagesPlaceholder,
PromptTemplate,
)
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Neo4jVector
from langchain_core.output_parsers import StrOutputParser
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnablePassthrough

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
)
from langchain.agents.format_scratchpad import format_to_openai_functions
from langchain.agents.output_parsers import OpenAIFunctionsAgentOutputParser
from langchain_core.prompts import (
ChatPromptTemplate,
MessagesPlaceholder,
)
from langchain.schema import Document
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
Expand All @@ -18,6 +14,10 @@
from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper
from langchain_community.vectorstores import FAISS
from langchain_core.messages import AIMessage, HumanMessage
from langchain_core.prompts import (
ChatPromptTemplate,
MessagesPlaceholder,
)
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.runnables import Runnable, RunnableLambda, RunnableParallel
from langchain_core.tools import BaseTool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import List, Tuple

from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_community.chat_models import ChatOpenAI
from langchain_core.messages import AIMessage, HumanMessage
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnablePassthrough
from presidio_analyzer import AnalyzerEngine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatAnthropic, ChatCohere, ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import ConfigurableField

_prompt = ChatPromptTemplate.from_messages(
Expand Down
2 changes: 1 addition & 1 deletion templates/plate-chain/plate_chain/chain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import base64
import json

from langchain_core.prompts import ChatPromptTemplate, SystemMessagePromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate, SystemMessagePromptTemplate
from langchain_core.pydantic_v1 import Field
from langserve import CustomUserType

Expand Down
2 changes: 1 addition & 1 deletion templates/python-lint/python_lint/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from langchain.agents import AgentType, initialize_agent
from langchain.agents.tools import Tool
from langchain_core.prompts import ChatPromptTemplate
from langchain.pydantic_v1 import BaseModel, Field, ValidationError, validator
from langchain_community.chat_models import ChatOpenAI
from langchain_core.language_models import BaseLLM
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import ConfigurableField, Runnable


Expand Down
2 changes: 1 addition & 1 deletion templates/rag-astradb/astradb_entomology_rag/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import AstraDB
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough

from .populate_vector_store import populate
Expand Down
2 changes: 1 addition & 1 deletion templates/rag-aws-bedrock/rag_aws_bedrock/chain.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

from langchain_core.prompts import ChatPromptTemplate
from langchain_community.embeddings import BedrockEmbeddings
from langchain_community.llms.bedrock import Bedrock
from langchain_community.vectorstores import FAISS
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/rag-aws-kendra/rag_aws_kendra/chain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os

from langchain_core.prompts import ChatPromptTemplate
from langchain.retrievers import AmazonKendraRetriever
from langchain_community.llms.bedrock import Bedrock
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/rag-chroma-private/rag_chroma_private/chain.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Load
from langchain_core.prompts import ChatPromptTemplate
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain_community.chat_models import ChatOllama
from langchain_community.document_loaders import WebBaseLoader
from langchain_community.embeddings import GPT4AllEmbeddings
from langchain_community.vectorstores import Chroma
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

Expand Down
2 changes: 1 addition & 1 deletion templates/rag-chroma/rag_chroma/chain.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from langchain_core.prompts import ChatPromptTemplate
from langchain_community.chat_models import ChatOpenAI
from langchain_community.embeddings import OpenAIEmbeddings
from langchain_community.vectorstores import Chroma
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

Expand Down
Loading

0 comments on commit 1afa075

Please sign in to comment.