Open wjx-xin opened 1 month ago
Could elaborate on what you want to do with custom calls and which LLM you want to use?
Could elaborate on what you want to do with custom calls and which LLM you want to use?
LLM company provides their own web API, and I want to call it through langchaingo. It seems to be mentioned in langchain (Python) that it can be implemented by inheriting LLM class. Is there a similar implementation in langchaingo?
@wjx-xin Yes, except instead of inheritance, you would implement this interface: https://github.com/tmc/langchaingo/blob/main/llms/llms.go#L15-L29
For example, the OpenAI client implementation of that interface: https://github.com/tmc/langchaingo/blob/main/llms/openai/openaillm.go#L47
@wjx-xin Yes, except instead of inheritance, you would implement this interface: https://github.com/tmc/langchaingo/blob/main/llms/llms.go#L15-L29
For example, the OpenAI client implementation of that interface: https://github.com/tmc/langchaingo/blob/main/llms/openai/openaillm.go#L47
Thank you. @erictse
Many llms do not provide calling methods implemented in libraries such as openapi, so how can I implement custom calls?