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
import dspy | |
from dspy.teleprompt import BootstrapFewShot | |
class CoT(dspy.Module): | |
def __init__(self): | |
super().__init__() | |
self.prog = dspy.ChainOfThought("question -> answer") | |
def forward(self, question): |
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 fastapi import FastAPI | |
from langchain_community.vectorstores.faiss import FAISS | |
from langchain_core.output_parsers import StrOutputParser | |
from langchain_core.prompts.chat import ChatPromptTemplate | |
from langchain_core.runnables import RunnablePassthrough | |
from langchain_openai import ChatOpenAI, OpenAIEmbeddings | |
from openai import OpenAI | |
from langtrace_python_sdk import langtrace |