Comments (6)
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..).
from langchaingo.
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?)
from langchaingo.
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.
from langchaingo.
Hmm. I think we need to think through if “type” is sufficiently distinct from “role”. We have the role field on the GenericChatMessage struct.
from langchaingo.
What's the type based upon?
from langchaingo.
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?
from langchaingo.
Related Issues (20)
- 接收消息影响整个应用退出 HOT 3
- we should adapt previous openai protocol which do not have MultiContent
- [Bug] agents.WithMemory not work
- Error with NewConversationalRetrievalQA implementation related to memory buffer
- Support for custom http client for googleai/vertex llm
- Function calls are made in openai, and the function is called synchronously at the same time, and the result is assembled asynchronously. Not all assembly results were returned successfully. HOT 2
- Add the field "detail" in openai ImageURLContent struct
- Add support for Oracle Cloud Infrastructure (OCI) Generative AI Service
- Add support for Oracle Database as a vectorstore
- Can I customize the streamingfunc function?
- failed to decode stream payload: unexpected EOF HOT 1
- Retrievers/ MMR?
- Examples for Tools usage HOT 1
- Man/mix length Call options not working
- Mistral example error HTTP Error 422 HOT 2
- How to call LLM using custom API? HOT 4
- Support Tencent Cloud VectorDB
- Calculator failed to calculate 30 ** 0.23
- Have you considered adding support for the Qwen model? HOT 2
- The problem with FunctionDefinition struct
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from langchaingo.