MCPcopy Create free account
hub / github.com/ScalingIntelligence/tokasaurus / test_stop

Function test_stop

tests/test_basic.py:148–171  ·  view source on GitHub ↗
(client: OpenAI)

Source from the content-addressed store, hash-verified

146
147
148def test_stop(client: OpenAI):
149 response = client.completions.create(
150 model="",
151 prompt=abc_prompt,
152 max_tokens=20,
153 temperature=0.0,
154 stop=["C"],
155 )
156
157 assert response.choices[0].text == " A B "
158
159 # this is an interesting case because it adds a stop string close to,
160 # but not at, the token limit, so the scheduler finished the sequence
161 # but the model yet hasn't. have had bugs here before regarding block
162 # freeing.
163 response = client.completions.create(
164 model="",
165 prompt=abc_prompt,
166 max_tokens=10,
167 temperature=0.0,
168 stop=["I"],
169 )
170
171 assert response.choices[0].text == " A B C D E F G H "
172
173
174def make_messages(word: str):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected