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

feat: add builtin vf-memory variable (CT-000) #698

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

z4o4z
Copy link
Member

@z4o4z z4o4z commented Feb 21, 2024

Fixes or implements VF-XXX

Brief description. What is this change?

Implementation details. How do you make this change?

Setup information

Deployment Notes

Related PRs

Checklist

  • Breaking changes have been communicated, including:
    • New required environment variables
    • Renaming of interfaces (API routes, request/response interface, etc)
  • New environment variables have been deployed
  • Appropriate tests have been written
    • Bug fixes are accompanied by an updated or new test
    • New features are accompanied by a new test

}

static stringifyTranscript(messages: BaseUtils.ai.Message[]) {
return messages.map(({ role, content }) => `${role}: ${content.replaceAll('\n', ' ')}`).join('\n');
Copy link
Member Author

Choose a reason for hiding this comment

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

replacing new lines with spaces to make the format easier to understand for AI

Suggested change
return messages.map(({ role, content }) => `${role}: ${content.replaceAll('\n', ' ')}`).join('\n');
return messages.map(({ role, content }) => `${role}: ${content.replaceAll('\n', ' ')}`).join('\n');

Copy link
Member

Choose a reason for hiding this comment

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

the newline is actually okay, Denys did some testing

Comment on lines +27 to +29
if (isPathRequest(request)) {
return request.payload.label ?? null;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

use button's label as user message

Copy link

sonarcloud bot commented Feb 21, 2024

@z4o4z
Copy link
Member Author

z4o4z commented Feb 21, 2024

bors r+

bors-vf bot pushed a commit that referenced this pull request Feb 21, 2024
<!-- You can erase any parts of this template not applicable to your Pull Request. -->

**Fixes or implements VF-XXX**

### Brief description. What is this change?

<!-- Build up some context for your teammates on the changes made here and potential tradeoffs made and/or highlight any topics for discussion -->
@bors-vf
Copy link

bors-vf bot commented Feb 21, 2024

Build failed:

@z4o4z
Copy link
Member Author

z4o4z commented Feb 21, 2024

bors r+

bors-vf bot pushed a commit that referenced this pull request Feb 21, 2024
<!-- You can erase any parts of this template not applicable to your Pull Request. -->

**Fixes or implements VF-XXX**

### Brief description. What is this change?

<!-- Build up some context for your teammates on the changes made here and potential tradeoffs made and/or highlight any topics for discussion -->
@DecathectZero DecathectZero merged commit 880a411 into master Feb 21, 2024
7 of 8 checks passed
@DecathectZero DecathectZero deleted the evgeny/vf-memory/CT-000 branch February 21, 2024 15:06
@vf-service-account
Copy link
Collaborator

🎉 This PR is included in version 1.212.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bors-vf
Copy link

bors-vf bot commented Feb 21, 2024

Build failed:

bors-vf bot pushed a commit that referenced this pull request Feb 22, 2024
Caused by: #698

The `isPathRequest` guard did not assert a payload label existed, so when using that in the ai memory variable the types indicate that payload will be there.

![image](https://github.com/voiceflow/general-runtime/assets/15315657/b2e59242-c146-4c11-a4d9-148438cadaa4)

So accessing `payload.label` resulted in a "Cannot read payload from undefined" error.

This change adds a `payload.label` check to guard itself, as the typing for `payload` is wrong, and could be null or undefined.

![image](https://github.com/voiceflow/general-runtime/assets/15315657/eac325bf-1b69-4e6b-b7c0-296987f61e47)

See: #690



Co-authored-by: Tyler Stewart <git@tylerstewart.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants