Live data from Hacker News

Function calling and other API updates

openai.com

161–170 of 174 posts

Re: Function calling and other API updates

#162
post #150

> With this capability also comes potential risks. We strongly recommend building in user confirmation flows before taking actions that impact the world on behalf of users (sending an email, posting something online, making a purchase, etc). Yeah thanks for the heads up Sam.

This makes me wonder why does OpenAI not build in a mitigation by default that requires a confirmation that they control? Why leave it up to the tool developers to mitigate, many of whom never heard of confused deputy attacks? Seems like a missed opportunity to make things a little more secure.

[deleted]

Re: Function calling and other API updates

#164
post #88

What are you thoughts here regarding functions: I have some data I can pass in CSV format to the context and ask a question against that data. "Who are my best customers?" and pass in a CSV of the top 100 customers. vs I create a function that returns my best customers and call a ChatGPT function. When would I use one or the other? The function call seems like it would be more accurate with better guardrails, but it…

Unless it's a small CSV then I would put it in sqlite or something and tell GPT-4 to write a query given the user's question. I have done that before and worked pretty well. Even worked fairly ok with gpt-3.5. You have to give it context like schema etc. I was even able to get it to output custom-coded embedded Chart.js charts if requested by the user.

We're[0] building a tool that helps you do what you described. We mainly advertise our ability to do this over your data warehouse, like Snowflake, but we also use DuckDB to help people query CSVs.

3.5 has worked pretty well for us in most cases. It's also a good amount faster. GPT-4 seems to really stand out for our complex joins.

- 0 = https://www.definite.app

Re: Function calling and other API updates

#165

Too bad they haven't documented how to disperse functions in the system message ourself, that would have made langchain.js crazy powerful. (I.e create a function that answer the user question in JavaScript, you can call llm(prompt, context) to process the data into natural language and search(query) to find data for the user) - and then you let langchainjs execute the output as apart of its loop

https://i.imgur.com/Cie0IJY.png ahah it works! even on 'older' gpt! this is amazing. and crazy.

Re: Function calling and other API updates

#166
post #145

Earlier quoted context omitted.

Try looking into vector databases to solve that problem. You can chunk up a book and embed those partitions into a vector database. Then you can take a query and fuzzy match the most relevant documents in your vector database, then feed it back to open AI to resolve an answer. It's brilliant. Postgres has an extension to support indexing the vectors, and there are some other open source and turnkey solutions in the m…

Brilliant, but not the same. I think both approaches have their place and are not mutually exclusive.

They are not the same, but your initial problem of throw a whole book at it and have OpenAI give you an answer is a demo that is solvable in 20 lines of langchain code when leveraging a vector DB.

Demo here: https://www.youtube.com/watch?v=h0DHDp1FbmQ (github code is linked within as well)

Re: Function calling and other API updates

#167
post #81

Earlier quoted context omitted.

What I'm thinking is to give it a function called replaceAll that just replaces text, and another one called insertAfter. Maybe also replaceBetween.

Absolutely! I will certainly be experimenting with the new functions as you suggest. One thing which I haven't seen discussed elsewhere is the tension between the output format and the underlying task. When I ask GPT to use a simple, natural output format it does *better* at the actual code editing task. If I ask it to output using a more technical format like `diff -c` or heavily structured json formats... it "gets…

If you're using the API and not the website have you tried setting the temperature to something like 0.2? That may help with the distraction part.

Re: Function calling and other API updates

#168
I was playing with this today made a simple add function that just takes two arguments and adds them and asked it "what is 10+5" and it called my function as you would expect. Then I made my function multiple the numbers. Weirdly gpt called my function twice then simply ignored the functions data and returned the correct answer.

Pretty impressive.

Re: Function calling and other API updates

#169
post #33

Earlier quoted context omitted.

> LLAMA 65B model at a very slow pace How does it compare to GPT 3.5, or 4? I mean if you ask the same questions. Is it usable at all? I tried the models that work with 4090 and they were completely useless for anything practical (code questions, etc.). Curiosities sure, but on Eliza level.

Is there a simple question / answer that you would find illuminating?

the one that I used for GPT-4 and the local ones was a bit obscure:

"how to configure internal pull-up resistor on PCA9557 from NXP in firmware"

the GPT4 would give a paragraph of

> The PCA9557 from NXP is an 8-bit I/O expander with an I2C interface. This device does not have an internal pull-up resistor on its I/O pins, but it does have software programmable input and output states.

and then write a somewhat meaningful code. the local LLMs failed even at the paragraph stage

could you try that?

Re: Function calling and other API updates

#170

I was playing with this today made a simple add function that just takes two arguments and adds them and asked it "what is 10+5" and it called my function as you would expect. Then I made my function multiple the numbers. Weirdly gpt called my function twice then simply ignored the functions data and returned the correct answer. Pretty impressive.

Not sure I like the "I know better" attitude of the LLM in this case. What other function response the LLM is likely to discard?
Post reply on HN