Skip to content

Conversation

rajaiswal
Copy link
Contributor

@rajaiswal rajaiswal commented Mar 16, 2024

PR Checklist

  • Read the Contributing documentation.
  • Read the Code of conduct documentation.
  • Name your Pull Request title clearly, concisely, and prefixed with the name of the primarily affected package you changed according to Good commit messages (such as memory: add interfaces for X, Y or util: add whizzbang helpers).
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. Fixes #123).
  • Describes the source of new concepts.
  • References existing implementations as appropriate.
  • Contains test coverage for new functions.
  • Passes all golangci-lint checks.

This PR implements Cloudflare Workers AI LLM as documented here. Functionality is at parity with Langhain's Cloudflare Workers AI implementation.

@rajaiswal rajaiswal changed the title llm: Implement Cloudflare Workers AI LLM llms/cloudflare: Implement Cloudflare Workers AI LLM Mar 16, 2024
@tmc
Copy link
Owner

tmc commented Mar 18, 2024

@rajaiswal looking forward to this! can you get this over the line and mark it ready for review?

@rajaiswal
Copy link
Contributor Author

rajaiswal commented Mar 19, 2024

@tmc I just need to add tests. What's the general acceptable test pattern here? I see some llms are spinning up a mock server, and some are testing against the real API with test tokens. Not sure which one to follow

@tmc
Copy link
Owner

tmc commented Mar 19, 2024

The short answer is that we haven't solidified and recommended an approach yet. Would love contributions to help shape that, but in the short term do what you feel is expedient and appropriate.

@rajaiswal rajaiswal force-pushed the add-cloudflare-llm branch from fdc2da4 to 38decb3 Compare March 19, 2024 23:23
@rajaiswal rajaiswal marked this pull request as ready for review March 19, 2024 23:24
@rajaiswal
Copy link
Contributor Author

@tmc PR is ready for review. Some unrelated files got touched when I ran linting and gofumpt, would you like me to revert those files back to their original state and isolate the linting only to my changes?

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.

This is looking great! No worries with the unrelated format fixes. Just a few small comments here but generally this looks like it's nearly good to go in!

Can you ensure that all introduced exported symbols (except those in internal packages) are commented?

@rajaiswal
Copy link
Contributor Author

@tmc this should be good to merge now

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.

Thanks, LGTM

@tmc tmc merged commit 7fb9a13 into tmc:main Mar 24, 2024
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.

2 participants