Skip to content

Added include_metadata feature and some fixes #7

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

Merged
merged 3 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ repos:
rev: 24.2.0
hooks:
- id: black
args: [--config=pyproject.toml, -l 120]
args: [--config=pyproject.toml, -l 88]
language: system
exclude: |
(?x)^(
Expand All @@ -62,7 +62,7 @@ repos:
rev: 7.0.0
hooks:
- id: flake8
args: [--max-line-length=120]
args: [--max-line-length=88]
exclude: |
(?x)^(
.*migrations/.*\.py|
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ try:
api_key=os.getenv("UNSTRACT_API_DEPLOYMENT_KEY"),
api_timeout=10,
logging_level="DEBUG",
include_metadata=False # optional
)
# Replace files with pdfs
response = adc.structure_file(
Expand All @@ -58,6 +59,12 @@ except APIDeploymentsClientException as e:
print(e)
```

## Parameter Details

`api_timeout`: Set a timeout for API requests, e.g., `api_timeout=10`.
`logging_level`: Set logging verbosity (e.g., "`DEBUG`").
`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.


## Questions and Feedback

Expand Down
Loading