Skip to content
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

llms: Add mistral hosted inference llm implementation #717

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

aannirajpatel
Copy link
Contributor

@aannirajpatel aannirajpatel commented Mar 25, 2024

Adds an LLM implementation to leverage the Mistral Platform. Wraps mistral-go.

Requesting feedback on Function calling-related implementation.

Checklist
✅ I have read the Contributing documentation.
✅ I have read the Code of conduct documentation.
✅ I checked that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
✅ My PR provides a description that addresses what it is solving, with a focus on integrating Mistral LLMs into LangChain.
✅ My PR describes the source of new concepts introduced (no new concepts introduced).
✅ My PR references existing implementations as appropriate, primarily the mistral-go client library documentation.
🟡 PR should contain test coverage for new functions (to be added - question to maintainers: can these be added retrospectively?).
✅ Verified that my PR passes all golangci-lint checks.

resolves #486

@tmc tmc changed the title Add mistral llms: Add mistral hosted inference llm implementation Mar 25, 2024
@aannirajpatel aannirajpatel force-pushed the add-mistral branch 3 times, most recently from d9257d9 to 61c4fbb Compare March 25, 2024 06:23

type Option func(*clientOptions)

func WithAPIKey(apiKey string) Option {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please include comments on exported symbols

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typically in go these start with the string of the symbol, so in this case it would be appropriate to start with "// WithAPIKey passes the .."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix 👍

Copy link
Contributor Author

@aannirajpatel aannirajpatel Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's already merged (thanks!). I'll change these up as a follow-up PR on the coming weekend.

Copy link
Owner

@tmc tmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect timing with the Mistral hack in SF this weekend! With a few touches I think this is going to be good to go in!

@aannirajpatel
Copy link
Contributor Author

If only this were before the Mistral hack in SF this weekend! With a few touches I think this is going to be good to go in!

Ahh, missed it 😅 Just learned about that on social media. Cool hackathon!

if err != nil {
log.Fatal(err)
}
_ = completionWithStreaming
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

folks that know go well may understand why this line is here but a comment would be useful

* llms: added streaming to mistral
* examples: added mistral completion example
@tmc
Copy link
Owner

tmc commented Mar 25, 2024

Really impressed with the docs additon! Thanks so much, I'd like to normalize that for new contributors and would love any input you have to make that more accessible or straightforward.

I commented with a note about how we tend to start comments on exported functions/types in this codebase, I think that's the only snag that remains here!

@tmc tmc merged commit 8d90359 into tmc:main Mar 25, 2024
3 checks passed
@tmc
Copy link
Owner

tmc commented Mar 25, 2024

🙏 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

llms: Implement Mistral Platform
2 participants