Skip to content

Commit 9d8bbfa

Browse files
authored
Merge pull request #261 from launchdarkly-labs/ai_config_patch
Ai config patch
2 parents 5471322 + 1143dbe commit 9d8bbfa

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Diff for: .github/workflows/demo_provisioning_scripts/DemoBuilder.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ def add_targeting_rules(self):
328328
res = self.ldproject.add_segment_to_flag("federatedAccounts", "development-team", "production")
329329
res = self.ldproject.add_segment_to_flag("wealthManagement", "beta-users", "production")
330330
res = self.ldproject.add_segment_to_flag("cartSuggestedItems", "beta-users", "production")
331+
res = self.ldproject.add_segment_to_flag("ai-config--destination-picker-new-ai-model", "launch-airways-all-members", "production")
332+
331333

332334
def toggle_flags(self):
333335
res = self.ldproject.toggle_flag(
@@ -517,7 +519,7 @@ def create_destination_recommendation_ai_config(self):
517519
"claude-haiku",
518520
"Claude Haiku",
519521
{
520-
"id": "anthropic.claude-instant-v1",
522+
"modelName": "anthropic.claude-instant-v1",
521523
"parameters": {
522524
"temperature": 0.5,
523525
"maxTokens": 150
@@ -535,7 +537,7 @@ def create_destination_recommendation_ai_config(self):
535537
"cohere-text",
536538
"Cohere Text",
537539
{
538-
"id": "cohere.command-text-v14",
540+
"modelName": "cohere.command-text-v14",
539541
"parameters": {
540542
"temperature": 0.7,
541543
"maxTokens": 250
@@ -561,7 +563,7 @@ def create_travel_insights_ai_config(self):
561563
"general-travel",
562564
"General Travel",
563565
{
564-
"id": "anthropic.claude-instant-v1",
566+
"modelName": "anthropic.claude-instant-v1",
565567
"parameters": {
566568
"maxTokens": 200,
567569
"temperature": 0.9
@@ -579,7 +581,7 @@ def create_travel_insights_ai_config(self):
579581
"historical-focus",
580582
"Historical Focus",
581583
{
582-
"id": "anthropic.claude-instant-v1",
584+
"modelName": "anthropic.claude-instant-v1",
583585
"parameters": {
584586
"maxTokens": 200,
585587
"temperature": 0.9
@@ -597,7 +599,7 @@ def create_travel_insights_ai_config(self):
597599
"weather-focus",
598600
"Weather Focus",
599601
{
600-
"id": "anthropic.claude-instant-v1",
602+
"modelName": "anthropic.claude-instant-v1",
601603
"parameters": {
602604
"maxTokens": 200,
603605
"temperature": 0.9
@@ -623,7 +625,7 @@ def create_ai_chatbot_ai_config(self):
623625
"claude-haiku",
624626
"Claude Haiku",
625627
{
626-
"id": "anthropic.claude-instant-v1",
628+
"modelName": "anthropic.claude-instant-v1",
627629
"parameters": {
628630
"maxTokens": 200,
629631
"temperature": 0.5
@@ -641,7 +643,7 @@ def create_ai_chatbot_ai_config(self):
641643
"cohere-coral",
642644
"Cohere Coral",
643645
{
644-
"id": "cohere.command-text-v14",
646+
"modelName": "cohere.command-text-v14",
645647
"parameters": {
646648
"maxTokens": 200,
647649
"temperature": 0.5
@@ -1178,6 +1180,7 @@ def setup_template_environment(self):
11781180
self.ldproject.copy_flag_settings("ai-chatbot", "production", "template-env")
11791181
self.ldproject.copy_flag_settings("storeAttentionCallout", "production", "template-env")
11801182
self.ldproject.copy_flag_settings("cartSuggestedItems", "production", "template-env")
1183+
self.ldproject.copy_flag_settings("ai-config--destination-picker-new-ai-model", "production", "template-env")
11811184

11821185
print("Done")
11831186

Diff for: .github/workflows/demo_provisioning_scripts/LDPlatform.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def create_ai_config_versions(self, ai_config_key, ai_config_version_key, ai_con
289289

290290
response = self.getrequest(
291291
"POST",
292-
"https://app.launchdarkly.com/api/v2/projects/" + self.project_key + "/ai-configs/" + ai_config_key + "/versions",
292+
"https://app.launchdarkly.com/api/v2/projects/" + self.project_key + "/ai-configs/" + ai_config_key + "/variations",
293293
json=payload,
294294
headers=headers,
295295
)

0 commit comments

Comments
 (0)