You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when trying to use contextawareagent example from the docs i get this error AuthenticationError: 401 Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.
at Function.generate (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\error.ts:74:14)
at AzureOpenAI.makeStatusError (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\core.ts:435:21)
at AzureOpenAI.makeRequest (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\core.ts:499:24)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Function.getOpenAIEmbedding (C:\Users\roger\OneDrive\Desktop\bloom\node_modules@llamaindex\openai\dist\index.js:1066:26)
at async batchEmbeddings (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:237:32)
at async Function.getTextEmbeddingsBatch (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:220:16)
at async file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:190:36
at async VectorStoreIndex.getNodeEmbeddingResults (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:87:17)
at async VectorStoreIndex.insertNodes (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:186:17)
at async VectorStoreIndex.buildIndexFromNodes (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:99:9)
at async VectorStoreIndex.init (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:49:13)
at async VectorStoreIndex.fromDocuments (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:128:16)
at async createContextAwareAgent (C:\Users\roger\OneDrive\Desktop\bloom\ragagent.ts:22:17) {
status: 401,
headers: {
'apim-request-id': '22e73053-aa17-4f7a-b33a-3578b4ad68e5',
connection: 'keep-alive',
'content-length': '224',
'content-type': 'application/json',
date: 'Mon, 25 Nov 2024 13:17:21 GMT'
},
request_id: undefined,
error: {
code: '401',
message: 'Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.'
},
code: '401',
param: undefined,
type: undefined
}
looks like its defaulting to azure open ai endpoint but i am using the api key from open ai website . what part of my code do i change ?
when trying to use contextawareagent example from the docs i get this error AuthenticationError: 401 Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.
at Function.generate (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\error.ts:74:14)
at AzureOpenAI.makeStatusError (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\core.ts:435:21)
at AzureOpenAI.makeRequest (C:\Users\roger\OneDrive\Desktop\bloom\node_modules\openai\src\core.ts:499:24)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Function.getOpenAIEmbedding (C:\Users\roger\OneDrive\Desktop\bloom\node_modules@llamaindex\openai\dist\index.js:1066:26)
at async batchEmbeddings (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:237:32)
at async Function.getTextEmbeddingsBatch (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:220:16)
at async file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/@llamaindex/core/embeddings/dist/index.js:190:36
at async VectorStoreIndex.getNodeEmbeddingResults (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:87:17)
at async VectorStoreIndex.insertNodes (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:186:17)
at async VectorStoreIndex.buildIndexFromNodes (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:99:9)
at async VectorStoreIndex.init (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:49:13)
at async VectorStoreIndex.fromDocuments (file:///C:/Users/roger/OneDrive/Desktop/bloom/node_modules/llamaindex/dist/indices/vectorStore/index.js:128:16)
at async createContextAwareAgent (C:\Users\roger\OneDrive\Desktop\bloom\ragagent.ts:22:17) {
status: 401,
headers: {
'apim-request-id': '22e73053-aa17-4f7a-b33a-3578b4ad68e5',
connection: 'keep-alive',
'content-length': '224',
'content-type': 'application/json',
date: 'Mon, 25 Nov 2024 13:17:21 GMT'
},
request_id: undefined,
error: {
code: '401',
message: 'Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.'
},
code: '401',
param: undefined,
type: undefined
}
looks like its defaulting to azure open ai endpoint but i am using the api key from open ai website . what part of my code do i change ?
Settings.llm= new OpenAI({
apiKey: "",
model: 'gpt-4o-mini',
temperature: 0,
},
)
// Create the Context-Aware Agent
const agent = new OpenAIContextAwareAgent({
tools:([]),
contextRetriever: retriever,
});
// Use the agent to answer queries
const response = await agent.chat({
message: "What is LlamaIndex used for?",
});
console.log("Agent Response:", response.response);
}
createContextAwareAgent().catch(console.error);
The text was updated successfully, but these errors were encountered: