embed_model = self.service_context.embed_model for node in keyword_nodes: embed_model.queue_text_for_embedding( node.node.node_id, node.node.get_text(), ) _, text_embeddings = embed_model.get_queued_text_embeddings() for idx in range(len(keyword_nodes)): keyword_nodes[idx].node.embedding = text_embeddings[idx]
Error: AttributeError: 'OpenAIEmbedding' object has no attribute 'queue_text_for_embedding'
text_embeddings = embed_mode.get_text_embedding_batch(texts, show_progress=False)
text_embeddings = await embed_mode.aget_text_embedding_batch(texts, show_progress=False)
embed_model = self.service_context.embed_model nodes_text = [] for node in keyword_nodes: nodes_text.append(node.node.get_text()) text_embeddings = embed_model.aget_text_embedding_batch( nodes_text, show_progress=False ) for idx, node in enumerate(keyword_nodes): keyword_nodes[idx].node.embedding = text_embeddings[idx]
TypeError: 'coroutine' object is not subscriptable
error_data = resp["error"]
KeyError: 'error'
File "/home/jerry/miniconda3/envs/dobby/lib/python3.10/site-packages/openai/api_requestor.py", line 405, in handle_error_response
raise error.APIError(
openai.error.APIError: Invalid response object from API: '{"status":"failure","message":"Portkey Error: API Key Not Found. Error Code:02"}' (HTTP response code was 401)
from llama_index.embeddings.openai import OpenAIEmbedding,
openai.api_base
to portkey proxy urlOpenAIEmbedding(.., api_key=os.environ[..])
additional_kwargs
instead of headers
due to which the headers of portkey were not passed in request.