Skip to content

Commit 74e040e

Browse files
authored
Merge pull request #7 from Zipstack/feat/includeMetadata
Added include_metadata feature and some fixes
2 parents 4f122c3 + 035a53b commit 74e040e

File tree

6 files changed

+388
-210
lines changed

6 files changed

+388
-210
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ repos:
5252
rev: 24.2.0
5353
hooks:
5454
- id: black
55-
args: [--config=pyproject.toml, -l 120]
55+
args: [--config=pyproject.toml, -l 88]
5656
language: system
5757
exclude: |
5858
(?x)^(
@@ -62,7 +62,7 @@ repos:
6262
rev: 7.0.0
6363
hooks:
6464
- id: flake8
65-
args: [--max-line-length=120]
65+
args: [--max-line-length=88]
6666
exclude: |
6767
(?x)^(
6868
.*migrations/.*\.py|

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ try:
3838
api_key=os.getenv("UNSTRACT_API_DEPLOYMENT_KEY"),
3939
api_timeout=10,
4040
logging_level="DEBUG",
41+
include_metadata=False # optional
4142
)
4243
# Replace files with pdfs
4344
response = adc.structure_file(
@@ -58,6 +59,12 @@ except APIDeploymentsClientException as e:
5859
print(e)
5960
```
6061

62+
## Parameter Details
63+
64+
`api_timeout`: Set a timeout for API requests, e.g., `api_timeout=10`.
65+
`logging_level`: Set logging verbosity (e.g., "`DEBUG`").
66+
`include_metadata`: If set to `True`, the response will include additional metadata (cost, tokens consumed and context) for each call made by the Prompt Studio exported tool.
67+
6168

6269
## Questions and Feedback
6370

0 commit comments

Comments
 (0)