I have a list of values, an example of which is below:
50/100/150, 75/100/200, 100, 50/100 and so forth.
(a) is there an example to write a prompt to choose all the available options from this list that incldue 100?
(b) can this be extended to say interpolate the values from the list and choose all the available options for a value that was not present say 125?
Welcome to the community.
What have you tried for a prompt so far?
Numbers are difficult for an LLM in general at this point.
What are you trying to do exactly?
{“role”: “user”,
“content”: “500/1000/1500; 200/3000; 2000; 3000; 2000/10000”},
{“role”: “assistant”,
“content”: “6 inch pipe with pressure rating 2000”}
I would expect the bot to choose 2000, 2000/10000 and if it can interpolate 200/3000.
But I am getting sort of verbose answers:
The available pressure ratings for the widget are 2000 and 10000
Yeah, that’s not a lot to go on.
What’s your system prompt look like?
Again, current LLM models are not good at numbers and math generally…
This might be something I’d look into functions for…
Sorry, here you go:
{
“role”: “system”,
“content”: “You are an intelligent assistant. I have widgets that come with various pressure ratings stored a semicolon separated list. Given an example widget, please provide all available pressure ratings the widget may belong to. Please be brief.”
}
Understood! Just wanting to see if forum members had come across something of this nature and if they had some examples that might be available to evaluate.
2 Likes
Yeah, this is going to be a job for functions to grab the data then rewrite it “human-style” for the user… It’s not going to be able to reliably parrot back item information for you, especially with a lot of items.
1 Like
Appreciate your insight here; new to functions here. Any tutorials that demonstrate how to start writing one?
No problem.
I’d start in the docs…
https://platform.openai.com/docs/guides/function-calling
The Quickstart Guide is helpful too… along with the OpenAI Cookbook…
If you search Cookbook for functions, there’s a treasure-trove of data…
This might help?
Happy coding!
2 Likes
Your prompt needs to be reasonably specific about what the options are, and right now you’re not telling the LLM what its options are. Presumably your app has some list of pressure ratings you know how to handle.
The case you’re describing isn’t too hard - here’s an example of what a working prompt looks like (Pressure Ratings — Prompt Fiddle) - but I suspect you’re going to run into issues as you try to do more with the LLM.
2 Likes
Thanks for sharing the example; like your nb as well. However, I saw the response where it singularly picked one value even while you has asked it to pick any of the values. I think in your example there were 2 options that included 2000 and it should have picked both.
Given the example, your best approach would be to use regex.
Again, no LLM is needed to achieve this, simply use old good code filter function.
1 Like
I think in your example there were 2 options that included 2000 and it should have picked both.
Sorry, missed that part - thought you were just choosing a single one. Handling multiple is easy, you just need to ask for an array of applicable options instead: Pressure Ratings — Prompt Fiddle
Again, no LLM is needed to achieve this, simply use old good code filter function.
This misses the point- OP (I presume) is asking about how to implement a simple example using LLMs so that they can do more complex tasks in the future.
2 Likes
Strongly possible, but the trick is that llms consider way more context than humans and asking how to achieve something with LLM giving a simplified example and take the advice to implement it inside a more complex task will fail in most of the cases. So if I want to help someone here, from my personal experience it’s better to answer their questions literally (because they are not the only people who read them) without presuming what they mean. If my answer does not apply to their use case (which I cannot know in advance without additional context) - they will definitely expand on what they really mean when they say the things they say.
This is awesome. I guess I had tried something similar using the word list but JSON makes it very specific and does the job.
This may be a stretch but if it can identify values from a list, in your experience can it interpolate values?
I am able to do one or the other but not perform both the tasks sequentially.
That is correct and good old RegEx can be coerced in performing lot of these tasks. The thing is if we can have a graded way of identifying or figuring out how a LLM can be coerced into performing these tasks, then it becomes matter of time where we can explore the limits of its capabilities. But love all the suggestions here.
1 Like
It can absolutely interpolate values, but with what you’ve described, I’d be concerned about not providing sufficient context to interpolate (although I might be missing some context about your domain). If you share more details I’m happy to help out though.
Would also love to talk in real-time on our community Discord (we have office hours today!) or via the chat function on PromptFiddle!