Find answers from the community

Updated 2 months ago

Google Colab

guys i think there's a bug in the llama-index-llms-portkey package

when i run this notebook, https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/docs/examples/llm/portkey.ipynb

I get an error msg
Plain Text
PydanticUserError: `Portkey` is not fully defined; you should define `Modes`, then call `Portkey.model_rebuild()`.

For further information visit https://errors.pydantic.dev/2.9/u/class-not-fully-defined
L
s
5 comments
like the error says, you could call Portkey.model_rebuild() -- its mostly because of some defered imports I think
although it seems like latest versions of portkey are waaaaay different
i get pydantic.errors.PydanticUndefinedAnnotation: name 'Modes' is not defined if i just call Portkey.model_rebuild()
Yea i found the same. The latest versions of portkey are completely different. You'll need to either downgrade the package, or just use portkey like they recommend in their docs (changing the api_base of openai)
Probably need to delete this class from the docs/codebase tbh
Add a reply
Sign up and join the conversation on Discord