stop_regex
now supported for OpenAI
#127
slundberg
announced in
Announcements
Replies: 1 comment
-
This is nice and very helpful for getting structured output. Assuming this is using streaming, does OpenAI charge for the full amount of requested tokens, or only for those received before the stream was closed? I think it charges for the full amount, but couldn't find a definitive answer, do you know? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Now you can use regular expressions to stop generations from OpenAI models using the
stop_regex
parameter! (previously this only worked for open source Transformer LLMs)Below is an example where we use
stop_regex
to facilitate a tool use syntax:How does it work?
It streams the results from OpenAI and breaks the stream when we hit a regex match.
Beta Was this translation helpful? Give feedback.
All reactions