Skip to content

Commit cfa3708

Browse files
stefanotorneo91volt
authored andcommitted
Enable cloud_llm brick (#26)
1 parent 631d191 commit cfa3708

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
id: arduino:cloud_llm
22
name: Cloud LLM
33
description: "Cloud LLM Brick enables seamless integration with cloud-based Large Language Models (LLMs) for advanced AI capabilities in your Arduino projects."
4-
disabled: true
5-
64
variables:
7-
- API_KEY
5+
- name: API_KEY
6+
description: API Key for the cloud-based LLM service

src/arduino/app_bricks/cloud_llm/cloud_llm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from langchain_core.messages import SystemMessage
1313
from langchain_core.output_parsers import StrOutputParser
1414
from langchain_core.chat_history import InMemoryChatMessageHistory
15+
from langsmith import uuid7
1516

1617
from arduino.app_utils import Logger, brick
1718

@@ -87,7 +88,7 @@ def __init__(
8788
timeout=self._timeout,
8889
)
8990
self._parser = StrOutputParser()
90-
self._history_cfg = {"configurable": {"session_id": "default_session"}}
91+
self._history_cfg = {"configurable": {"session_id": uuid7()}}
9192

9293
core_chain = self._prompt | self._model | self._parser
9394
self._chain = RunnableWithMessageHistory(

0 commit comments

Comments
 (0)