-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add datastore v1beta3 snippets #16
Conversation
Snippets are handled using different regions. So for the
One thing to note about the snippet is that is removes the appropriate whitespace, so don't have to worry about the snippets being at a top level. In general, if an operation is not possible either provide a comment with a workaround or a comment that says it's not possible. For example some of our clients don't expose the insert command, so instead we show a transaction that does a get, verifies that it fails, then performs a put. |
// [END Consistency:entity_with_parent] | ||
|
||
// [START Entities:properties] | ||
var taskData = { |
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.
Maybe just call these task.
f4cc5f0
to
2879377
Compare
Thanks for the review! I pushed some updates, let me know if I'm headed in the right direction. (updated first post with todos - feel free to add on) |
@@ -11,6 +11,7 @@ | |||
"license": "Apache 2", | |||
"private": true, | |||
"dependencies": { | |||
"gcloud": "stephenplusplus/gcloud-node#spp--datastore-v1beta3", |
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.
(temporary until release: googleapis/google-cloud-node#897)
2879377
to
3b62380
Compare
type: 'Personal', | ||
done: false, | ||
priority: 4, | ||
percent_complete: 10.0, |
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 think it's be ok here to do things in a language idomatic way and call this percentComplete.
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.
+1, other node.js + datastore samples use camelCase.
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.
👍
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.
Oh, this will change the indexes though, which are currently:
indexes:
- kind: Task
properties:
- name: done
- name: priority
direction: desc
- kind: Task
properties:
- name: priority
- name: percent_complete
- kind: Task
properties:
- name: type
- name: priority
- kind: Task
properties:
- name: priority
- name: created
- kind: Task
properties:
- name: done
- name: created
- kind: Task
properties:
- name: type
- name: priority
direction: desc
- kind: Task
properties:
- name: type
- name: created
I was planning to include that file in this repo, but wherever it goes the percent_complete
will have to be changed to match if we camelcase it.
So far the entity stuff LGTM |
3b62380
to
9d152ef
Compare
The query files are up, please let me know if things look good. |
67bc340
to
fe4f73a
Compare
} | ||
}; | ||
|
||
datastore.insert(task, function(err) { |
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.
No need to insert on this snippet.
@pcostell thanks! I've made the requested changes in the last few commits. |
a86f9df
to
5ba5d81
Compare
All the sections are covered now. |
propertiesByKind[kind].push(propertyName); | ||
}); | ||
|
||
// propertiesByKind = { |
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.
We should build (and the other comments) in a language-agnostic way into the docs around the snippets, so no need to include them here.
* chore: lock files maintenance * chore: lock files maintenance
🤖 I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/nodejs-ai-platform/compare/v1.2.0...v1.3.0) (2021-01-14) ### Features * **samples:** adds samples for enhanced version of library ([#16](https://www.github.com/googleapis/nodejs-ai-platform/issues/16)) ([aef443c](https://www.github.com/googleapis/nodejs-ai-platform/commit/aef443c41b8a9a2199e0c5b100a5ab91444b0dfe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ## [1.3.0](https://www.github.com/googleapis/nodejs-ai-platform/compare/v1.2.0...v1.3.0) (2021-01-14) ### Features * **samples:** adds samples for enhanced version of library ([#16](https://www.github.com/googleapis/nodejs-ai-platform/issues/16)) ([aef443c](https://www.github.com/googleapis/nodejs-ai-platform/commit/aef443c41b8a9a2199e0c5b100a5ab91444b0dfe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.1.1](googleapis/nodejs-video-stitcher@v0.1.0...v0.1.1) (2022-06-23) ### Bug Fixes * **deps:** update dependency google-gax to v3 ([#15](googleapis/nodejs-video-stitcher#15)) ([345085f](googleapis/nodejs-video-stitcher@345085f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [0.1.1](googleapis/nodejs-video-stitcher@v0.1.0...v0.1.1) (2022-06-23) ### Bug Fixes * **deps:** update dependency google-gax to v3 ([#15](googleapis/nodejs-video-stitcher#15)) ([345085f](googleapis/nodejs-video-stitcher@345085f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
# This is the 1st commit message: refactor: updating codeowners # This is the commit message #2: add chat functions # This is the commit message #3: use correct testing project # This is the commit message #4: refactor: adding system tests + updating corresponding chat samples # This is the commit message #5: add countTokens sample # This is the commit message #6: refactor: adding in region tags, abstracting out mimetype, adding new image ur # This is the commit message #7: refactor: updating gs url in test, fix to args getting passed to sample functions # This is the commit message #8: refactor: resolving file paths in tests, adding wait helper function # This is the commit message #9: add warning about safety concerns # This is the commit message #10: refactor:filling out nonstreamingchat and streamcontent tests # This is the commit message #11: add countTokens test # This is the commit message #12: refactor: filling out more streaming tests # This is the commit message #13: add safety settings test # This is the commit message #14: refactor: adding in stream content and multipart content tests # This is the commit message #15: feat: add new sendMultiModalPromptWithImage sample # This is the commit message #16: refactor: adding region tags
* feat: initial base for generative-ai * # This is a combination of 16 commits. # This is the 1st commit message: refactor: updating codeowners # This is the commit message #2: add chat functions # This is the commit message #3: use correct testing project # This is the commit message #4: refactor: adding system tests + updating corresponding chat samples # This is the commit message #5: add countTokens sample # This is the commit message #6: refactor: adding in region tags, abstracting out mimetype, adding new image ur # This is the commit message #7: refactor: updating gs url in test, fix to args getting passed to sample functions # This is the commit message #8: refactor: resolving file paths in tests, adding wait helper function # This is the commit message #9: add warning about safety concerns # This is the commit message #10: refactor:filling out nonstreamingchat and streamcontent tests # This is the commit message #11: add countTokens test # This is the commit message #12: refactor: filling out more streaming tests # This is the commit message #13: add safety settings test # This is the commit message #14: refactor: adding in stream content and multipart content tests # This is the commit message #15: feat: add new sendMultiModalPromptWithImage sample # This is the commit message #16: refactor: adding region tags * refactor: updating codeowners add chat functions use correct testing project refactor: adding system tests + updating corresponding chat samples add countTokens sample refactor: adding in region tags, abstracting out mimetype, adding new image ur refactor: updating gs url in test, fix to args getting passed to sample functions refactor: resolving file paths in tests, adding wait helper function add warning about safety concerns refactor:filling out nonstreamingchat and streamcontent tests add countTokens test refactor: filling out more streaming tests add safety settings test refactor: adding in stream content and multipart content tests feat: add new sendMultiModalPromptWithImage sample refactor: adding region tags update to common prompt fix: resolve linting * refactor: remove index file --------- Co-authored-by: [email protected] <[email protected]>
// @pcostell
To Dos
This is some snippet code in preparation of the datastore v1beta3 release. It's a work in progress, so I wanted to get reviews and guidance on the structure to follow as early as possible.
Some questions:
taskKey
(convention) vstask_key
(snippet spreadsheet) - the linter caught this as an error, and I wasn't sure if either is a hard requirement.Any insight into how the docs are generated from this file, requirements or tips for conventions to follow would be helpful to make sure I get this right. Thanks!