-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use_vendor_multimodal_model=True is returning "NO_CONTENT" #571
Comments
Hi! |
@BinaryBrain import os Configure SSLssl._create_default_https_context = ssl._create_unverified_context Load environment variables from the .env fileload_dotenv() Retrieve the API keys and other environment variablesLLAMA_CLOUD_API_KEY = os.getenv("LLAMA_CLOUD_API_KEY") Check if necessary API keys are loaded correctlyif not LLAMA_CLOUD_API_KEY: Use SimpleDirectoryReader to parse our filefile_extractor = {".pdf": parser} Print the documents (parsed output)print("Parsed documents:") |
Hi,
Can you share the jobID please?
Le sam. 4 janv. 2025 à 04:37, Namohar ***@***.***> a écrit :
… @BinaryBrain <https://github.com/BinaryBrain> import os
from dotenv import load_dotenv
from llama_parse import LlamaParse
from llama_index.core import SimpleDirectoryReader
import ssl
Configure SSL
ssl._create_default_https_context = ssl._create_unverified_context
Load environment variables from the .env file
load_dotenv()
Retrieve the API keys and other environment variables
LLAMA_CLOUD_API_KEY = os.getenv("LLAMA_CLOUD_API_KEY")
AZURE_OPENAI_ENDPOINT = os.getenv("AZURE_OPENAI_ENDPOINT")
AZURE_OPENAI_CHAT_COMPLETION_DEPLOYED_MODEL_NAME =
os.getenv("AZURE_OPENAI_CHAT_COMPLETION_DEPLOYED_MODEL_NAME")
AZURE_OPENAI_API_KEY = os.getenv("AZURE_OPENAI_API_KEY")
DOWNLOAD_PATH = os.getenv("DOWNLOAD_PATH", "./data")
Check if necessary API keys are loaded correctly
if not LLAMA_CLOUD_API_KEY:
raise ValueError("LLAMA_CLOUD_API_KEY is missing. Please set it in your
.env file.")
if not AZURE_OPENAI_API_KEY or not AZURE_OPENAI_ENDPOINT or not
AZURE_OPENAI_CHAT_COMPLETION_DEPLOYED_MODEL_NAME:
raise ValueError("Azure OpenAI configuration is missing. Please set the
required variables in your .env file.")
try:
# Initialize the LlamaParse parser
parser = LlamaParse(
api_key=LLAMA_CLOUD_API_KEY, # Pass the API key here
result_type="markdown", # "markdown" and "text" are available
use_vendor_multimodal_model=True,
# azure_openai_endpoint=AZURE_OPENAI_ENDPOINT,
azure_openai_deployment_name="gpt-4o",
azure_openai_endpoint=AZURE_OPENAI_ENDPOINT,
azure_openai_api_version="2024-10-01-preview",
azure_openai_key=AZURE_OPENAI_API_KEY,
)
except Exception as e:
print(f"An error occurred while initializing the parser: {e}")
Use SimpleDirectoryReader to parse our file
file_extractor = {".pdf": parser}
documents = SimpleDirectoryReader(input_files=[r'data/canada.pdf'],
file_extractor=file_extractor).load_data()
Print the documents (parsed output)
print("Parsed documents:")
print(documents)
—
Reply to this email directly, view it on GitHub
<#571 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAINB7OCESI6DUI5UQZ7Y6L2I5JRFAVCNFSM6AAAAABULN6LT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZQGAZTENZUHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@BinaryBrain Not sure on what is JobId and where to get that please. |
When it's parsing it displays the jobid on terminal window and I think it can also be seen on the history tab in the playground session. Not sure about latter one. |
When we use "vendor_multimodal_model=True" with Azure OpenAI, we receive a response like "NO_CONTENT." Please assist. Thank you!
The text was updated successfully, but these errors were encountered: