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 "processed_content" to ToolResult struct and support storing Elixir data from function results #192

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

brainlid
Copy link
Owner

This allows an Elixir function executed by an LLM through a LangChain.Message.ToolCall and LangChain.Function definition to return and store the raw Elixir data structure in the matching LangChain.Message.ToolResult.

An Elixir function can return a 3-item tuple like this:

{:ok, "llm result text", raw_result}

Where the elixir_data_to_keep is assigned to the %ToolResult{processed_content: raw_result}.

  • documentation updates
  • LLMChain.execute_tool_call supports Elixir functions returning a 3-item tuple with the raw result

- added test
- documentation updates
- LLMChain.execute_tool_call supports Elixir functions returning {:ok, "llm result text", elixir_data_to_keep}
@brainlid brainlid merged commit 887e025 into main Nov 21, 2024
1 check passed
@brainlid brainlid deleted the me-function-return-processed branch November 21, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant