Find answers from the community

Updated 3 months ago

so trying to run a simple call to OpenAI

so trying to run a simple call to OpenAI API inside a workflow. however the query always return the same result even though I want to be random
llm = OpenAI(model="gpt-4o-mini", temperature=0.8)
response = await llm.acomplete("Pick a random word. ONLY RETURN THE WORD")
how can I turn off this behavior and get a new word each time this run?
L
a
3 comments
huh, I don't actually know whats up there. Maybe some weird caching in OpenAI's API?

However:

Plain Text
>>> llm = OpenAI(model="gpt-4o-mini", temperature=0.8)
>>> resp = str(llm.complete("Pick a random word. ONLY RETURN THE WORD"))
>>> print(resp)
Serendipity
>>> resp = str(llm.complete("Pick a random word. ONLY RETURN THE WORD"))
>>> print(resp)
Serendipity
>>> resp = str(llm.complete("Pick a random word. ONLY RETURN THE WORD"))
>>> print(resp)
Serendipity


But then if I change it to ask for two words

Plain Text
>>> resp = str(llm.complete("Pick two random word. ONLY RETURN THE WORDs"))
>>> print(resp)
Serene Chaos
>>> resp = str(llm.complete("Pick two random word. ONLY RETURN THE WORDs"))
>>> print(resp)
Pineapple, Clock
>>> resp = str(llm.complete("Pick two random word. ONLY RETURN THE WORDs"))
>>> print(resp)
Emerald
Quasar
>>> 
I think this might be a specific case when asking for a single word? Idk, strange
yeah I got Serendipity too πŸ™‚ tks for looking at it
Add a reply
Sign up and join the conversation on Discord