-
Notifications
You must be signed in to change notification settings - Fork 2
feat: [REL-10772] Implement Langchain provider for online evals #64
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
Open
edwinokonkwo
wants to merge
37
commits into
main
Choose a base branch
from
jb/temp-judge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
5f924ab
move dataclass into models
jsonbailey 951eda1
create new config types completion, agent, and judges
jsonbailey ae7516b
use inheritance for configs for consistency
jsonbailey 0d933d2
added deprecations for old types
jsonbailey 8271807
create the ai provider interface and factory
jsonbailey 6ee62b4
create a langchain implementation of the ai provider
jsonbailey 231ae2e
Add Judge and evaluation metric tracking
jsonbailey 445ab8c
Add Chat implementation
jsonbailey 5446222
Set a default for evaluation metircs
jsonbailey bc46608
add the logger
jsonbailey fd0aff4
adjust langchain import
jsonbailey c3c939f
fix structure response
jsonbailey 125bb66
judge respose should be async
jsonbailey b33ef0e
move import to top of file
edwinokonkwo 87b4bd6
Refactor chat module: move TrackedChat implementation to a new file a…
edwinokonkwo f3c792d
add tests for LangChainProvider
edwinokonkwo 43d2b54
Refactor AI configuration tests to use AICompletionConfigDefault and …
edwinokonkwo be1443e
Move to packages folder
edwinokonkwo 13849c0
Linting.
edwinokonkwo b94c9f7
Eiminate unused components.
edwinokonkwo 8135577
fix ci
edwinokonkwo 1e46065
pin to specified version.
edwinokonkwo 57d1d97
fix docs
edwinokonkwo 2b85ffe
fixes
edwinokonkwo 22bb664
push 0.0.0 to claim
edwinokonkwo 869b4eb
bump package
edwinokonkwo 8bd73c9
fix ci
edwinokonkwo caefa78
move provenance to root level
edwinokonkwo 7792cac
fixes
edwinokonkwo e5728a9
seperate langchain provider to its own file instead of init
edwinokonkwo 754cdab
logger should not be optional
edwinokonkwo 463145c
linting
edwinokonkwo e75ccd7
fixes
edwinokonkwo 47b3a23
remove inline import.
edwinokonkwo 30ec74d
remove uncessary logic
edwinokonkwo 163bcdf
fixes
edwinokonkwo f0dcbc4
fixes
edwinokonkwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,20 +2,26 @@ name: Publish Package | |
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
| description: 'Which package to publish' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - core | ||
| - langchain | ||
| - both | ||
| dry_run: | ||
| description: 'Is this a dry run? If so no package will be published.' | ||
| type: boolean | ||
| required: true | ||
|
|
||
| jobs: | ||
| build-publish: | ||
| publish-core: | ||
| if: ${{ inputs.package == 'core' || inputs.package == 'both' }} | ||
| runs-on: ubuntu-latest | ||
| # Needed to get tokens during publishing. | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| outputs: | ||
| package-hashes: ${{ steps.build.outputs.package-hashes}} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -34,20 +40,49 @@ jobs: | |
|
|
||
| - uses: ./.github/actions/build | ||
| id: build | ||
| with: | ||
| package-path: packages/core | ||
|
|
||
| - name: Publish package distributions to PyPI | ||
| - name: Publish core package to PyPI | ||
| if: ${{ inputs.dry_run == false }} | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| # https://github.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.13 | ||
| uses: pypa/gh-action-pypi-publish@3cc2c35166dfc1e5ea3bb0491ffdeedcaa50d7c | ||
| with: | ||
| password: ${{env.PYPI_AUTH_TOKEN}} | ||
| password: ${{ env.PYPI_AUTH_TOKEN }} | ||
| packages-dir: packages/core/dist/ | ||
|
|
||
| release-provenance: | ||
| needs: [ 'build-publish' ] | ||
| publish-langchain: | ||
| if: ${{ inputs.package == 'langchain' || inputs.package == 'both' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| id-token: write | ||
| contents: write | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
| with: | ||
| base64-subjects: "${{ needs.build-publish.outputs.package-hashes }}" | ||
| upload-assets: ${{ !inputs.dry_run }} | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.9 | ||
|
|
||
| - name: Install poetry | ||
| uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 | ||
|
|
||
| - uses: launchdarkly/gh-actions/actions/[email protected] | ||
| name: 'Get PyPI token' | ||
| with: | ||
| aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
| ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' | ||
|
|
||
| - uses: ./.github/actions/build | ||
| id: build | ||
| with: | ||
| package-path: packages/langchain | ||
|
|
||
| - name: Publish langchain package to PyPI | ||
| if: ${{ inputs.dry_run == false }} | ||
| # Pinned to v1.8.13 (2024-06-14) for security | ||
| # https://github.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.13 | ||
| uses: pypa/gh-action-pypi-publish@3cc2c35166dfc1e5ea3bb0491ffdeedcaa50d7c | ||
edwinokonkwo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| password: ${{ env.PYPI_AUTH_TOKEN }} | ||
| packages-dir: packages/langchain/dist/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,63 +5,91 @@ on: | |
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| release-package: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write # Needed if using OIDC to get release secrets. | ||
| contents: write # Contents and pull-requests are for release-please to make releases. | ||
| contents: write | ||
| pull-requests: write | ||
| outputs: | ||
| release-created: ${{ steps.release.outputs.release_created }} | ||
| upload-tag-name: ${{ steps.release.outputs.tag_name }} | ||
| package-hashes: ${{ steps.build.outputs.package-hashes}} | ||
| releases_created: ${{ steps.release.outputs.releases_created }} | ||
| core_release_created: ${{ steps.release.outputs['packages/core--release_created'] }} | ||
| langchain_release_created: ${{ steps.release.outputs['packages/langchain--release_created'] }} | ||
| steps: | ||
| - uses: googleapis/release-please-action@v4 | ||
| id: release | ||
| with: | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json | ||
|
|
||
| release-core: | ||
| needs: release-please | ||
| if: ${{ needs.release-please.outputs.core_release_created == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| with: | ||
| fetch-depth: 0 # If you only need the current version keep this. | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| with: | ||
| python-version: 3.9 | ||
|
|
||
| - name: Install poetry | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 | ||
|
|
||
| - uses: launchdarkly/gh-actions/actions/[email protected] | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| name: 'Get PyPI token' | ||
| with: | ||
| aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
| ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' | ||
|
|
||
| - uses: ./.github/actions/build | ||
| id: build | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| with: | ||
| package-path: packages/core | ||
|
|
||
| - uses: ./.github/actions/build-docs | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
|
|
||
| - name: Publish package distributions to PyPI | ||
| if: ${{ steps.release.outputs.releases_created == 'true' }} | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| - name: Publish core package to PyPI | ||
| # https://github.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.13 | ||
| uses: pypa/gh-action-pypi-publish@3cc2c35166dfc1e5ea3bb0491ffdeedcaa50d7c | ||
edwinokonkwo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| password: ${{env.PYPI_AUTH_TOKEN}} | ||
| password: ${{ env.PYPI_AUTH_TOKEN }} | ||
| packages-dir: packages/core/dist/ | ||
|
|
||
| release-provenance: | ||
| needs: [ 'release-package' ] | ||
| if: ${{ needs.release-package.outputs.release-created == 'true' }} | ||
| release-langchain: | ||
| needs: release-please | ||
| if: ${{ needs.release-please.outputs.langchain_release_created == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| id-token: write | ||
| contents: write | ||
| uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
| with: | ||
| base64-subjects: "${{ needs.release-package.outputs.package-hashes }}" | ||
| upload-assets: true | ||
| upload-tag-name: ${{ needs.release-package.outputs.upload-tag-name }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.9 | ||
|
|
||
| - name: Install poetry | ||
| uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 | ||
|
|
||
| - uses: launchdarkly/gh-actions/actions/[email protected] | ||
| name: 'Get PyPI token' | ||
| with: | ||
| aws_assume_role: ${{ vars.AWS_ROLE_ARN }} | ||
| ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' | ||
|
|
||
| - uses: ./.github/actions/build | ||
| id: build | ||
| with: | ||
| package-path: packages/langchain | ||
|
|
||
| - name: Publish langchain package to PyPI | ||
| # Pinned to v1.8.13 (2024-06-14) for security | ||
| # https://github.com/pypa/gh-action-pypi-publish/releases/tag/v1.8.13 | ||
| uses: pypa/gh-action-pypi-publish@3cc2c35166dfc1e5ea3bb0491ffdeedcaa50d7c | ||
edwinokonkwo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| password: ${{ env.PYPI_AUTH_TOKEN }} | ||
| packages-dir: packages/langchain/dist/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| { | ||
| ".": "0.10.1" | ||
| "packages/core": "0.10.1", | ||
| "packages/langchain": "0.1.0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.