Skip to content

Commit

Permalink
Update docs to include file upload python example (tensorlakeai#283)
Browse files Browse the repository at this point in the history
* update filter name on docs

* update docs
  • Loading branch information
lucasjacks0n authored Jan 31, 2024
1 parent a577c61 commit 93a8212
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions docs/docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@ Data Repositories are logical buckets that store content. Indexify starts with a
])
```

#### You could upload files to Indexify also
#### You can also upload files to Indexify
=== "curl"
```
curl -v http://localhost:8900/repositories/default/upload_file \
-F "files=@kd.txt"
```

=== "python"
```python
repo = client.get_repository("default")
repo.upload_file("kd.txt")
```
#### Look at the metadata of the content which has been ingested
Sometimes you might want to read all the metadata of the content for use in another application or debugging.
=== "curl"
Expand Down Expand Up @@ -331,7 +335,7 @@ Sometimes you might want to restrict the content from a data repository that's e
-d '{"documents": [
{"text": "The Cayuga was launched in 2245.",
"metadata":
{"url": "https://memory-alpha.fandom.com/wiki/USS_Cayuga"}
{"source": "https://memory-alpha.fandom.com/wiki/USS_Cayuga"}
}
]}'
```
Expand All @@ -341,7 +345,7 @@ Sometimes you might want to restrict the content from a data repository that's e
repo.add_documents([
{"text": "The Cayuga was launched in 2245.",
"metadata":
{"url": "https://memory-alpha.fandom.com/wiki/USS_Cayuga"}
{"source": "https://memory-alpha.fandom.com/wiki/USS_Cayuga"}
}
])
```
Expand Down
1 change: 0 additions & 1 deletion sdk-py/indexify/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def upload_file(self, path: str):
files={"file": f},
)
response.raise_for_status()
return response.json()

@classmethod
def get(cls, name: str, service_url: str = DEFAULT_SERVICE_URL) -> "Repository":
Expand Down

0 comments on commit 93a8212

Please sign in to comment.