Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Strings#862

Closed
Keyrxng wants to merge 7 commits into
ubiquity:developmentfrom
Keyrxng:strings
Closed

Strings#862
Keyrxng wants to merge 7 commits into
ubiquity:developmentfrom
Keyrxng:strings

Conversation

@Keyrxng

@Keyrxng Keyrxng commented Oct 15, 2023

Copy link
Copy Markdown
Contributor

Resolves #837

Quality Assurance: test case written

Just came to me while sorting types for another piece of work

@netlify

netlify Bot commented Oct 15, 2023

Copy link
Copy Markdown

Deploy Preview for ubiquibot-staging ready!

Name Link
🔨 Latest commit 0a83bf7
🔍 Latest deploy log https://app.netlify.com/sites/ubiquibot-staging/deploys/65426105a9b711000814be38
😎 Deploy Preview https://deploy-preview-862--ubiquibot-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Keyrxng

Keyrxng commented Oct 15, 2023

Copy link
Copy Markdown
Contributor Author

idk why I've got 3 week old commits in this, my dev branch is up to date with upstream and only made this branch this afternoon, fixed now won't happen again.

seems that CI is failing because of '.test.ts' but is needed for jest, I can remove the test or I'm open to ideas

rename test file
@Keyrxng Keyrxng marked this pull request as ready for review October 15, 2023 13:14
@Keyrxng Keyrxng requested a review from cuddle-dev as a code owner October 15, 2023 13:14
@0x4007

0x4007 commented Oct 17, 2023

Copy link
Copy Markdown
Member

This is interesting but I've never heard of f strings. Perhaps you can share some of your favorite resources on it and explain why you were inspired to take this approach?

It does look awfully pythonic which I have mixed feelings on. Perhaps there is a TypeScript-esqe parallel that we can draw inspiration from?

@Keyrxng

Keyrxng commented Oct 17, 2023

Copy link
Copy Markdown
Contributor Author

The inspiration comes from using it with gpt prompts when building with langchain, it's readable and robust. The changes from Lang to this was just streamlining what we needed and optimizing things a little.

I don't think there is a TS parallel to draw from no at least not to my knowledge, it's a 'formatted string literal' similar to JS/TS \`${}`\ but from what I read we cannot use that approach and need to use something similar to Python's % string formatting.

I tried to find what you meant when you said this but I couldn't so I don't understand the issue with just using ${} so I figured this was a more elegant way to do things and it can be repurposed as across the bot as opposed to just the E2E tests

I presume the issue with using ${} is due to html formatting, if this is the reason then .replace() is the only built-in option and then we'd just replace HTML entities? I don't like the sound of it personally but if it's the preference then this could be refactored but I think this is superior

@Keyrxng Keyrxng mentioned this pull request Oct 21, 2023
@Keyrxng

Keyrxng commented Nov 1, 2023

Copy link
Copy Markdown
Contributor Author

It just came to me that there is ofc a way to handle this with just TS and this is probably the sleekest also no longer caring about trying to escape although if using it for prompt template formatting then we should just use different delimiters <> as opposed to {} when prompting AI

@Keyrxng Keyrxng closed this by deleting the head repository Apr 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests: Share Strings

2 participants