Skip to content

Commit

Permalink
added gomarkdoc to devenv and added a README.md to the tools package
Browse files Browse the repository at this point in the history
that is generated from the gomarkdoc comments in doc.go
  • Loading branch information
conneroisu committed Jan 9, 2025
1 parent 0c838da commit 2b54d99
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 0 deletions.
1 change: 1 addition & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ in {
gomodifytags
gotests
gotools
gomarkdoc
];

scripts = {
Expand Down
164 changes: 164 additions & 0 deletions pkg/tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# tools

LLM Tooling package for groq-go.

<!-- gomarkdoc:embed:start -->

<!-- Code generated by gomarkdoc. DO NOT EDIT -->

# tools

```go
import "github.com/conneroisu/groq-go/pkg/tools"
```

Package tools contains the interfaces for groq\-go tooling usable by llms.

## Index

- [type FunctionCall](<#FunctionCall>)
- [type FunctionDefinition](<#FunctionDefinition>)
- [type FunctionParameters](<#FunctionParameters>)
- [type PropertyDefinition](<#PropertyDefinition>)
- [type Tool](<#Tool>)
- [type ToolCall](<#ToolCall>)
- [type ToolChoice](<#ToolChoice>)
- [type ToolFunction](<#ToolFunction>)
- [type ToolType](<#ToolType>)


<a name="FunctionCall"></a>
## type [FunctionCall](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L62-L67>)

FunctionCall represents a function call.

```go
type FunctionCall struct {
// Name is the name of the function call.
Name string `json:"name,omitempty"`
// Arguments is the arguments of the function call in JSON format.
Arguments string `json:"arguments,omitempty"`
}
```

<a name="FunctionDefinition"></a>
## type [FunctionDefinition](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L33-L37>)

FunctionDefinition represents the function definition.

```go
type FunctionDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters FunctionParameters `json:"parameters"`
}
```

<a name="FunctionParameters"></a>
## type [FunctionParameters](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L39-L44>)

FunctionParameters represents the function parameters of a tool.

```go
type FunctionParameters struct {
Type string `json:"type"`
Properties map[string]PropertyDefinition `json:"properties"`
Required []string `json:"required"`
AdditionalProperties bool `json:"additionalProperties,omitempty"`
}
```

<a name="PropertyDefinition"></a>
## type [PropertyDefinition](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L46-L49>)

PropertyDefinition represents the property definition.

```go
type PropertyDefinition struct {
Type string `json:"type"`
Description string `json:"description"`
}
```

<a name="Tool"></a>
## type [Tool](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L10-L15>)

Tool represents the tool.

```go
type Tool struct {
// Type is the type of the tool.
Type ToolType `json:"type"`
// Function is the tool's functional definition.
Function FunctionDefinition `json:"function,omitempty"`
}
```

<a name="ToolCall"></a>
## type [ToolCall](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L51-L60>)

ToolCall represents a tool call.

```go
type ToolCall struct {
// Index is not nil only in chat completion chunk object
Index *int `json:"index,omitempty"`
// ID is the id of the tool call.
ID string `json:"id"`
// Type is the type of the tool call.
Type string `json:"type"`
// Function is the function of the tool call.
Function FunctionCall `json:"function"`
}
```

<a name="ToolChoice"></a>
## type [ToolChoice](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L21-L26>)

ToolChoice represents the tool choice.

```go
type ToolChoice struct {
// Type is the type of the tool choice.
Type ToolType `json:"type"`
// Function is the function of the tool choice.
Function ToolFunction `json:"function,omitempty"`
}
```

<a name="ToolFunction"></a>
## type [ToolFunction](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L28-L31>)

ToolFunction represents the tool function.

```go
type ToolFunction struct {
// Name is the name of the tool function.
Name string `json:"name"`
}
```

<a name="ToolType"></a>
## type [ToolType](<https://github.com/conneroisu/groq-go/blob/main/pkg/tools/tools.go#L19>)

ToolType is the tool type.

string

```go
type ToolType string
```

<a name="ToolTypeFunction"></a>

```go
const (
// ToolTypeFunction is the function tool type.
ToolTypeFunction ToolType = "function"
)
```

Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)


<!-- gomarkdoc:embed:end -->
2 changes: 2 additions & 0 deletions pkg/tools/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Package tools contains the interfaces for groq-go tooling usable by llms.
package tools

//go:generate gomarkdoc -o README.md -e .

0 comments on commit 2b54d99

Please sign in to comment.