ask-coding-providers 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1e380717ee69fa2d0da0df5a2c706e2b6e8ef3509ea6f6baad0c96d170d62f3
|
|
4
|
+
data.tar.gz: 21d327fadd79f5fbbdce88c71e1009b2f45b03431bd7cf29e258f4bcb07b3b05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 975feb731eb168bd1a291c395e6421fd882ca9b0a23766602dde39352a187cb79c354df70d531e4516eb6050854e2086bbe3c629185e7751ea6d54c6554eca3a
|
|
7
|
+
data.tar.gz: 23cf6fe197707a8a0d456fbc8299f004cbb87134b17393a634305d227d1ada59b1bf476458ad482cc734317be8b87ae0972e240f6bc87a5d2a08ee1576707c57
|
|
@@ -147,7 +147,9 @@ module Ask
|
|
|
147
147
|
# @param workspace_path [String] working directory
|
|
148
148
|
# @param mode [String, nil] permission mode
|
|
149
149
|
# @param model [String, nil] model override for this session
|
|
150
|
-
|
|
150
|
+
# @param system_prompt [String, nil] system prompt override for this
|
|
151
|
+
# session (takes precedence over any system_prompt in session_opts)
|
|
152
|
+
def create_session(workspace_path, mode: nil, model: nil, system_prompt: nil)
|
|
151
153
|
ensure_started
|
|
152
154
|
sid = "sess_#{SecureRandom.uuid}"
|
|
153
155
|
@mutex.synchronize do
|
|
@@ -155,6 +157,7 @@ module Ask
|
|
|
155
157
|
workspace: workspace_path,
|
|
156
158
|
mode: mode,
|
|
157
159
|
model: model || @model_id,
|
|
160
|
+
system_prompt: system_prompt,
|
|
158
161
|
created_at: Time.now,
|
|
159
162
|
session: nil,
|
|
160
163
|
subscribers: [],
|
|
@@ -364,7 +367,8 @@ module Ask
|
|
|
364
367
|
# ── Session construction ──
|
|
365
368
|
|
|
366
369
|
def build_session(entry)
|
|
367
|
-
|
|
370
|
+
prompt = entry[:system_prompt] || @session_opts[:system_prompt]
|
|
371
|
+
chat = build_chat(entry[:model], prompt)
|
|
368
372
|
|
|
369
373
|
queue = EmittingApprovalQueue.new(
|
|
370
374
|
on_submit: ->(a) { emit_approval(entry, a, :pending) },
|
|
@@ -393,12 +397,13 @@ module Ask
|
|
|
393
397
|
end
|
|
394
398
|
end
|
|
395
399
|
|
|
396
|
-
def build_chat(model_id)
|
|
400
|
+
def build_chat(model_id, system_prompt = nil)
|
|
397
401
|
chat = Ask::Agent::Chat.new(
|
|
398
402
|
model: model_id,
|
|
399
403
|
provider: @provider_slug,
|
|
400
404
|
tools: @tools
|
|
401
405
|
)
|
|
406
|
+
chat.with_instructions(system_prompt) if system_prompt
|
|
402
407
|
# Inject pre-configured provider to bypass Ask::Auth.resolve
|
|
403
408
|
chat.instance_variable_set(:@provider, @provider)
|
|
404
409
|
chat
|