Skip to content

{ "message": "Error : An error occurred: 'str' object does not support item assignment." } #7197

Answered by mzamini92
levalencia asked this question in Q&A
Discussion options

You must be logged in to vote

TypeError means that you are trying to assign a value to an object that does not support item assignment. I guess you need to change the way you are assigning the value of metadatas to texts by using a list comprehension.

import logging
import pinecone

from langchain.document_loaders import AzureBlobStorageContainerLoader
from langchain.embeddings import OpenAIEmbeddings


def IndexContainer(storageContainer: str, indexName: str, namespace_name: str):
    logging.info('Python HTTP trigger function IndexContainer processed a request.')

    try:
        pinecone.init(
            api_key=os.getenv("pineconeapikey"),
            environment=os.getenv("pineconeenvironment")
        )

     …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by levalencia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants