Skip to content

TypeError: string indices must be integers in faiss_client.py (line 205) #22

Description

@JoshuaDivineBlessing

Run a vector search using the FAISS client as per the standard workflow (python-sdk), When connected to
'https://workshop.cfg.deloitte.com/cfg-ai-demo/Monolith/api/' with ai-server import
The error occurs at line 205 in faiss_client.py during the creation of the query_vector numpy array.

The code should correctly extract the "response" field from the first item in search_vector and create a numpy array without raising a TypeError.

A TypeError is raised, indicating that search_vector[0] is a string rather than a dictionary.

Image

It appears that search_vector[0] is a string, not a dictionary. The code expects a dictionary with a "response" key, but receives a string instead.

Tested with other FAISS Databases and not able to reproduce the issue.
Need more details/access/data to the specific FAISS db

Error occurs in /opt/semosshome/py/vector_database/faiss/faiss_client.py, line 205.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions