Skip to content

Type Object Error in Tutorial Example #71

@CoreyRN

Description

@CoreyRN

Hello,

I've been following the example provided at: https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb

Unfortunately when I get to In [6] I continually obtain the following error in the code:

TypeError Traceback (most recent call last)
in
----> 1 def get_embedding(text: str, model: str=EMBEDDING_MODEL) -> list[float]:
2 result = openai.Embedding.create(
3 model=model,
4 input=text
5 )

TypeError: 'type' object is not subscriptable

Any recommendations on how to fix this would be much appreciated, as I can't seem to find an answer on Stack Overflow.

Thanks so much for your help!

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