Skip to content

Commit 5d72315

Browse files
authored
feat(api): expand Live Decision item and question types (#4175)
## Summary Support more message, tool call, and question input types in Live Decisions. ## Changes - Accept user, developer, system, and assistant messages in Live Decision items. - Add function and custom tool call and output types. - Allow strings or structured instruction parts in Live Decision questions. Co-authored-by: dpiet-oai <326640584+dpiet-oai@users.noreply.github.com>
1 parent 718aee9 commit 5d72315

77 files changed

Lines changed: 5087 additions & 3143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.castiron.stats.yml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
schema_version: 1
2-
generation_id: c6c71409-c9d1-487b-ad35-c8973d3274a6
3-
openapi_spec_hash: 23f0bfa58ad53fef090bea6a72a05dda
4-
openapi_transformed_spec_hash: 39f2336a30336863627b56624b390f24
5-
config_hash: 249b5f41fe1b916955299cea75cddfbf
6-
codegen_sha: 73e15aa409d55f8731c775cab5a85c9e93d66b3c
7-
codegen_hash: 166545ad5fafe31085bb865842a68c605eea009ccfec4e4247b851e46d7c34fb
8-
public_codegen_sha: 74fb1f948524997714d02fb52f387e0ab93ce338
2+
generation_id: a5a7ff8f-541f-4e46-88c8-51581e690980
3+
openapi_spec_hash: fb762e4e737fb2210a01948c7cf70c31
4+
openapi_transformed_spec_hash: 60911088041eda7d04c1a205c2f337a9
5+
config_hash: d356dda7ff9ca3fbc614107eb546de9f
6+
codegen_sha: 29ea9cdfc0d23a284e49573298b06f55482ce078
7+
codegen_hash: 4ff0d4017ca05d7692d4bcdc2e471f62bcb681f9e920035d5b7b42e612c37d74
8+
public_codegen_sha: 9b7555d4163e7448417845732af4bb31f0f51fa7

‎.github/workflows/castiron-custom-code-comment.yml‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ jobs:
2929
pull-requests: read
3030
statuses: write
3131
steps:
32-
# Execute only the helper belonging to this immutable workflow revision.
33-
- name: Check out the trusted review policy
34-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35-
with:
36-
ref: ${{ github.workflow_sha }}
37-
persist-credentials: false
38-
3932
- name: Re-evaluate current PR and queue after review changes
4033
env:
4134
GH_TOKEN: ${{ github.token }}
@@ -70,12 +63,26 @@ jobs:
7063
return sha;
7164
}
7265
async function requiresHuman(pr, mainSha) {
66+
if (!/^[0-9a-f]{40}$/.test(mainSha || '')) throw new Error('Invalid authenticated main');
7367
const path = require('node:path');
7468
const fs = require('node:fs');
7569
const root = fs.mkdtempSync(path.join(process.env.RUNNER_TEMP, 'castiron-review-'));
7670
try {
71+
// Bind executable policy and its dependency to the authenticated
72+
// main snapshot for this decision, including after a retry.
73+
for (const name of ['custom_code_policy.py', 'custom_code_report.py']) {
74+
const {data: file} = await github.rest.repos.getContent({
75+
...context.repo, path: `scripts/castiron/${name}`, ref: mainSha,
76+
});
77+
if (file.type !== 'file' || file.encoding !== 'base64' ||
78+
!Number.isSafeInteger(file.size) || file.size <= 0 || file.size > 1048576 ||
79+
typeof file.content !== 'string') throw new Error('Invalid trusted policy file');
80+
const content = Buffer.from(file.content, 'base64');
81+
if (content.length !== file.size) throw new Error('Invalid trusted policy content');
82+
fs.writeFileSync(path.join(root, name), content, {flag: 'wx'});
83+
}
7784
const result = await exec.getExecOutput('python3', ['-I',
78-
'scripts/castiron/custom_code_policy.py', 'review-required',
85+
path.join(root, 'custom_code_policy.py'), 'review-required',
7986
'--repository', repo, '--repo', path.join(root, 'objects.git'),
8087
'--base', pr.base.sha, '--head', pr.head.sha, '--main', mainSha], {silent: true});
8188
const decision = JSON.parse(result.stdout);

‎api.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,12 +1125,6 @@ Methods:
11251125
- <code title="get /chatkit/threads">client.beta.chatkit.threads.<a href="./src/openai/resources/beta/chatkit/threads.py">list</a>(\*\*<a href="src/openai/types/beta/chatkit/thread_list_params.py">params</a>) -> <a href="./src/openai/types/beta/chatkit/chatkit_thread.py">SyncConversationCursorPage[ChatKitThread]</a></code>
11261126
- <code title="delete /chatkit/threads/{thread_id}">client.beta.chatkit.threads.<a href="./src/openai/resources/beta/chatkit/threads.py">delete</a>(thread_id) -> <a href="./src/openai/types/beta/chatkit/thread_delete_response.py">ThreadDeleteResponse</a></code>
11271127
- <code title="get /chatkit/threads/{thread_id}/items">client.beta.chatkit.threads.<a href="./src/openai/resources/beta/chatkit/threads.py">list_items</a>(thread_id, \*\*<a href="src/openai/types/beta/chatkit/thread_list_items_params.py">params</a>) -> SyncConversationCursorPage[Data]</code>
1128-
<a id="sessions-2"></a>
1129-
1130-
<a id="transcriptionsessions"></a>
1131-
1132-
1133-
## [Realtime](docs/beta-realtime-api.md)
11341128

11351129
## Assistants
11361130

0 commit comments

Comments
 (0)