Find answers from the community

Updated 5 months ago

Google Colab

At a glance

The community members have identified a bug in the llama-index-llms-portkey package. When running a notebook, they receive an error message indicating that the Portkey class is not fully defined and that they need to define Modes and call Portkey.model_rebuild(). However, some community members have found that the latest versions of the portkey package are significantly different, and they suggest either downgrading the package or using portkey as recommended in the documentation (by changing the api_base of OpenAI). One community member suggests that the Portkey class may need to be removed from the documentation and codebase.

Useful resources
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