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 function calling module for scanpy tl #222

Open
mengerj opened this issue Dec 10, 2024 · 4 comments · Fixed by #232 or #238
Open

Create API function calling module for scanpy tl #222

mengerj opened this issue Dec 10, 2024 · 4 comments · Fixed by #232 or #238
Assignees

Comments

@mengerj
Copy link

mengerj commented Dec 10, 2024

We will work on creating a structured query for an LLM, including the functions and parameters of the scanpy tools module to allow an LLM to run scanpy tools based on a user request.
@vd-dragan21
@bastienchassagnol

@mengerj mengerj changed the title Adding scanpy tools api llm Create API function calling module for snanpy tl` Dec 10, 2024
@mengerj mengerj changed the title Create API function calling module for snanpy tl` Create API function calling module for snanpy tl Dec 10, 2024
@slobentanzer slobentanzer moved this to In Progress in BioCypher Development Dec 10, 2024
@mengerj mengerj changed the title Create API function calling module for snanpy tl Create API function calling module for scanpy tl Dec 10, 2024
@mengerj
Copy link
Author

mengerj commented Dec 10, 2024

Create generic method to generate a pydantic class for each function in a module: biocypher/scverse-x-biochatter#1

  • Input: any python module
  • Output: A list of pydantic classes of all functions (that don't start with "__") available in the module

@mengerj
Copy link
Author

mengerj commented Dec 10, 2024

Example usage of the generic method with scanpy: biocypher/scverse-x-biochatter#2

Problems: expected methods that dont follow a function call with parameters like:adata.var["mt"] = adata.var_names.str.startswith("MT-")

@mengerj
Copy link
Author

mengerj commented Dec 10, 2024

Next steps:
Integrate into biochatter framework

  • include the generic function somewhere
  • create an api_agent module for each desired module (eg. sc.pp, sc.tl,..) that hard codes the module as input to the generic function
  • include the llm.build_tools() etc. into QueryBuilder.parametize_query method
  • write unit tests
  • Try (also as a test or just interactive?) different prompting extends

@mengerj
Copy link
Author

mengerj commented Dec 11, 2024

optional scanpy depandancy, to ensure that user won't have to import scanpy anytime langchain is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment