Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fcbe761
chore(internal): remove mock server code
stainless-app[bot] Feb 20, 2026
f09c77f
chore: update mock server docs
stainless-app[bot] Feb 20, 2026
3d9a5d8
chore(internal): add request options to SSE classes
stainless-app[bot] Feb 24, 2026
b75db1c
chore(internal): make `test_proxy_environment_variables` more resilient
stainless-app[bot] Feb 24, 2026
e90baf7
chore(internal): make `test_proxy_environment_variables` more resilie…
stainless-app[bot] Feb 25, 2026
da041d5
chore(ci): bump uv version
stainless-app[bot] Feb 27, 2026
721abc8
chore(ci): skip uploading artifacts on stainless-internal branches
stainless-app[bot] Mar 8, 2026
9786776
fix(pydantic): do not pass `by_alias` unless set
stainless-app[bot] Mar 17, 2026
d28913f
fix(deps): bump minimum typing-extensions version
stainless-app[bot] Mar 17, 2026
ff8dcc9
chore(internal): tweak CI branches
stainless-app[bot] Mar 17, 2026
5a8377f
fix: sanitize endpoint path params
stainless-app[bot] Mar 20, 2026
c4581ec
chore(internal): update gitignore
stainless-app[bot] Mar 24, 2026
5c190ea
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 25, 2026
460be41
feat(internal): implement indices array format for query and form ser…
stainless-app[bot] Mar 27, 2026
9b7222d
fix(client): preserve hardcoded query params when merging with user p…
stainless-app[bot] Apr 8, 2026
5a6ad09
fix: ensure file data are only sent as 1 parameter
stainless-app[bot] Apr 11, 2026
b743f30
chore(internal): codegen related update
stainless-app[bot] Apr 18, 2026
4af43ee
chore(internal): codegen related update
stainless-app[bot] Apr 23, 2026
67e0217
chore(internal): codegen related update
stainless-app[bot] Apr 28, 2026
bf5d8f5
codegen metadata
stainless-app[bot] Apr 30, 2026
118d6b1
chore(internal): codegen related update
stainless-app[bot] May 1, 2026
d9ec7e6
release: 0.4.0
stainless-app[bot] May 1, 2026
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
32 changes: 19 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,14 +19,14 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/EverMemOS-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -33,7 +35,7 @@ jobs:
run: ./scripts/lint

build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
Expand All @@ -46,7 +48,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Install dependencies
run: uv sync --all-extras
Expand All @@ -55,14 +57,18 @@ jobs:
run: uv build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/EverMemOS-python'
if: |-
github.repository == 'stainless-sdks/EverMemOS-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/EverMemOS-python'
if: |-
github.repository == 'stainless-sdks/EverMemOS-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand All @@ -80,7 +86,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: '0.9.13'
version: '0.10.2'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
_dev

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.13"
".": "0.4.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/evermind%2FEverMemOS-a34fcfc22d8531314d0573d2f65d67fff0a668fba89f7cd1031e8e79dfd93295.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/evermind/EverMemOS-9c1bf302db0266dee18e8cd83746c53601b196ce529a5923ea8cdc59b2bddbf3.yml
openapi_spec_hash: 2dd34dcdb394e5be4cf491a8379869b5
config_hash: e314e6089e466e0a21c661dbe2b90e58
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## 0.4.0 (2026-05-01)

Full Changelog: [v0.3.13...v0.4.0](https://github.com/evermemos/evermemos-python/compare/v0.3.13...v0.4.0)

### Features

* **internal:** implement indices array format for query and form serialization ([460be41](https://github.com/evermemos/evermemos-python/commit/460be416108fee108d093d482207208d771b6f4b))


### Bug Fixes

* **client:** preserve hardcoded query params when merging with user params ([9b7222d](https://github.com/evermemos/evermemos-python/commit/9b7222def8abac2970bcc4a73371e779075deb60))
* **deps:** bump minimum typing-extensions version ([d28913f](https://github.com/evermemos/evermemos-python/commit/d28913f882fc326c0996b93c347a4d39e23b681e))
* ensure file data are only sent as 1 parameter ([5a6ad09](https://github.com/evermemos/evermemos-python/commit/5a6ad09a54d7fd0e6d805c86eb12246cef469863))
* **pydantic:** do not pass `by_alias` unless set ([9786776](https://github.com/evermemos/evermemos-python/commit/97867769c90346476b205f8e42fdef295f712b0b))
* sanitize endpoint path params ([5a8377f](https://github.com/evermemos/evermemos-python/commit/5a8377f2b2c6620ae4baf3cd091638cac1116a78))


### Chores

* **ci:** bump uv version ([da041d5](https://github.com/evermemos/evermemos-python/commit/da041d5677f9cd0273554515329c8aad11ee8e46))
* **ci:** skip lint on metadata-only changes ([5c190ea](https://github.com/evermemos/evermemos-python/commit/5c190ea3b710d4d5074cac810ed4920609512ce0))
* **ci:** skip uploading artifacts on stainless-internal branches ([721abc8](https://github.com/evermemos/evermemos-python/commit/721abc8a7ae2a386bbadc0b55e5e5caab1211759))
* **internal:** add request options to SSE classes ([3d9a5d8](https://github.com/evermemos/evermemos-python/commit/3d9a5d842819e938a9b91e2228caa5820e5f8ab4))
* **internal:** codegen related update ([118d6b1](https://github.com/evermemos/evermemos-python/commit/118d6b152673d3e583cfc6baa9b7aefe51e95e01))
* **internal:** codegen related update ([67e0217](https://github.com/evermemos/evermemos-python/commit/67e02174360ef983ab9b9d2e3e030b7d0f3fa75e))
* **internal:** codegen related update ([4af43ee](https://github.com/evermemos/evermemos-python/commit/4af43ee961f0dda38a7391607776558c5996e858))
* **internal:** codegen related update ([b743f30](https://github.com/evermemos/evermemos-python/commit/b743f30bc21a2adc20b80eaa3bf7a36e448481df))
* **internal:** make `test_proxy_environment_variables` more resilient ([b75db1c](https://github.com/evermemos/evermemos-python/commit/b75db1cf66897f85bb4e96b0c2fe37649ec4c7ef))
* **internal:** make `test_proxy_environment_variables` more resilient to env ([e90baf7](https://github.com/evermemos/evermemos-python/commit/e90baf7a239546f50667af8d67aaf80bba256e5f))
* **internal:** remove mock server code ([fcbe761](https://github.com/evermemos/evermemos-python/commit/fcbe7615195686bb09fcbf3fda208d954fe9daaa))
* **internal:** tweak CI branches ([ff8dcc9](https://github.com/evermemos/evermemos-python/commit/ff8dcc9ea080079828a0323df7265b5776bc625d))
* **internal:** update gitignore ([c4581ec](https://github.com/evermemos/evermemos-python/commit/c4581ec2c38d0bc62b4e9a522599c483788376d7))
* update mock server docs ([f09c77f](https://github.com/evermemos/evermemos-python/commit/f09c77f977f05ac11659589785538c7566e1eeca))

## 0.3.13 (2026-02-13)

Full Changelog: [v0.3.12...v0.3.13](https://github.com/evermemos/evermemos-python/compare/v0.3.12...v0.3.13)
Expand Down
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
# you will need npm installed
$ npx prism mock path/to/your/openapi.yml
```

```sh
$ ./scripts/test
```
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "evermemos"
version = "0.3.13"
version = "0.4.0"
description = "The official Python library for the EverMemOS API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ authors = [
dependencies = [
"httpx>=0.23.0, <1",
"pydantic>=1.9.0, <3",
"typing-extensions>=4.10, <5",
"typing-extensions>=4.14, <5",
"anyio>=3.5.0, <5",
"distro>=1.7.0, <2",
"sniffio",
Expand Down Expand Up @@ -154,7 +154,7 @@ show_error_codes = true
#
# We also exclude our `tests` as mypy doesn't always infer
# types correctly and Pyright will still catch any type errors.
exclude = ['src/evermemos/_files.py', '_dev/.*.py', 'tests/.*']
exclude = ["src/evermemos/_files.py", "_dev/.*.py", "tests/.*"]

strict_equality = true
implicit_reexport = true
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

export DEFER_PYDANTIC_BUILD=false

Expand Down
4 changes: 4 additions & 0 deletions src/evermemos/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ def _build_request(
files = cast(HttpxRequestFiles, ForceMultipartDict())

prepared_url = self._prepare_url(options.url)
# preserve hard-coded query params from the url
if params and prepared_url.query:
params = {**dict(prepared_url.params.items()), **params}
prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
if "_" in prepared_url.host:
# work around https://github.com/encode/httpx/discussions/2880
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
Expand Down
24 changes: 23 additions & 1 deletion src/evermemos/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
RequestOptions,
not_given,
)
from ._utils import is_given, get_async_library
from ._utils import (
is_given,
is_mapping_t,
get_async_library,
)
from ._compat import cached_property
from ._version import __version__
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
Expand Down Expand Up @@ -90,6 +94,15 @@ def __init__(
if base_url is None:
base_url = f"https://api.evermind.ai"

custom_headers_env = os.environ.get("EVER_MEM_OS_CUSTOM_HEADERS")
if custom_headers_env is not None:
parsed: dict[str, str] = {}
for line in custom_headers_env.split("\n"):
colon = line.find(":")
if colon >= 0:
parsed[line[:colon].strip()] = line[colon + 1 :].strip()
default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}

super().__init__(
version=__version__,
base_url=base_url,
Expand Down Expand Up @@ -264,6 +277,15 @@ def __init__(
if base_url is None:
base_url = f"https://api.evermind.ai"

custom_headers_env = os.environ.get("EVER_MEM_OS_CUSTOM_HEADERS")
if custom_headers_env is not None:
parsed: dict[str, str] = {}
for line in custom_headers_env.split("\n"):
colon = line.find(":")
if colon >= 0:
parsed[line[:colon].strip()] = line[colon + 1 :].strip()
default_headers = {**parsed, **(default_headers if is_mapping_t(default_headers) else {})}

super().__init__(
version=__version__,
base_url=base_url,
Expand Down
11 changes: 9 additions & 2 deletions src/evermemos/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
from datetime import date, datetime
from typing_extensions import Self, Literal
from typing_extensions import Self, Literal, TypedDict

import pydantic
from pydantic.fields import FieldInfo
Expand Down Expand Up @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
return model.model_dump_json(indent=indent)


class _ModelDumpKwargs(TypedDict, total=False):
by_alias: bool


def model_dump(
model: pydantic.BaseModel,
*,
Expand All @@ -142,14 +146,17 @@ def model_dump(
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
kwargs: _ModelDumpKwargs = {}
if by_alias is not None:
kwargs["by_alias"] = by_alias
return model.model_dump(
mode=mode,
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
**kwargs,
)
return cast(
"dict[str, Any]",
Expand Down
Loading
Loading