You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Generate Markdown documentation using Cohere Chat API"""
43
-
messages= [
44
-
{
45
-
"role": "system",
46
-
"content": "You are a helpful assistant that generates documentation for Ansible roles in Markdown format."
47
-
},
48
-
{
49
-
"role": "user",
50
-
"content": f"Document the Ansible role '{role_name}'. Include:\n- Purpose of the role\n- Main tasks\n- Variables and defaults\n- Dependencies or role requirements\n\nYAML content:\n{content}"
51
-
}
52
-
]
46
+
"""Generate Markdown documentation using OpenRouter Chat API"""
47
+
prompt=f"""
48
+
Document the Ansible role '{role_name}'. Include:
49
+
- Purpose of the role
50
+
- Main tasks
51
+
- Variables and defaults
52
+
- Dependencies or role requirements
53
53
54
-
response=co.chat(
55
-
model="command-a-03-2025", # Free-tier compatible chat model
56
-
messages=messages,
57
-
max_tokens=1000,
58
-
temperature=0.5
59
-
)
54
+
YAML content:
55
+
{content}
56
+
"""
60
57
61
-
# Access the generated text
62
-
returnresponse.message.content[0].text.strip()
58
+
payload= {
59
+
"model": "gpt-4o-mini", # free-tier compatible model
0 commit comments