-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce chatModels
#43
Comments
I would like to highlight my biggest problem. We have the ChatMessage as follows: type ChatMessage interface {
GetText() string
GetType() ChatMessageType // <- role
} The openAI API needs separated role and message fields though: https://platform.openai.com/docs/api-reference/chat/create. They are required. The LLM contract allows passing strings only though. // LLM is a langchaingo Large Language Model.
type LLM interface {
Call(prompt string, stopWords []string) (string, error)
Generate(prompts []string, stopWords []string) ([]*Generation, error)
} The reference implementation seems to handle it by not using string-only messages: chat([HumanMessage(content="Translate this sentence from English to French. I love programming.")]) Maybe we could generalize the LLM input to be a BaseMessage as well, and then strongly type it for all implementations? (Normal LLMs just get a text as input, chat role and text etc.) What are everyone's thoughts? (@tmc?) |
Hmm. I think we need to think through if “type” is sufficiently distinct from “role”. We have the role field on the GenericChatMessage struct. |
What's the type based upon? |
That's just a copy of the concept from https://github.com/hwchase17/langchain/blob/master/langchain/schema.py#L88 See "role" here: https://github.com/hwchase17/langchain/blob/master/langchain/schema.py#L106 (and used here: https://github.com/hwchase17/langchain/blob/master/langchain/schema.py#L33) @ChristianSch sorry I missed your follow-up comment here. Please feel free to join us in the langchain chat in the #langchain-go channel. |
Ahhh ok. So we'd need to have a look. It's not very self-explanatory haha. No worries. Which platform @tmc? Discord, Gitter, Matrix? |
Sorry I should have indicated, we're in the langchain discord. (we should put this in the README..). |
I already started with openai but have the need to discuss how we want to map langchain to langchaingo in a few instances. I'll make a PR soon.
The text was updated successfully, but these errors were encountered: