neurotrace.core.llm_tasks
¶
neurotrace.core.llm_tasks
¶
get_graph_summary(llm, text)
¶
Get a graph summary from the LLM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm
|
BaseLLM
|
The language model to use for summarisation. |
required |
text
|
str
|
The input text to summarize. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The graph summary generated by the LLM. |
Source code in neurotrace/core/llm_tasks.py
get_vector_and_graph_summary(llm, text)
¶
Get vector and graph summaries from the LLM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm
|
BaseLLM
|
The language model to use for summarisation. |
required |
text
|
str
|
The input text to summarize. |
required |
Returns:
Type | Description |
---|---|
Dict[str, str]
|
Tuple[str, str]: A tuple containing the vector summary and graph summary. |
Source code in neurotrace/core/llm_tasks.py
perform_summarisation(llm, prompt_placeholders, prompt=None)
¶
Perform summarisation using the provided LLM and prompt with a single message.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
llm
|
BaseLLM
|
The language model to use for summarisation. |
required |
prompt
|
PromptTemplate
|
The prompt with any number of variables. |
None
|
message
|
str
|
The input text to summarise. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The summarized or generated output from the LLM. |
str
|
param prompt_placeholders: |