gpt
No long description provided.
Installation
dagger install github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf
Entrypoint
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
token | Secret ! | - | OpenAI API token |
model | String | "gpt-4o" | OpenAI model |
knowledgeDir | Directory | - | A builtin knowledge library, made of text files. First paragraph is the description. The rest is the contents. |
systemPrompt | File | - | A system prompt to inject into the GPT context |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET
func (m *myModule) example(token *Secret) *Gpt {
return dag.
Gpt(token)
}
@function
def example(token: dagger.Secret, ) -> dag.Gpt:
return (
dag.gpt(token)
)
@func()
example(token: Secret, ): Gpt {
return dag
.gpt(token)
}
Types
Gpt 🔗
withSecret() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
value | Secret ! | - | No description provided |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET with-secret --name string --value env:MYSECRET
func (m *myModule) example(token *Secret, name string, value *Secret) *Gpt {
return dag.
Gpt(token).
WithSecret(name, value)
}
@function
def example(token: dagger.Secret, name: str, value: dagger.Secret) -> dag.Gpt:
return (
dag.gpt(token)
.with_secret(name, value)
)
@func()
example(token: Secret, name: string, value: Secret): Gpt {
return dag
.gpt(token)
.withSecret(name, value)
}
withDirectory() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | No description provided |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET with-directory --dir DIR_PATH
func (m *myModule) example(token *Secret, dir *Directory) *Gpt {
return dag.
Gpt(token).
WithDirectory(dir)
}
@function
def example(token: dagger.Secret, dir: dagger.Directory) -> dag.Gpt:
return (
dag.gpt(token)
.with_directory(dir)
)
@func()
example(token: Secret, dir: Directory): Gpt {
return dag
.gpt(token)
.withDirectory(dir)
}
host() 🔗
Return Type
Container !
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET host
func (m *myModule) example(token *Secret) *Container {
return dag.
Gpt(token).
Host()
}
@function
def example(token: dagger.Secret, ) -> dagger.Container:
return (
dag.gpt(token)
.host()
)
@func()
example(token: Secret, ): Container {
return dag
.gpt(token)
.host()
}
changes() 🔗
Return Type
Directory !
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET changes
func (m *myModule) example(token *Secret) *Directory {
return dag.
Gpt(token).
Changes()
}
@function
def example(token: dagger.Secret, ) -> dagger.Directory:
return (
dag.gpt(token)
.changes()
)
@func()
example(token: Secret, ): Directory {
return dag
.gpt(token)
.changes()
}
history() 🔗
Return Type
[String ! ] !
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET history
func (m *myModule) example(ctx context.Context, token *Secret) []string {
return dag.
Gpt(token).
History(ctx)
}
@function
async def example(token: dagger.Secret, ) -> List[str]:
return await (
dag.gpt(token)
.history()
)
@func()
async example(token: Secret, ): Promise<string[]> {
return dag
.gpt(token)
.history()
}
withToolOutput() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
callId | String ! | - | No description provided |
content | String ! | - | No description provided |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET with-tool-output --call-id string --content string
func (m *myModule) example(token *Secret, callId string, content string) *Gpt {
return dag.
Gpt(token).
WithToolOutput(callId, content)
}
@function
def example(token: dagger.Secret, call_id: str, content: str) -> dag.Gpt:
return (
dag.gpt(token)
.with_tool_output(call_id, content)
)
@func()
example(token: Secret, callId: string, content: string): Gpt {
return dag
.gpt(token)
.withToolOutput(callId, content)
}
withPrompt() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
prompt | String ! | - | No description provided |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET with-prompt --prompt string
func (m *myModule) example(token *Secret, prompt string) *Gpt {
return dag.
Gpt(token).
WithPrompt(prompt)
}
@function
def example(token: dagger.Secret, prompt: str) -> dag.Gpt:
return (
dag.gpt(token)
.with_prompt(prompt)
)
@func()
example(token: Secret, prompt: string): Gpt {
return dag
.gpt(token)
.withPrompt(prompt)
}
withSystemPrompt() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
prompt | String ! | - | No description provided |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET with-system-prompt --prompt string
func (m *myModule) example(token *Secret, prompt string) *Gpt {
return dag.
Gpt(token).
WithSystemPrompt(prompt)
}
@function
def example(token: dagger.Secret, prompt: str) -> dag.Gpt:
return (
dag.gpt(token)
.with_system_prompt(prompt)
)
@func()
example(token: Secret, prompt: string): Gpt {
return dag
.gpt(token)
.withSystemPrompt(prompt)
}
ask() 🔗
Return Type
Gpt !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
prompt | String ! | - | The message to send the model |
Example
dagger -m github.com/shykes/x/gpt@42ae0db3ccc2208ba87e1cdb74fd19305bf40fcf call \
--token env:MYSECRET ask --prompt string
func (m *myModule) example(token *Secret, prompt string) *Gpt {
return dag.
Gpt(token).
Ask(prompt)
}
@function
def example(token: dagger.Secret, prompt: str) -> dag.Gpt:
return (
dag.gpt(token)
.ask(prompt)
)
@func()
example(token: Secret, prompt: string): Gpt {
return dag
.gpt(token)
.ask(prompt)
}