3 ms·
Are there examples of a langchain agent that uses chat API w/ gpt 3.5 or 4 and works well? I keep trying the library every once in a while, and I like it in the
by bestcoder69 4y ago
Are there examples of a langchain agent that uses chat API w/ gpt 3.5 or 4 and works well? I keep trying the library every once in a while, and I like it in theory, but the more impressive-seeming parts just don’t seem to actually work well.
Eg
- the Agent tool to retrieve webpage content just immediately fills up the context window. You can say “only use it for small pages”, but the agent picks the page!
- “as an AI language model I can’t use any fancy tools”
- I couldn’t mix and match ConversationalAgent with keeping intermediate steps and memory - gave me an error about only allowing certain chain output keys. This one could’ve been fixed by now, but to me it points to how the library’s features don’t necessarily work together just because they’re in the library together
I do find the library to be useful as a survey of prompting techniques though.
For my own chatbot that can use tools, I found I had to lean in to how ChatGPT _wants_ to respond, by getting it to reply in “code mode” (intro text, bullet list of steps, followed by code blocks and outtro). From there the trick is to get it to just write a single line of python (or another lang) where it just calls a function. Then the non-code reply is it’s “scratch pad”, followed by a code block of action invocation. So the only parsing I’m doing is just pulling out the code block and (don’t boo me, it’s just for fun) eval-ing it. But the response format is pretty consistent so I could make a little mini-parser for python func calls.
Before that, I tried and failed to do what langchain does- prompt engineer in the System Prompt in order to get chatgpt to respond in the correct format (thought, action, observation, answer)
- jerpint 4y agoEvery time I read the langchain docs, I get confused, and realize that implementing these things myself won’t take much time and offer me transparency… maybe I’m not the target audience?
- mattizzle81 3y agoI feel the same way. I’m confused as to the value it’s really offering. The LLMs themselves do all the heavy lifting and all you have to do is feed in text and parse output text. Very basic programming. It seems like a bunch of hype to me. I’d rather build my own and have transparency with what’s going on and how prompts etc are being handled.
- ShamelessC 4y agoIt's definitely a strange thing to go from _using_ "raw" GPT-4/chatGPT and how amazing that is for productivity - then having to go back to the old ways of doing things to build a langchain app. You would think the "prompt-plugin-engineer" API would be as easy to use, if not easier.