You are viewing an older version (9.12.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.12.0 / IPython / terminal / shortcuts / auto_suggest / NavigableAutoSuggestFromHistory / _trigger_llm_core

function

IPython.terminal.shortcuts.auto_suggest:NavigableAutoSuggestFromHistory._trigger_llm_core

source: /IPython/terminal/shortcuts/auto_suggest.py :368

Signature

async def   _trigger_llm_core ( self buffer : Buffer )

Summary

This is the core of the current llm request.

Extended Summary

Here we build a compatible InlineCompletionRequest and ask the llm provider to stream it's response back to us iteratively setting it as the suggestion on the current buffer.

Unlike with JupyterAi, as we do not have multiple cells, the cell id is always set to None.

We set the prefix to the current cell content, but could also insert the rest of the history or even just the non-fail history.

In the same way, we do not have cell id.

LLM provider may return multiple suggestion stream, but for the time being we only support one.

Here we make the assumption that the provider will have stream_inline_completions, I'm not sure it is the case for all providers.

Aliases

  • IPython.terminal.interactiveshell.NavigableAutoSuggestFromHistory._trigger_llm_core