Skip to content

Add a case to ob-gptel--make-callback to ignore reasoning and tool calls#14

Open
bramboomen wants to merge 1 commit into
jwiegley:mainfrom
bramboomen:fix-callback
Open

Add a case to ob-gptel--make-callback to ignore reasoning and tool calls#14
bramboomen wants to merge 1 commit into
jwiegley:mainfrom
bramboomen:fix-callback

Conversation

@bramboomen

Copy link
Copy Markdown

Currently any other response from gptel than a string or 'abort is treated as an error. This results in an error if an LLM performs a tool call or returns its reasoning. In these cases gtpel-request will return a cons cell like (reasoning . text), (tool-call . (...)) or (tool-result . (...)). These get captured by the default route of cond resulting in an error but no error message.

This change only outputs an error if the response is nil, thereby ignoring any reasoning or tool call responses.

This likely solves the error reported by #13

Currently any other response from gptel than a string or 'abort is
treated as an error. This results in an error if an LLM performs a
tool call or returns its reasoning. In these cases gtpel-request will
return a cons cell like (reasoning . text), (tool-call . (...))
or (tool-result . (...)). These get captured by the default route of
cond resulting in an error but no error message.

This change only outputs an error if the response is nil, thereby
ignoring any reasoning or tool call responses.
@trharmon0

Copy link
Copy Markdown

Flipped elpaca over to your repo and branch for this PR and it worked. Ty for your work.

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.

2 participants