PermissionDeniedError: Error code: 403 - {'error': {'message': 'You are not allowed to sample from this model'

text davinci 003 is/was a completion model, although there was an embedding variant of that too.

you probably want completions instead : https://platform.openai.com/docs/api-reference/completions

gpt-3.5-turbo-instruct

unless the error came from

docs = db.similarity_search(query,k=k)

but then we’d need to see how that is set up.