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

chore: Add cache for deployment ID #96

Merged
merged 17 commits into from
Sep 2, 2024
Merged

chore: Add cache for deployment ID #96

merged 17 commits into from
Sep 2, 2024

Conversation

marikaner
Copy link
Contributor

@marikaner marikaner commented Aug 30, 2024

Context

AI/gen-ai-hub-sdk-js-backlog#78.

Introduce a cache for deployment IDs.
I did not offer a possibility for users to change the default validity time, let me know if you see reasons to introduce this.

For langchain integration we will probably need to cache model information as well. I am wondering whether we should cache the ID + model or just the whole deployment directly. @MatKuhr @deekshas8 @tomfrenken

Definition of Done

  • Code is tested (Unit, E2E)
  • Error handling created / updated & covered by the tests above
  • Documentation updated

@marikaner marikaner changed the title chore: add cache for deployment ID chore: Add cache for deployment ID Sep 2, 2024
Copy link
Member

@tomfrenken tomfrenken left a comment

Choose a reason for hiding this comment

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

Pipeline seems to have caught some minor stuff, other than that LGTM

@marikaner marikaner merged commit 88e94ca into main Sep 2, 2024
9 checks passed
@marikaner marikaner deleted the deployment-cache branch September 2, 2024 14:12
).toEqual('deployment-id1');
});

it('should ignore model versions without model name', () => {
Copy link
Member

Choose a reason for hiding this comment

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

any particular reason why? Ideally, this never happens, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I wanted to make sure that we don't accidentally allow it though. The way we build the cache key this should not be possible anyways.

Comment on lines +53 to +54
name: 'gpt-35-turbo',
version: 'latest'
Copy link
Member

Choose a reason for hiding this comment

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

I would expect the test to pass with the following change, but it fails:

Suggested change
name: 'gpt-35-turbo',
version: 'latest'
name: 'gpt-35-turbo'

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.

4 participants