ash-project / ash-project/ash_ai

Expose internal ReqLLM data in action response

Open
#182 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
189
Forks
89
Avg merge
8h 32m
Merged PRs (30d)
3

Description

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

### AI Policy

- [x] I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

### Is your feature request related to a problem? Please describe.

Some times there are information that can only be retrieved from the ReqLLM data directly and that is discarded by AshAI.

For example, if I set a limit of tokens and want to check if the LLM generation was stopped by checking ReqLLM metadata field `finish_reason`.

### Describe the solution you'd like

I'm not sure where this data should be stored, maybe in the context? But regardless on where, giving the user a way to retrieve it would be great, either by somehow returning it with the action return value, or, if that is not possible, having some way to handle that inside the action itself (in this case, it would be great if we could update the input data and request a retry (so, for example, in the case I mentioned above regarding max tokens, I would be able to check `finish_reason`, and, if the generating was stopped in the middle because of not enough tokens, I would be able to increase the amount of tokens and retry).

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how AshAI actions call ReqLLM and where their responses are assembled; the issue names no files or tests. Define the response or context path that should expose ReqLLM metadata such as finish_reason, and clarify whether retry behavior is part of done.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.