Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create API module for calling the scanpy pl module #221

Open
slobentanzer opened this issue Dec 10, 2024 · 3 comments · Fixed by #226
Open

Create API module for calling the scanpy pl module #221

slobentanzer opened this issue Dec 10, 2024 · 3 comments · Fixed by #226
Assignees

Comments

@slobentanzer
Copy link
Contributor

This issue is to create a module in the API agent that can generate function calls for the scanpy pl module.

@slobentanzer
Copy link
Contributor Author

Today:

  • realised that tools need to parameterised individually, each with its own Pydantic class
  • using the bind_tools functionality to evaluate a list of methods for each call (https://python.langchain.com/docs/how_to/tool_calling/)
  • created submodule for plotting module, with individual pydantic classes for each method from the pl module

Todo:

  • finish adding methods from plotting module to individual pydantic classes
  • add useful unit tests
  • add reasonable benchmark cases for plotting

@slobentanzer slobentanzer linked a pull request Dec 10, 2024 that will close this issue
@slobentanzer
Copy link
Contributor Author

Today:

  • created several fully parameterised pydantic classes to bind to llm to do zero-shot suggestions for tool calls
  • realised that increasing the number of parameters (six classes with 212 fields, see details below)

Todo:

  • assess options to proceed, circumventing this technical limitation
  • evaluate the extent of the limitation; how many fields can we fit, and does it also depend on the number of classes?
  • evaluate feasibility of the manual or semi-automatic approach, considering the envisioned use cases

Fields in classes:

1. ScanpyPlScatterQueryParameters: 15 fields
2. ScanpyPlPcaQueryParameters: 19 fields
3. ScanpyPlTsneQueryParameters: 43 fields
4. ScanpyPlUmapQueryParameters: 47 fields
5. ScanpyPlDrawGraphQueryParameters: 43 fields
6. ScanpyPlSpatialQueryParameters: 45 fields

Total number of fields across all BaseModel classes: **212 fields**

@slobentanzer
Copy link
Contributor Author

Another observation: if we follow the Pydantic paradigm of using title as the method name, this clashes with the plotting parameter of the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant