mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-17 06:58:09 +01:00
black formatting
This commit is contained in:
@@ -2,24 +2,26 @@ from dataclasses import dataclass
|
||||
from temporalio import activity
|
||||
from ollama import chat, ChatResponse
|
||||
|
||||
|
||||
@dataclass
|
||||
class OllamaPromptInput:
|
||||
prompt: str
|
||||
context_instructions: str
|
||||
|
||||
|
||||
class OllamaActivities:
|
||||
@activity.defn
|
||||
def prompt_ollama(self, input: OllamaPromptInput) -> str:
|
||||
model_name = 'mistral'
|
||||
model_name = "mistral"
|
||||
messages = [
|
||||
{
|
||||
'role': 'system',
|
||||
'content': input.context_instructions,
|
||||
"role": "system",
|
||||
"content": input.context_instructions,
|
||||
},
|
||||
{
|
||||
'role': 'user',
|
||||
'content': input.prompt,
|
||||
}
|
||||
"role": "user",
|
||||
"content": input.prompt,
|
||||
},
|
||||
]
|
||||
|
||||
response: ChatResponse = chat(model=model_name, messages=messages)
|
||||
|
||||
Reference in New Issue
Block a user