format
This commit is contained in:
@@ -66,7 +66,6 @@ To use these variables:
|
|||||||
|
|
||||||
When these environment variables are set, the application will use them instead of showing the setup form.
|
When these environment variables are set, the application will use them instead of showing the setup form.
|
||||||
|
|
||||||
|
|
||||||
## Hiding Messages in the Chat
|
## Hiding Messages in the Chat
|
||||||
|
|
||||||
You can control the visibility of messages within the Agent Chat UI in two main ways:
|
You can control the visibility of messages within the Agent Chat UI in two main ways:
|
||||||
@@ -121,4 +120,3 @@ return { messages: [result] };
|
|||||||
```
|
```
|
||||||
|
|
||||||
This approach guarantees the message remains completely hidden from the user interface.
|
This approach guarantees the message remains completely hidden from the user interface.
|
||||||
|
|
||||||
|
|||||||
@@ -133,9 +133,13 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
|
|||||||
const envApiKey = import.meta.env.VITE_LANGSMITH_API_KEY as string;
|
const envApiKey = import.meta.env.VITE_LANGSMITH_API_KEY as string;
|
||||||
|
|
||||||
// Use URL params with env var fallbacks
|
// Use URL params with env var fallbacks
|
||||||
const [apiUrl, setApiUrl] = useQueryState("apiUrl", { defaultValue: envApiUrl || "" });
|
const [apiUrl, setApiUrl] = useQueryState("apiUrl", {
|
||||||
const [assistantId, setAssistantId] = useQueryState("assistantId", { defaultValue: envAssistantId || "" });
|
defaultValue: envApiUrl || "",
|
||||||
|
});
|
||||||
|
const [assistantId, setAssistantId] = useQueryState("assistantId", {
|
||||||
|
defaultValue: envAssistantId || "",
|
||||||
|
});
|
||||||
|
|
||||||
// For API key, use localStorage with env var fallback
|
// For API key, use localStorage with env var fallback
|
||||||
const [apiKey, _setApiKey] = useState(() => {
|
const [apiKey, _setApiKey] = useState(() => {
|
||||||
const storedKey = getApiKey();
|
const storedKey = getApiKey();
|
||||||
@@ -150,7 +154,7 @@ export const StreamProvider: React.FC<{ children: ReactNode }> = ({
|
|||||||
// Determine final values to use, prioritizing URL params then env vars
|
// Determine final values to use, prioritizing URL params then env vars
|
||||||
const finalApiUrl = apiUrl || envApiUrl;
|
const finalApiUrl = apiUrl || envApiUrl;
|
||||||
const finalAssistantId = assistantId || envAssistantId;
|
const finalAssistantId = assistantId || envAssistantId;
|
||||||
|
|
||||||
// If we're missing any required values, show the form
|
// If we're missing any required values, show the form
|
||||||
if (!finalApiUrl || !finalAssistantId) {
|
if (!finalApiUrl || !finalAssistantId) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user