Skip to content

Commit

Permalink
Allow to set remote files field at creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrehault committed Jan 18, 2024
1 parent c882810 commit 157fbfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1.2.4 (unreleased)


- Nothing changed yet.
- Allow to set remote files field at creation


## 1.2.3 (2024-01-16)
Expand Down
2 changes: 2 additions & 0 deletions docs/03-kb.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ You can also set the contents of the resource, as fields:
- Text fields in `texts`
- Link fields in `links`
- Conversation fields in `conversations`
- File fields in `files` if they are provided as an URI (passing a binary file is not supported, you need to use the [`upload` command](./04-upload.md)).

Note: you cannot set File fields when creating a resource, you need to use the [`upload` command](./04-upload.md).

Expand All @@ -80,6 +81,7 @@ Examples:
nuclia kb resource create --slug=my-resource
nuclia kb resource create --origin='{"collaborators":["THE_AUTHOR"]}' --usermetadata='{"classifications": [{"labelset": "SOME_CATEGORY", "label": "SOME_VALUE"}]}'
nuclia kb resource create --texts='{"chapter-1": {"body": "here is a test", "format": "PLAIN"}'
nuclia kb resource create --files='{"chapter-1": {"file": {"uri": "https://somewhere.com/file.pdf", "filename": "file.pdf", "contenttype": "application/pdf"}}}'
```

IMPORTANT: when using the CLI on Windows, you need to escape the double quotes in the JSON strings, like:
Expand Down
1 change: 1 addition & 0 deletions nuclia/sdk/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"conversations",
"links",
"texts",
"files",
"usermetadata",
"fieldmetadata",
"title",
Expand Down

0 comments on commit 157fbfe

Please sign in to comment.