Skip to content

Commit

Permalink
Make entityKind private
Browse files Browse the repository at this point in the history
  • Loading branch information
robatwilliams committed Dec 15, 2023
1 parent bb07af6 commit 0e28bca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/functions/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ CustomFunctions.associate('CHAT_COMPLETE', async (messages, params) => {
type: Excel.CellValueType.entity,
text: json.choices[0].message.content,
properties: {
entityKind: COMPLETION_ENTITY_KIND,
// These are accessible using formulas. Prefix any that are only for
// this addin's use, or only for display use, with _.

_entityKind: COMPLETION_ENTITY_KIND,

// For visibility of newlines without needing to use cell text wrap.
_lines:
Expand Down Expand Up @@ -161,7 +164,7 @@ function validateIsCompletion(anyTypedParameter) {
if (
!(
anyTypedParameter.type === Excel.CellValueType.entity &&
anyTypedParameter.properties.entityKind.basicValue ===
anyTypedParameter.properties._entityKind.basicValue ===
COMPLETION_ENTITY_KIND
)
) {
Expand Down
4 changes: 2 additions & 2 deletions testFramework/completionEntityStub.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export function makeCompletionEntity({ content }) {
basicValue: '#VALUE!',
text: undefined, // Not for programmatic use
properties: {
_lines: undefined, // Not for programmatic use
entityKind: {
_entityKind: {
type: 'String',
basicType: 'String',
basicValue: 'openai-excel-formulas:chat-completion',
},
_lines: undefined, // Not for programmatic use
requestBody: {
type: 'Entity',
basicType: 'Error',
Expand Down

0 comments on commit 0e28bca

Please sign in to comment.