Find answers from the community

Updated 2 months ago

Iam currently working on an integration

Iam currently working on an integration in llama_index. Iam trying to fix the linting errors in them. I know that running make format; make lint formats and shows me the errors that needs to be fixed.
Can this be configured in VS code extensions of some form so that I don't have to run these commands everytime I fix one and rather resolve the errors in the underlined areas alone ?
L
N
8 comments
I think there's a way to run black automatically, not sure about ruff or mypy

I usually just do all my coding and lint before pushing to a PR. Run black . and ruff . --fix which will fix most errors. Then mypy . will catch any typing errors to resolve
Adding to the same thread, since I am working on an integration, I have a doubt regarding the folder structure.
The integration that Iam working on has a dependency of another library implementation which is kept in the Llama_index repo itself. The main interface of the LLM integration is kept inside llama_index/llms. Question is should the dependency class (or library) be kept inside the same ? Or do you suggest a it could be wrapped inside a folder in llama_index as a sibbling to the folder called llms ?
Hmm, I'm not sure I follow. Maybe it would help if you had more details on the integration you are building?
Iam building an integration for portkey. It is very similar to how langchain is setup (similar but not the same functionality). The main interface exposed to the users is Portkey class derived from the LLM class and contains the abstract methods that are required. Internally, Portkey uses another library to connect to the portkey's backend servers to generate the results from LLM models.
Portkey is an LLM gateway that let's gives the users an observability suite to track their LLM calls.
Creating the Portkey class and it's implementation was fairly straight forward, but the question of where to place the depedency library implementation is the question. The dependency library is called Rubeus and is not a pip installable library yet.
Oh interesting, makes sense πŸ€” A little weird to have a dependency that isn't pip installable πŸ˜… I think putting it in the LLM folder makes sense, (or if it's a single file, in the portkey file works too)
In that case, I will place it in the LLM folder itself. Will group it in a subfolder as well so that it becomes easier and doesn't clutter the structure. Open to feedbacks.
Sounds good!
I figured out a way to check the types in vscode without running linting everytime. Vscode comes with this feature which needs to be enabled. Turning it on underlines the errors related to typechecks as well, making it easier to fix them.
I guess this is from the mypy that was installed in the venv on my local.
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord