-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add optimization package stub #109
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
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c7285f7
Implements optimization package stub
andrewklatzke cc85a05
feat: Adds optimization package stub
andrewklatzke 58b7731
feat: Adds optimization package stub
andrewklatzke 872e81e
feat: add optimization package stub
andrewklatzke f1b9ffe
feat: add optimization package stub
andrewklatzke b9a5601
fix: consistency with other makefiles
andrewklatzke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Changelog | ||
|
|
||
| ## 0.0.0 (2026-03-24) | ||
|
|
||
| ### Features | ||
|
|
||
| * Initial package scaffolding for optimization helpers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| PYTEST_FLAGS=-W error::SyntaxWarning | ||
|
|
||
| .PHONY: help | ||
| help: #! Show this help message | ||
| @echo 'Usage: make [target] ... ' | ||
| @echo '' | ||
| @echo 'Targets:' | ||
| @grep -h -F '#!' $(MAKEFILE_LIST) | grep -v grep | sed 's/:.*#!/:/' | column -t -s":" | ||
|
|
||
| .PHONY: install | ||
| install: #! Install package dependencies | ||
| poetry install | ||
|
|
||
| .PHONY: test | ||
| test: #! Run unit tests | ||
| test: install | ||
| poetry run pytest $(PYTEST_FLAGS) | ||
|
|
||
| .PHONY: lint | ||
| lint: #! Run type analysis and linting checks | ||
| lint: install | ||
| poetry run mypy src/ldai_optimization | ||
| poetry run isort --check --atomic src/ldai_optimization | ||
| poetry run pycodestyle src/ldai_optimization | ||
|
|
||
| .PHONY: build | ||
| build: #! Build distribution files | ||
| build: install | ||
| poetry build | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # LaunchDarkly AI SDK — optimization | ||
|
|
||
| [](https://pypi.org/project/launchdarkly-server-sdk-ai-optimization/) | ||
|
|
||
| > [!CAUTION] | ||
| > This package is in pre-release and not subject to backwards compatibility | ||
| > guarantees. The API may change based on feedback. | ||
| > | ||
| > Pin to a specific minor version and review the [changelog](CHANGELOG.md) before upgrading. | ||
|
|
||
| This package will provide helpers to run selected tools against the [LaunchDarkly API](https://apidocs.launchdarkly.com/) from SDK-based workflows. The public surface is not yet finalized; see [CHANGELOG.md](CHANGELOG.md) for updates. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install launchdarkly-server-sdk-ai-optimization | ||
| ``` | ||
|
|
||
| ## Status | ||
|
|
||
| - 3/24/26: Initial package creation | ||
|
|
||
| ## License | ||
|
|
||
| Apache-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| [tool.poetry] | ||
| name = "launchdarkly-server-sdk-ai-optimization" | ||
| version = "0.0.0" | ||
| description = "LaunchDarkly AI SDK optimization helpers" | ||
| authors = ["LaunchDarkly <dev@launchdarkly.com>"] | ||
| license = "Apache-2.0" | ||
| readme = "README.md" | ||
| homepage = "https://docs.launchdarkly.com/sdk/ai/python" | ||
| repository = "https://github.com/launchdarkly/python-server-sdk-ai" | ||
| classifiers = [ | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: Apache Software License", | ||
| "Operating System :: OS Independent", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Programming Language :: Python :: 3.13", | ||
| "Topic :: Software Development", | ||
| "Topic :: Software Development :: Libraries", | ||
| ] | ||
| packages = [{ include = "ldai_optimization", from = "src" }] | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.9,<4" | ||
| launchdarkly-server-sdk-ai = ">=0.16.0" | ||
|
|
||
| [tool.poetry.group.dev.dependencies] | ||
| pytest = ">=2.8" | ||
| pytest-cov = ">=2.4.0" | ||
| pytest-asyncio = ">=0.21.0,<1.0.0" | ||
| mypy = "==1.18.2" | ||
| pycodestyle = ">=2.11.0" | ||
| isort = ">=5.12.0" | ||
|
|
||
| [tool.mypy] | ||
| python_version = "3.9" | ||
| ignore_missing_imports = true | ||
| install_types = true | ||
| non_interactive = true | ||
|
|
||
| [tool.isort] | ||
| profile = "black" | ||
| known_third_party = ["ldai"] | ||
| sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] | ||
|
|
||
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = ["-ra"] | ||
| testpaths = ["tests"] | ||
| asyncio_mode = "auto" | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["poetry-core"] | ||
| build-backend = "poetry.core.masonry.api" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [pycodestyle] | ||
| max-line-length = 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| """LaunchDarkly AI SDK — optimization. | ||
|
|
||
| This package will provide helpers to run selected tools against the LaunchDarkly API from SDK-based workflows. | ||
| """ | ||
|
|
||
| from ldai_optimization.client import ApiAgentOptimizationClient | ||
|
|
||
| __version__ = "0.0.0" | ||
|
|
||
| __all__ = [ | ||
| '__version__', | ||
| 'ApiAgentOptimizationClient', | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| """Client placeholder for LaunchDarkly API tool execution.""" | ||
|
|
||
| from typing import Any, Dict | ||
|
|
||
|
|
||
| class ApiAgentOptimizationClient: | ||
| """Coordinates running supported tools against the LaunchDarkly API. | ||
|
|
||
| This type is scaffolding; concrete behavior will be added in a future release. | ||
| """ | ||
|
|
||
| def optimize(self, tool_name: str, parameters: Dict[str, Any]) -> Any: | ||
| """Execute a supported LaunchDarkly API tool by name. | ||
|
|
||
| :param tool_name: Identifier of the tool to invoke. | ||
| :param parameters: Tool-specific request parameters. | ||
| :return: Tool-specific response data. | ||
| :raises NotImplementedError: Until the API integration is implemented. | ||
| """ | ||
| raise NotImplementedError |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| """Smoke tests for ldai_optimization.""" | ||
|
|
||
| import pytest | ||
|
|
||
| from ldai_optimization import ApiAgentOptimizationClient, __version__ | ||
|
|
||
|
|
||
| def test_version_is_string(): | ||
| assert isinstance(__version__, str) | ||
| assert len(__version__) > 0 | ||
|
|
||
|
|
||
| def test_optimize_not_implemented(): | ||
| client = ApiAgentOptimizationClient() | ||
| with pytest.raises(NotImplementedError): | ||
| client.optimize("example", {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.