shareview

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shareview shows what a proposal made in shares read and used: each share's sources and session and the merge's, in the text and JSON forms of the proposal's Read and Session sections. It holds the shares' part of that rendering so that package mapping stays within its budget.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(b *strings.Builder, whole, prompts int, shares []Share, merge *Share)

Read writes the body of the Read section for a proposal in shares: the whole read of the gather (whole tokens, prompts tokens together in every prompt), each share with its source lines, and the merge.

func Sessions

func Sessions(b *strings.Builder, shares []Share, merge *Share, total adapter.Tokens)

Sessions writes the body of the Session section for a proposal in shares: each share's session and the merge's, then the total tokens.

Types

type JSON

type JSON struct {
	PromptTokens int      `json:"prompt_tokens"`
	SourceTokens int      `json:"source_tokens"`
	Sources      []Source `json:"sources"`
	Lines        []string `json:"lines"`
	Session      Session  `json:"session"`
}

JSON is a share in its JSON form.

type Session

type Session struct {
	ID     string         `json:"id"`
	Model  string         `json:"model"`
	Tokens adapter.Tokens `json:"tokens"`
}

Session is a session in its JSON form.

type Share

type Share struct {
	// Read says what the session read, whole; empty for the merge, which
	// reads only the shares' proposals.
	Read reading.Report
	// PromptTokens is the prompt's estimated tokens.
	PromptTokens int
	// SessionID, Model and Tokens are what the session ran under, ran on and
	// used.
	SessionID string
	Model     string
	Tokens    adapter.Tokens
}

Share is what one share's session, or the merge's, read and used.

func (Share) JSON

func (s Share) JSON() JSON

JSON is s in its JSON form, with no null lists.

type Source

type Source struct {
	Name   string `json:"name"`
	Items  int    `json:"items"`
	Tokens int    `json:"tokens"`
}

Source is reading.SourceReport in its JSON form.

func Sources

func Sources(rep reading.Report) []Source

Sources is rep's sources in their JSON form, never nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL