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

refactor: implement AI Client #36

Merged
merged 31 commits into from
Nov 8, 2024
Merged

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Nov 5, 2024

This implements the guts of the AI client, including fetching Model configuration, interpolation, and tests.

@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-875-ai-config-tracker branch from d7e4c8f to c00ae79 Compare November 5, 2024 21:47
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-875-ai-config-tracker branch from c00ae79 to 42a6b05 Compare November 6, 2024 03:14
Base automatically changed from cw/sdk-866-ai-server-package to main November 6, 2024 03:15
@cwaldren-ld cwaldren-ld changed the title draft: implement ai config tracker refactor: implement ai config tracker Nov 6, 2024
@cwaldren-ld cwaldren-ld changed the title refactor: implement ai config tracker refactor: implement AI Client Nov 7, 2024
@@ -0,0 +1,89 @@
using System.Collections.Generic;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is some duplication here. This file is meant to contain classes that can be directly JSON deserialized, but this doesn't lend itself to the user-facing types. For instance, these fields have get; set; and I don't want that to be accessible to users. So, I deserialize these and then convert them into LdAiConfig.

I can't make these internal (deserialization seems to fail) and I can't use init; (we still support .net 4.6.2.)

I may be missing a more idiomatic way.

Copy link
Member

Choose a reason for hiding this comment

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

You should be able to tell it to use a parameterized constructor JsonContructor which allows creating immutable types, but you would have to have a full parameterized constructor for the records (because no init).

@cwaldren-ld cwaldren-ld marked this pull request as ready for review November 7, 2024 19:02
@cwaldren-ld cwaldren-ld requested a review from a team as a code owner November 7, 2024 19:02
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-875-ai-config-tracker branch from cf0d7de to 6ec3f94 Compare November 8, 2024 00:23
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-875-ai-config-tracker branch from 8d961ca to 5c141ab Compare November 8, 2024 01:42
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-875-ai-config-tracker branch from 5c141ab to c513a2f Compare November 8, 2024 01:45
@cwaldren-ld
Copy link
Contributor Author

cwaldren-ld commented Nov 8, 2024

Updated to pass defaultValue.ToLdValue() directly into the underlying SDK. This recursively converts the existing LdAiConfig into an LdValue.

Note: if there are cycles in the Model dict, then bad things would happen (re: Ryan's comment.)

@cwaldren-ld cwaldren-ld merged commit acfa1a5 into main Nov 8, 2024
10 of 11 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/sdk-875-ai-config-tracker branch November 8, 2024 23:27
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.

3 participants