-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Prompty, openai-messages-token-helper and tool calls #2340
Comments
We definitely need to support either function calling, structured outputs, or function calling with structured outputs in this repo. I didn't realize there was currently an issue with the integration, looks like we need additional testing if I missed that. As for prompty versus token-helper: The main goal of token-helper is to truncate conversation history to fit inside context windows. As the newer models have long context window lengths (128K), I'm beginning to think we may not need that truncation. It'd be great if we could remove the token-helper overhead and just assume the conversation fits inside the context window. As for structured outputs vs function calling: the main reason I haven't moved to structured outputs is that it's still not as well supported as function calling across the models and ecosystem. However, it is fairly well supported by Azure OpenAI models, so I'd be up for moving to that instead. Also curious what others think. |
Hi, pamelafox/openai-messages-token-helper#23 (comment) Goal of these PRs is not to support tool_calls with token counting but to transparently coexist with them. I did not attempt to count tokens of tool_calls and related messages but marked in the PR where that needs to be done. But for longer term, I vote against fixing and maintaining token-helper. Although my project may upsize, currently I am far from depleting the context window. I only monitor token use and do rudimentary reaction if at all needed rather than the sophisticated ex-ante approach of token-helper. What do others think? |
Hi,
Prompty apparently has some support for tool calls. It appears that prompty.prepare(prompt, data) compacts the calling ('assistant') message and the subsequent return ('tool') message into a single assistant message:
{'role': 'assistant', 'content': 'None\n\ntool:\n{"functionname": true, "result": ["...", "..."]}'}
The additional assistant message breaks the normal user/assistant cadence that promptmanager relies on:
azure-search-openai-demo/app/backend/approaches/promptmanager.py
Line 63 in d277675
Before considering a fix it would be useful to understand the future evolution of the message management part of the project. In addition to its token accounting feature, openai-messages-token-helper has overlapping features with the recently introduced prompty as both repackage messages (e.g. separating and adding back few-shots and latest user message etc.). I understand that tool calls are not prioritized in this project, however the growing code base translates into more maintenance to ensure that tool calls pass through transparently.
The best course of action also depends on prompty's stance towards tool_calls. Will the current support evolve ?
If tool_calls coexistence remains out of scope in this project then I welcome hints where I should look for a comparable scheme which is more friendly for this project. My current code builds tool calls dynamically to intelligently interface with the procedural world. Would structured outputs with response_format fit this project's philosophy better than tool_calls?
Thanks for the great work on the project
The text was updated successfully, but these errors were encountered: