Skip to content

Commit 5d58b33

Browse files
author
Daniel OBrien
committed
README cleanup
client changes
1 parent 24e4680 commit 5d58b33

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@ This version of the library has a minimum Python version of 3.8.
1212

1313
## Getting started
1414

15-
Install the package
16-
17-
$ pip install launchdarkly-server-sdk-ai
18-
19-
The provided `TracingHook` can be setup as shown below:
20-
21-
<!-- TODO: Install instructions -->
22-
23-
```python
24-
import ldclient
25-
26-
```
15+
Refer to the [SDK reference guide](https://docs.launchdarkly.com/sdk/ai/python) for instructions on getting started with using the SDK.
2716

2817
## Learn more
2918

ldai/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ def model_config(self, key: str, context: Context, default_value: AIConfig, vari
2828
if variables:
2929
all_variables.update(variables)
3030
all_variables['ldctx'] = context
31-
32-
if isinstance(variation['prompt'], list) and all(isinstance(entry, dict) for entry in variation['prompt']):
33-
variation['prompt'] = [
34-
{
35-
'role': entry['role'],
36-
'content': self.interpolate_template(entry['content'], all_variables)
37-
}
38-
for entry in variation['prompt']
39-
]
31+
print(variation)
32+
#if isinstance(variation['prompt'], list) and all(isinstance(entry, dict) for entry in variation['prompt']):
33+
variation['prompt'] = [
34+
{
35+
'role': entry['role'],
36+
'content': self.interpolate_template(entry['content'], all_variables)
37+
}
38+
for entry in variation['prompt']
39+
]
4040

4141
enabled = variation.get('_ldMeta',{}).get('enabled', False)
42-
return AIConfig(config=variation, tracker=LDAIConfigTracker(self.client, variation.get('_ldMeta', {}).get('versionKey', ''), key, context, bool(enabled)))
42+
return AIConfig(config=variation, tracker=LDAIConfigTracker(self.client, variation.get('_ldMeta', {}).get('versionKey', ''), key, context), enabled=bool(enabled))
4343

4444
def interpolate_template(self, template: str, variables: Dict[str, Any]) -> str:
4545
"""

0 commit comments

Comments
 (0)