Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9fea5d2
Release 0.8.9
fern-api[bot] Oct 29, 2024
5d71003
update eval_utils with runs api change
harry-humanloop Oct 29, 2024
9e50a5b
Eval runs (#26)
harry-humanloop Nov 3, 2024
0e3e0b4
Release 0.8.9a1
fern-api[bot] Nov 3, 2024
4debaa0
SDK Decorators V1
Oct 25, 2024
4cc0e3e
Added threading to exporter
Oct 26, 2024
bf51f01
Bumped python version in GitHub action
Oct 26, 2024
4850ad2
Mypy complaints
Oct 26, 2024
22445e9
Switch to 3.9 typing annotations
Oct 26, 2024
53db2ee
3.9 typing complaint
Oct 26, 2024
555797d
debugging
Oct 26, 2024
c55b2d4
Added openai secret for testing
Oct 26, 2024
8816382
Fixed mypy type hints
Oct 28, 2024
02fcab7
More unit tests for prompt decorators
Oct 28, 2024
366a2c6
More decorator tests
Oct 30, 2024
7449b5c
Revisited docstrings
Oct 30, 2024
96e91c6
QA with live example
Oct 30, 2024
791f615
Fix for flaky replicate test
Oct 30, 2024
a4db565
Reverted changes to a file modified by Fern
Oct 30, 2024
618bcf5
Code is self-aware and modified the docstring to account for daylight…
Oct 30, 2024
163193a
Replicate integration tests still flaky
Oct 30, 2024
baee7cd
false positive from mypy
Oct 30, 2024
abf09e6
Expanded some docstrings
Oct 31, 2024
f309e36
Better typing when processing prompt kernel
Oct 31, 2024
473e8cd
Added attributes on prompt + jsonify log output if not string
Oct 31, 2024
789706e
added retries on log attempts
Oct 31, 2024
e2eda00
Reverted unnecessary diff
Oct 31, 2024
a95473d
Fixed imports in humanloop client module
Oct 31, 2024
20a70af
Remove pyproject.toml ruff section
Oct 31, 2024
e1a3389
Removed global tracer; now owned by client
Oct 31, 2024
fa2b30f
Changed dependency logic for instrumentors
Oct 31, 2024
ad3d3a8
Integrated OTel decorators with local eval utility
Nov 4, 2024
71f13dc
Made Otel span I/O more robust
Nov 5, 2024
f5f90a4
Fixed mypy error
Nov 5, 2024
02f45a6
Fixed warning from OTel
Nov 5, 2024
0a7507a
Added error handling at function and exporter levels
Nov 5, 2024
8886880
mypy nit
Nov 5, 2024
51b518f
Early exit for logs whose parent in trace failed
Nov 5, 2024
3b31411
Added more docstrings
Nov 5, 2024
86ef9a4
Refactored evaluation context
Nov 7, 2024
5104392
Rebase fixes
Nov 7, 2024
7052cf8
Added missing logic from #28 and #29
Nov 7, 2024
6e79d83
PR feedback
Nov 7, 2024
15a0596
Support chat template + parsing log inputs from function call args
Nov 7, 2024
84fe73c
QA bugfixing
Nov 7, 2024
a3e4783
PR feedback from Harry
Nov 11, 2024
1be4150
PR #30
Nov 11, 2024
e2e3254
evals_run modification works with simple callable and instrumented ca…
Nov 11, 2024
0a499ad
Harry PR feedback
Nov 11, 2024
b2bf174
changed relative import
Nov 11, 2024
25db659
import
Nov 11, 2024
ab050af
deepcopy
Nov 11, 2024
ba5ba1c
deepcopy
Nov 11, 2024
9365010
Debug session Harry
Nov 11, 2024
44285ef
mypy error fixes
Nov 11, 2024
95a0901
Custom error message for fancy functions decorated with tool
Nov 11, 2024
4640d7b
Use KernelParams for decorators
Nov 11, 2024
4704ce2
unpack poetry mypy
Nov 11, 2024
2803248
poetry pipeline check
Nov 11, 2024
2ad919b
mypy debacle
Nov 11, 2024
cdbe070
mypy unpack ignore statements
Nov 11, 2024
4d854ed
Rebase changes
Nov 12, 2024
649718b
jsonify output of decorators if necessary
Nov 12, 2024
558df34
Relax dependency requirements
Nov 12, 2024
03261c4
Poetry dependency relaxation follow-up
Nov 12, 2024
52c6c7b
Parse '|' annotations in tool decorator
Nov 12, 2024
7b2e250
Support for ellipsis parsing
Nov 12, 2024
b9668d2
Added support for ellipsis in type parsing
Nov 12, 2024
86c20ba
switch to copycontext
Nov 12, 2024
9274910
removed redundant code
Nov 12, 2024
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
7 changes: 6 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Specify files that shouldn't be modified by Fern

src/humanloop/eval_utils.py
src/humanloop/eval_utils/*
src/humanloop/prompt_utils.py
src/humanloop/client.py
mypy.ini
README.md

# Directories used by SDK decorators

src/humanloop/decorators/*
src/humanloop/otel/*
38 changes: 35 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.12
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
Expand All @@ -35,6 +35,38 @@ jobs:

- name: Test
run: poetry run pytest -rP .
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
REPLICATE_API_KEY: ${{ secrets.REPLICATE_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
test_3_12:
# Run the test suite with Python 3.12 too
# Some tool decorator tests assert the ability to parse the signature
# of functions that use typing features introduced in Python 3.10 e.g. '|'
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Install dependencies
run: poetry install

- name: Test
run: poetry run pytest -rP .
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
REPLICATE_API_KEY: ${{ secrets.REPLICATE_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}

publish:
needs: [compile, test]
Expand All @@ -46,7 +78,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ dist/
__pycache__/
poetry.toml
.ruff_cache/
.idea
.vscode
.DS_Store
.env
1,532 changes: 1,487 additions & 45 deletions poetry.lock

Large diffs are not rendered by default.

30 changes: 24 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ classifiers = [
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -27,24 +26,43 @@ packages = [
{ include = "humanloop", from = "src"}
]


[project.urls]
Repository = 'https://github.com/humanloop/humanloop-python'

[tool.poetry.dependencies]
python = "^3.8"
python = ">=3.9,<4"
httpx = ">=0.21.2"
httpx-sse = "0.4.0"
pydantic = ">= 1.9.2"
pydantic-core = "^2.18.2"
typing_extensions = ">= 4.0.0"
typing_extensions = ">=4.0.0"
parse = ">=1"
opentelemetry-sdk = "<=1.27.0"
opentelemetry-api = "<=1.27.0"
opentelemetry-instrumentation-openai = ">=0.20"
opentelemetry-instrumentation-cohere = ">=0.20"
opentelemetry-instrumentation-anthropic = ">=0.20"
opentelemetry-instrumentation-replicate = ">=0.20"
opentelemetry-instrumentation-groq = ">=0.29"
opentelemetry-instrumentation-bedrock = ">=0.15"

[tool.poetry.dev-dependencies]
mypy = "1.0.1"
[tool.poetry.group.dev.dependencies]
parse-type = ">=0.6.4"
anthropic = ">=0.37.1"
groq = ">=0.11.0"
cohere = ">=3.0"
replicate = ">=1.0.3"
jsonschema = "^4.23.0"
types-jsonschema = "^4.23.0.20240813"
mypy = "^1.0.1"
pytest = "^7.4.0"
pytest-asyncio = "^0.23.5"
python-dateutil = "^2.9.0"
python-dateutil = "^2.8.2"
types-python-dateutil = "^2.9.0.20240316"
ruff = "^0.5.6"
python-dotenv = "^1.0.1"
openai = "^1.52.2"

[tool.pytest.ini_options]
testpaths = [ "tests" ]
Expand Down
Loading
Loading