wejick / gchain

Composable LLM Application framework inspired by langchain
Apache License 2.0
12 stars 2 forks source link

How to handle options #4

Open wejick opened 1 year ago

wejick commented 1 year ago

On LangChain there is the kwargs where it's passed from front to back, with the nature of Python's dynamic typing this kwargs can be reused by many layers from agent, to chain until model. However, to have an idiomatic Go developer experience, that model is not ideal. If we talk about the perfect way, it should use a functional option pattern.

Need more research on how this model will looks like.

wejick commented 11 months ago

Chain right now is the top abstraction we have in gchain, while behind it there are retrieval and model which has different option. Yet we use modeloption to specify chain option.

Later we may have agent, so we may also need to have agent option. this unnecessary nested is bothering me, how to do this properly.

https://github.com/wejick/gchain/pull/11#issue-1807088330