@dataclass
class ServiceContext:
# The LLM used to generate natural language responses to queries.
# If not provided, defaults to gpt-3.5-turbo from OpenAI
# If your OpenAI key is not set, defaults to llama2-chat-13B from Llama.cpp
llm: LLM
# The PromptHelper object that helps with truncating and repacking text chunks to fit in the LLM's context window.
prompt_helper: PromptHelper
# The embedding model used to generate vector representations of text.
# If not provided, defaults to text-embedding-ada-002
# If your OpenAI key is not set, defaults to BAAI/bge-small-en
embed_model: BaseEmbedding
# The parser that converts documents into nodes.
node_parser: NodeParser
# The callback manager object that calls it's handlers on events. Provides basic logging and tracing capabilities.
callback_manager: CallbackManager
@classmethod
def from_defaults(cls, ...) -> "ServiceContext":
...