Skip to content

Commit

Permalink
add marvin settings to transfer openai api key
Browse files Browse the repository at this point in the history
  • Loading branch information
mt7180 committed Jan 23, 2024
1 parent d1e1212 commit df3a103
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/script_RAG.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from llama_index.vector_stores.types import MetadataInfo, VectorStoreInfo

from marvin import ai_model
from marvin import settings as marvin_settings
from llama_index.bridge.pydantic import BaseModel as LlamaBaseModel
from llama_index.bridge.pydantic import Field as LlamaField
import pathlib
Expand All @@ -37,6 +38,8 @@

from .document_categories import CATEGORY_LABELS

marvin_settings.openai.api_key = os.getenv("OPENAI_API_KEY")


class AITextDocument:
"""Loads and converts a text file into LlamaIndex nodes.
Expand Down Expand Up @@ -351,7 +354,6 @@ def set_up_text_chatbot():

try:
url = "https://medium.com/how-ai-built-this/zero-to-one-a-guide-to-building-a-first-pdf-chatbot-with-langchain-llamaindex-part-1-7d0e9c0d62f"
# "https://en.wikipedia.org/wiki/Sandor_Szondi"
document = AIHtmlDocument(url, "gpt-3.5-turbo", callback_manager)
chat_engine.add_document(document)

Expand Down

0 comments on commit df3a103

Please sign in to comment.