Feature request: allow seeding a new session with conversation history
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comience por los puntos de entrada SessionConfig, CreateSessionAsync y SendAsync mencionados en la solicitud y, a continuación, siga cómo se inicializa el estado de la conversación de la sesión. Se considera completado cuando los autores de las llamadas pueden proporcionar pares de rol y contenido de usuario y asistente mediante InitialMessages antes del primer SendAsync, y el modelo los trata como historial de conversación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The Copilot SDK uses a session-based model where the session owns the conversation state. This works well when the SDK controls the full conversation lifecycle, but doesn't fit applications that manage conversation history externally. An example is applications that allow the user or harness to rewind, edit, condense or restructure prior turns.
In these cases, the only option is to format prior messages into the prompt text with role markers like [User] / [Assistant] and explain the convention in the system message. This works but is far from ideal, because the model may not treat text labeled as its own prior output with the same status as actual assistant-role messages, and creates confusion if the user's text includes what could be interpreted as unbalanced delimiters (such as ``` without a closing fence).
The SDK's session resumption feature (ResumeSessionAsync) doesn't help here because the caller needs to be able to arbitrarily reshape the history on every turn.
Proposed solution
Add an InitialMessages property to SessionConfig - a list of role/content pairs that seed the session's conversation history before the first SendAsync call:
var session = await client.CreateSessionAsync (new SessionConfig
{
InitialMessages = new List<SessionMessage>
{
new ("user", "Explain async/await in C#"),
new ("assistant", "Async/await is a pattern for..."),
},
// ...
});
The messages would be treated as real conversation history by the model - not as text stuffed into a user prompt.
Note that the history seed doesn't necessarily have to support every feature of every kind of message. Simply having the ability to specify the role (user/assistant) and text would be incredibly useful.
- Lenguaje dominante
- Java
- Estrellas
- 10.5k
- Forks
- 1.5k
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 131
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/copilot-sdk
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/copilot-sdk#2709 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
github/copilot-sdk#2673 ·
-
bug testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
github/copilot-sdk#2628 ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
github/copilot-sdk#2627 · 1 comentario ·
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
github/copilot-sdk#2493 ·
Todos los issues de github/copilot-sdk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
elastic/gradle-plugins#157 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cryptomator/hub#497 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
johanhaleby/occurrent#1120 ·