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.
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
💅 Update
text2vec-azure-openai
to utilizeisAzure: true
flag and markresourceName
+deploymentId
as optional #196base: main
Are you sure you want to change the base?
💅 Update
text2vec-azure-openai
to utilizeisAzure: true
flag and markresourceName
+deploymentId
as optional #196Changes from 2 commits
9184e62
9f072ca
ec23daa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is always
true
, does it still need the?
operator? If not, can we remove it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the
true
is always set by the text2VecAzureOpenAI function internally, should not be necessary to be passed by the user - but due to how the types in general are structured I could not easily 1) remove it completely from the config object, nor 2) remove the optional operator, since then the user would be required to supplyisAzure: true
manually 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, okay I see now. I think this makes sense if the user makes use of the
.azureOpenAI
method but part of the API is still to allow users to work with the raw types if they so wish. As such, if a user did:then the type system would allow it since
isAzure
is optional yet the runtime would interpret this asisAzure: undefined
, which is a false-y value.I like the idea of introducing the
isAzure
flag to the TS client but I think it may be better placed as a pure internal, e.g. not exposed in the user types, wdyt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to not expose it - but I could not figure out how to make it work so that it is not marked as unexpected internally where i place it 😬
This part here is what I mean:
I wouldn't know how to tell TS here that this is an expected prop without adding a
// @ts-expect-error
🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking is that
isAzure
should be removed from the...Config
types and instead interpreted by the client's runtime itself depending on the name of the module. So this would most likely require the addition ofgenerative-azure-openai
, alongsidetext2vec-azure-openai
, that is then parsed appropriately in the collection creation logicThere we'd have some boolean clauses to determine whether the module is an azure one, based on the name, and then inject
isAzure: true
into the config appropriately. IMO, this would be the most consistent for the client/server relationship as I'm sure there will be future refactoring of the server that changes this behaviour. Then, we'd only break the internal relationship rather than the public APIWe already do something similar here, wdyt about extending this logic as described above?
If you'd rather not then that's fine, I can add it to my backlog 😁 Also, sorry for the spaghetti of the
collection.create
method, I've not had the chance to refactor it into a better structure 😅There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - this definitely makes more sense 👍 I didn't look into this part.
I'm drowning a bit in other work right now, but I should be able to look into this in more detail hopefully next week or so 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I get round to it this week, I'll ping you on here to let you know. Thanks for your help so far!