-
Notifications
You must be signed in to change notification settings - Fork 2
feat: REL-10772 - Part 1 - Added server-ai core packages #65
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
Changes from 2 commits
83d3030
50a42c8
0da0dba
b9bf6f6
0584f7e
b198591
7b954b9
4675731
849a6f5
079c136
5a2d2dc
11750d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| Copyright 2024 Catamorphic, Co. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this needs to be duplicated and should stay in the root unless we need it for the packaging process. |
||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # LaunchDarkly Server-side AI library for Python | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, we have just duplicated this file but left the original at the root. This make sense to move, but we should change the root README in that case. |
||
|
|
||
| ## LaunchDarkly overview | ||
|
|
||
| [LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today! | ||
|
|
||
| [](https://twitter.com/intent/follow?screen_name=launchdarkly) | ||
|
|
||
| ## Supported Python versions | ||
|
|
||
| This version of the library has a minimum Python version of 3.9. | ||
|
|
||
| ## Getting started | ||
|
|
||
| Refer to the [SDK reference guide](https://docs.launchdarkly.com/sdk/ai/python) for instructions on getting started with using the SDK. | ||
|
|
||
| ## Learn more | ||
|
|
||
| Read our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [reference guide for the python SDK](http://docs.launchdarkly.com/docs/python-sdk-ai-reference). | ||
|
|
||
| ## Contributing | ||
|
|
||
| We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this library. | ||
|
|
||
| ## Verifying library build provenance with the SLSA framework | ||
|
|
||
| LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published library packages. To learn more, see the [provenance guide](PROVENANCE.md). | ||
|
|
||
| ## About LaunchDarkly | ||
|
|
||
| - LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: | ||
| - Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. | ||
| - Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). | ||
| - Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. | ||
| - Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. | ||
| - LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list. | ||
| - Explore LaunchDarkly | ||
| - [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information | ||
| - [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides | ||
| - [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation | ||
| - [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| [tool.poetry] | ||
| name = "launchdarkly-server-sdk-ai" | ||
| version = "0.10.1" | ||
| description = "LaunchDarkly SDK for AI" | ||
| 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" | ||
| documentation = "https://launchdarkly-python-sdk-ai.readthedocs.io/en/latest/" | ||
| 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", from = "src" } ] | ||
|
|
||
| [tool.poetry.dependencies] | ||
| python = ">=3.9,<4" | ||
| launchdarkly-server-sdk = ">=9.4.0" | ||
| chevron = "=0.14.0" | ||
|
|
||
|
|
||
| [tool.poetry.group.dev.dependencies] | ||
| pytest = ">=2.8" | ||
| pytest-cov = ">=2.4.0" | ||
| pytest-mypy = "==1.0.1" | ||
| pytest-asyncio = ">=0.21.0" | ||
| mypy = "==1.18.2" | ||
| pycodestyle = "^2.12.1" | ||
| isort = ">=5.13.2,<7.0.0" | ||
|
|
||
|
|
||
| [tool.poetry.group.docs] | ||
| optional = true | ||
|
|
||
| [tool.poetry.group.docs.dependencies] | ||
| sphinx = ">=6,<8" | ||
| sphinx-rtd-theme = ">=1.3,<4.0" | ||
| certifi = ">=2018.4.16" | ||
| expiringdict = ">=1.1.4" | ||
| pyrfc3339 = ">=1.0" | ||
| jsonpickle = ">1.4.1" | ||
| semver = ">=2.7.9" | ||
| urllib3 = ">=1.26.0" | ||
| jinja2 = "3.1.6" | ||
|
|
||
| [tool.mypy] | ||
| python_version = "3.9" | ||
| ignore_missing_imports = true | ||
| install_types = true | ||
| non_interactive = true | ||
|
|
||
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = ["-ra"] | ||
|
|
||
|
|
||
| [build-system] | ||
| requires = ["poetry-core"] | ||
| build-backend = "poetry.core.masonry.api" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| __version__ = "0.10.1" # x-release-please-version | ||
|
|
||
| # Extend __path__ to support namespace packages at the ldai level | ||
| # This allows provider packages (like launchdarkly-server-sdk-ai-langchain) | ||
| # to extend ldai.providers.* even though ldai itself has an __init__.py | ||
| import sys | ||
| from pkgutil import extend_path | ||
|
|
||
| __path__ = extend_path(__path__, __name__) | ||
|
|
||
| # Export chat | ||
| from ldai.chat import TrackedChat | ||
| # Export main client | ||
| from ldai.client import LDAIClient | ||
| # Export judge | ||
| from ldai.judge import AIJudge, EvalScore, JudgeResponse | ||
| # Export models for convenience | ||
| from ldai.models import ( # Deprecated aliases for backward compatibility | ||
| AIAgentConfig, AIAgentConfigDefault, AIAgentConfigRequest, AIAgents, | ||
| AICompletionConfig, AICompletionConfigDefault, AIConfig, AIJudgeConfig, | ||
| AIJudgeConfigDefault, JudgeConfiguration, LDAIAgent, LDAIAgentConfig, | ||
| LDAIAgentDefaults, LDMessage, ModelConfig, ProviderConfig) | ||
|
|
||
| __all__ = [ | ||
| 'LDAIClient', | ||
| 'AIAgentConfig', | ||
| 'AIAgentConfigDefault', | ||
| 'AIAgentConfigRequest', | ||
| 'AIAgents', | ||
| 'AICompletionConfig', | ||
| 'AICompletionConfigDefault', | ||
| 'AIJudgeConfig', | ||
| 'AIJudgeConfigDefault', | ||
| 'AIJudge', | ||
| 'TrackedChat', | ||
| 'EvalScore', | ||
| 'JudgeConfiguration', | ||
| 'JudgeResponse', | ||
| 'LDMessage', | ||
| 'ModelConfig', | ||
| 'ProviderConfig', | ||
| # Deprecated exports | ||
| 'AIConfig', | ||
| 'LDAIAgent', | ||
| 'LDAIAgentConfig', | ||
| 'LDAIAgentDefaults', | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Chat module for LaunchDarkly AI SDK.""" | ||
|
|
||
| from ldai.chat.tracked_chat import TrackedChat | ||
|
|
||
| __all__ = ['TrackedChat'] |
Uh oh!
There was an error while loading. Please reload this page.