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

Add Input Mapper in run_on_dataset #6894

Merged
merged 2 commits into from
Jun 29, 2023
Merged

Conversation

vowelparrot
Copy link
Contributor

If you create a dataset from runs and run the same chain or llm on it later, it usually works great.

If you have an agent dataset and want to run a different agent on it, or have more complex schema, it's hard for us to automatically map these values every time. This PR lets you pass in an input_mapper function that converts the example inputs to whatever format your model expects

@dosubot dosubot bot added 03 enhancement Enhancement of existing functionality needs work PRs that need more work labels Jun 29, 2023
@vercel
Copy link

vercel bot commented Jun 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jun 29, 2023 8:37pm

@vowelparrot vowelparrot requested a review from agola11 June 29, 2023 01:17
@dev2049 dev2049 removed the 03 enhancement Enhancement of existing functionality label Jun 29, 2023
@@ -651,6 +694,7 @@ def run_on_dataset(
client: Optional[LangChainPlusClient] = None,
tags: Optional[List[str]] = None,
run_evaluators: Optional[Sequence[RunEvaluator]] = None,
input_mapper: Optional[Callable[[Dict], Any]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of arguments. Also may as well make the other handlers an input mapper at that point?

@vowelparrot vowelparrot merged commit 429f4db into master Jun 29, 2023
14 checks passed
@vowelparrot vowelparrot deleted the vwp/eval_input_mapper branch June 29, 2023 23:53
vowelparrot added a commit that referenced this pull request Jul 4, 2023
If you create a dataset from runs and run the same chain or llm on it
later, it usually works great.

If you have an agent dataset and want to run a different agent on it, or
have more complex schema, it's hard for us to automatically map these
values every time. This PR lets you pass in an input_mapper function
that converts the example inputs to whatever format your model expects
aerrober pushed a commit to aerrober/langchain-fork that referenced this pull request Jul 24, 2023
If you create a dataset from runs and run the same chain or llm on it
later, it usually works great.

If you have an agent dataset and want to run a different agent on it, or
have more complex schema, it's hard for us to automatically map these
values every time. This PR lets you pass in an input_mapper function
that converts the example inputs to whatever format your model expects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs work PRs that need more work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants