Skip to content

Commit

Permalink
fix unit test and anthropic
Browse files Browse the repository at this point in the history
  • Loading branch information
PhoenixNazarov committed Aug 16, 2024
1 parent 02f55ab commit 5c2b972
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions library/promptadmin/prompt_service/models/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ async def execute(self, prompt: str, history: list[Message]) -> AnthropicModelRe
history.append(Message(content=prompt, role='user'))
elif self.prompt_position == 'system':
system = prompt
if len(history) ==0:
history.append(Message(content=prompt, role='user'))
if len(history) == 0:
history.append(Message(content="Hello", role='user'))

for message in history:
if message.role == 'user':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def preview(self, unit_test: UnitTest, sync_data: SyncData, mapping: Mappi
context.update(json.loads(sync_data.template_context_default))

prompt = await self.prompt_load_service.load_mapping_name(mapping, unit_test.name)
preview = await self.preview_template_service.preview(prompt, context)
preview = await self.preview_template_service.preview(prompt, context, mapping.connection_name)
unit_test.test_preview = preview
except Exception as e:
unit_test.test_exception = str(e)
Expand Down

0 comments on commit 5c2b972

Please sign in to comment.