emil14
Joined 3 years ago
Joined 3 years ago
2) What wrapping would you add out there? (Wrapping must be added in provider's implementations though)
3) No, user shouldn't and can't handle errors by implementing operation handler. To handle error it simply uses go's native mechanism "v, err := ... ; if err != nil", it just needs to be done once instead of doing so for every operation in the process
100% will do, just not for the initial release
> fwiw I really like agency's interceptor funcs, good place to add tracing, metrics, logging, etc.
thank u much, glad to hear it :)
We use someone else's abstractions all the time, when they are good :) Think of reactjs, expressjs, django, etc.
> Abstracting away the flows (agency/langchain) is the wrong layer of abstraction
But you do abstract away SQL when you write business logic isn't it? Many people uses ORMs for that, which gives ability to easily switch databases and write tests. Why do you think this isn't the same?
> langchain had hardcoded prompts, which make it difficult to experiment and iterate
Agency does not and won't have anything like that except it's going to make a LOT of sense. Even then there 100% will be to control that stuff.
> Where is the complexity hidden?
The biggest complexity was to design the library to be small, simple and extensible. It's not a lot of abstractions out there.
But the better answer to your question is probably something like - "complexity is hidden behind how providers implement core interfaces"
2) you can write abstract code without explicit dependency on openai and easely switch to e.g. anthropic in future without rewriting the whole thing (think of ORM for LLMs)
3) ready to use abstraction like Process that allows to chain operations (more complex stuff is much easier than writing by hand)
2) "I was hoping this would be a drop in replacement for langchain" - why don't use use langchaingo then? The thing is - we don't like langchain much. To is it looks too complex, we thing we can do better, simpler. The final goal is to make a library that can replace langchain and/or autogen but it's definitely not gonna be "drop-in" replacement
Instead of writing:
result, err := operationFoo(userInput) if err != nil { panic(err }
result, err = operationBar(result) if err != nil { panic(err }
You can create a Process and handle errors only once:
result, err := agency.NewProcess(operationFoo, operationBar).Execute(userInput) // ...
Imagine having 3+ operations, like 5 or 10. That's gonna be some real difference.
All the chained methods like `SetPrompt(...)` returns `agency.Operation` and no error needs to be handled there
Why do you think that "method chaining is not really idiomatic" or how this should be implemented?