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

Streaming multiple function calls gives an error #63

Closed
ultronozm opened this issue Aug 14, 2024 · 0 comments · Fixed by #64
Closed

Streaming multiple function calls gives an error #63

ultronozm opened this issue Aug 14, 2024 · 0 comments · Fixed by #64

Comments

@ultronozm
Copy link
Contributor

Executing the following code (replacing :key with whatever)

(let* ((provider (make-llm-openai
                  :key (exec-path-from-shell-getenv "OPENAI_API_KEY")
                  :chat-model "gpt-4o"))
       (prompt
        (llm-make-chat-prompt
         "Compute 3+5 and 7+9."
         :temperature 0.1
         :functions
         (list (make-llm-function-call
                :function (lambda (a b)
                            (+ a b))
                :name "add"
                :description "Sums two numbers."
                :args (list (make-llm-function-arg
                             :name "a"
                             :description "A number."
                             :type 'integer
                             :required t)
                            (make-llm-function-arg
                             :name "b"
                             :description "A number."
                             :type 'integer
                             :required t)))))))
  (llm-chat-streaming provider prompt #'ignore #'ignore #'ignore))

yields a complicated args-out-of-range error, ultimately triggered by the function llm-provider-collect-streaming-function-data in llm-openai.el, in the block (setf (llm-provider-utils-function-call-id (aref cvec index)) id), where index is 1 but cvec has length 1. I haven't yet tried to understand exactly why this is happening.

The error doesn't happen if one asks for just one arithmetic operation (e.g., just "3+5").

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 a pull request may close this issue.

1 participant