gpt
No long description provided.
Installation
dagger install github.com/shykes/x/gpt@v2.0.0Entrypoint
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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRETfunc (m *MyModule) Example(token *dagger.Secret) *dagger.Gpt {
return dag.
Gpt(token)
}@function
def example(token: dagger.Secret, ) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET with-secret --name string --value env:MYSECRETfunc (m *MyModule) Example(token *dagger.Secret, name string, value *dagger.Secret) *dagger.Gpt {
return dag.
Gpt(token).
WithSecret(name, value)
}@function
def example(token: dagger.Secret, name: str, value: dagger.Secret) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET with-directory --dir DIR_PATHfunc (m *MyModule) Example(token *dagger.Secret, dir *dagger.Directory) *dagger.Gpt {
return dag.
Gpt(token).
WithDirectory(dir)
}@function
def example(token: dagger.Secret, dir: dagger.Directory) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET hostfunc (m *MyModule) Example(token *dagger.Secret) *dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET changesfunc (m *MyModule) Example(token *dagger.Secret) *dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET historyfunc (m *MyModule) Example(ctx context.Context, token *dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET with-tool-output --call-id string --content stringfunc (m *MyModule) Example(token *dagger.Secret, callId string, content string) *dagger.Gpt {
return dag.
Gpt(token).
WithToolOutput(callId, content)
}@function
def example(token: dagger.Secret, call_id: str, content: str) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET with-prompt --prompt stringfunc (m *MyModule) Example(token *dagger.Secret, prompt string) *dagger.Gpt {
return dag.
Gpt(token).
WithPrompt(prompt)
}@function
def example(token: dagger.Secret, prompt: str) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET with-system-prompt --prompt stringfunc (m *MyModule) Example(token *dagger.Secret, prompt string) *dagger.Gpt {
return dag.
Gpt(token).
WithSystemPrompt(prompt)
}@function
def example(token: dagger.Secret, prompt: str) -> dagger.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@562433ea5e8af4568c6d1fcde10986fa814e396f call \
--token env:MYSECRET ask --prompt stringfunc (m *MyModule) Example(token *dagger.Secret, prompt string) *dagger.Gpt {
return dag.
Gpt(token).
Ask(prompt)
}@function
def example(token: dagger.Secret, prompt: str) -> dagger.Gpt:
return (
dag.gpt(token)
.ask(prompt)
)@func()
example(token: Secret, prompt: string): Gpt {
return dag
.gpt(token)
.ask(prompt)
}