Skip to content

Commit 5e48aae

Browse files
committed
add known codex connectors feenkcom/gtoolkit#5194
1 parent cf063c4 commit 5e48aae

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

‎src/Gt4LlmCore/GtLConnectionRegistry.class.st‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,17 @@ GtLConnectionRegistry >> initialize [
224224
self updateConnections.
225225
]
226226

227+
{ #category : #accessing }
228+
GtLConnectionRegistry >> knownCodexConnectors [
229+
GtLOpenAiCodexProvider isConnectable ifFalse: [ ^ #() ].
230+
231+
^ {GtLConnectionRegistry instance
232+
addConnection: (GtLConnection new
233+
providerClass: GtLOpenAiCodexProvider;
234+
label: 'GPT 5.6 Terra (Codex)';
235+
model: 'gpt-5.6-terra')}
236+
]
237+
227238
{ #category : #accessing }
228239
GtLConnectionRegistry >> knownConnectors [
229240
^ {
@@ -251,10 +262,6 @@ GtLConnectionRegistry >> knownConnectors [
251262
providerClass: GtLOpenAiResponsesProvider;
252263
label: 'GPT 5.6 Sol';
253264
model: 'gpt-5.6-sol'.
254-
" GtLConnection new
255-
providerClass: GtLOpenAiResponsesProvider;
256-
label: 'GPT 5.6 Terra';
257-
model: 'gpt-5.6-terra'."
258265
GtLConnection new
259266
providerClass: GtLOpenAiResponsesProvider;
260267
label: 'GPT 5.6 Luna';
@@ -268,6 +275,7 @@ GtLConnectionRegistry >> knownConnectors [
268275
label: 'GPT 5.4';
269276
model: 'gpt-5.4'.
270277
},
278+
self knownCodexConnectors,
271279
self knownOllamaConnectors
272280
]
273281

‎src/Gt4LlmModel/GtLOpenAiCodexCredential.class.st‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ GtLOpenAiCodexCredential class >> accessToken: anAccessToken refreshToken: aRefr
2020
yourself
2121
]
2222

23+
{ #category : #'instance creation' }
24+
GtLOpenAiCodexCredential class >> defaultCodexAuthFileReference [
25+
^ FileLocator home / '.codex' / 'auth.json' contents
26+
]
27+
2328
{ #category : #'instance creation' }
2429
GtLOpenAiCodexCredential class >> expiresAtFromAccessToken: anAccessToken [
2530
| parts encodedPayload paddingCount payload expiresAtSeconds |
@@ -39,7 +44,7 @@ GtLOpenAiCodexCredential class >> expiresAtFromAccessToken: anAccessToken [
3944
{ #category : #'instance creation' }
4045
GtLOpenAiCodexCredential class >> fromDefaultCodexFile [
4146
| json dict accessToken refreshToken accountId expiry |
42-
json := FileLocator home / '.codex' / 'auth.json' contents.
47+
json := self defaultCodexAuthFileReference.
4348
dict := STON fromString: json.
4449
accessToken := (dict at: 'tokens') at: 'access_token'.
4550
refreshToken := (dict at: 'tokens') at: 'refresh_token'.

‎src/Gt4LlmModel/GtLOpenAiCodexProvider.class.st‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Class {
44
#category : #'Gt4LlmModel-Codex'
55
}
66

7+
{ #category : #'as yet unclassified' }
8+
GtLOpenAiCodexProvider class >> isConnectable [
9+
^ GtLOpenAiCodexCredential defaultCodexAuthFileReference exists
10+
]
11+
712
{ #category : #accessing }
813
GtLOpenAiCodexProvider class >> providerName [
914
^ 'OpenAI Codex'

0 commit comments

Comments
 (0)