Skip to content

Commit

Permalink
Don't try and keep _lines and text value private
Browse files Browse the repository at this point in the history
  • Loading branch information
robatwilliams committed Dec 21, 2023
1 parent 596841f commit 356b5e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Completions populate the cell with a custom data type which includes the complet

To obtain the text value for use in formulas, use the `VALUETOTEXT()` function. To obtain other request/response data, use dot notation to the property path (e.g. `A123.response.model`).

To view the completion data, open the entity card. The `_lines` property provides a line-by-line view of the completion content.
To view the completion data, open the entity card. The `lines` property provides a line-by-line view of the completion content.

To extract a final answer that follows a chain of thought, you could use a formula such as:

Expand Down
2 changes: 1 addition & 1 deletion src/functions/functions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function chatComplete(messages, params, invocation) {
_entityKind: COMPLETION_ENTITY_KIND,

// For visibility of newlines without needing to use cell text wrap.
_lines:
lines:
json.choices.length === 1
? json.choices[0].message.content.split('\n')
: json.choices.map((choice) => choice.message.content.split('\n')),
Expand Down
4 changes: 2 additions & 2 deletions testFramework/completionEntityStub.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ export function makeCompletionEntity({
type: 'Entity',
basicType: 'Error',
basicValue: '#VALUE!',
text: undefined, // Not for programmatic use
text: content ?? '',
properties: {
_entityKind: {
type: 'String',
basicType: 'String',
basicValue: 'openai-excel-functions:chat-completion',
},
_lines: undefined, // Not for programmatic use
lines: (content ?? '').split('\n'),
requestBody: {
type: 'Entity',
basicType: 'Error',
Expand Down

0 comments on commit 356b5e5

Please sign in to comment.