Skip to content

Commit

Permalink
Remove trailing slash from chat and feedback endpoints (was triggerin…
Browse files Browse the repository at this point in the history
…g a redirect)
  • Loading branch information
vemonet committed Jan 17, 2025
1 parent 4fc2fc9 commit f7f509e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions chat-with-context/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ A web component to easily deploy an interface for a chat with context. It is the

```html
<chat-with-context
chat-endpoint="http://localhost:8000/chat/"
feedback-endpoint="http://localhost:8000/feedback/"
chat-endpoint="http://localhost:8000/chat"
feedback-endpoint="http://localhost:8000/feedback"
api-key="public_apikey_used_by_frontend_to_prevent_abuse_from_robots"
examples="Which resources are available at the SIB?,How can I get the HGNC symbol for the protein P68871?,What are the rat orthologs of the human TP53?,Where is expressed the gene ACE2 in human?,Anatomical entities where the INS zebrafish gene is expressed and its gene GO annotations,List the genes in primates orthologous to genes expressed in the fruit fly eye"
></chat-with-context>
Expand Down Expand Up @@ -64,8 +64,8 @@ Create a `index.html` file with:
<body>
<div>
<chat-with-context
chat-endpoint="http://localhost:8000/chat/"
feedback-endpoint="http://localhost:8000/feedback/"
chat-endpoint="http://localhost:8000/chat"
feedback-endpoint="http://localhost:8000/feedback"
api-key="public_apikey_used_by_frontend_to_prevent_abuse_from_robots"
examples="Which resources are available at the SIB?,How can I get the HGNC symbol for the protein P68871?,What are the rat orthologs of the human TP53?,Where is expressed the gene ACE2 in human?,Anatomical entities where the INS zebrafish gene is expressed and its gene GO annotations,List the genes in primates orthologous to genes expressed in the fruit fly eye"
></chat-with-context>
Expand Down
12 changes: 6 additions & 6 deletions chat-with-context/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ <h2 class="text-xl text-center font-semibold border-b pb-2">
</div>

<div class="flex-grow mx-5">
<!-- api="https://chat.expasy.org/chat/" -->
<!-- Our custom LangGraph API: api="http://localhost:8000/chat/" -->
<!-- LangGraph dev: api="http://localhost:2024/" -->
<!-- LangGraph prod: api="http://localhost:8123/" -->
<!-- api="https://chat.expasy.org/chat" -->
<!-- Our custom LangGraph API: api="http://localhost:8000/chat" -->
<!-- LangGraph dev: api="http://localhost:2024" -->
<!-- LangGraph prod: api="http://localhost:8123" -->
<chat-with-context
chat-endpoint="http://localhost:8000/chat/"
feedback-endpoint="http://localhost:8000/feedback/"
chat-endpoint="http://localhost:8000/chat"
feedback-endpoint="http://localhost:8000/feedback"
api-key="%EXPASY_API_KEY%"
examples="Which resources are available at the SIB?,How can I get the HGNC symbol for the protein P68871?,What are the rat orthologs of the human TP53?,Where is expressed the gene ACE2 in human?,Anatomical entities where the INS zebrafish gene is expressed and its gene GO annotations,List the genes in primates orthologous to genes expressed in the fruit fly eye"
></chat-with-context>
Expand Down
4 changes: 2 additions & 2 deletions chat-with-context/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chat-with-context/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sib-swiss/chat-with-context",
"version": "0.0.9",
"version": "0.0.10",
"description": "A web component to easily deploy a chat with context.",
"license": "MIT",
"author": {
Expand Down
3 changes: 2 additions & 1 deletion chat-with-context/src/chat-with-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ customElement("chat-with-context", {chatEndpoint: "", examples: "", apiKey: "",
state.scrollToInput = () => inputTextEl.scrollIntoView({behavior: "smooth"});
fixInputHeight();

setFeedbackEndpoint(props.feedbackEndpoint.endsWith("/") ? props.feedbackEndpoint : props.feedbackEndpoint + "/");
setFeedbackEndpoint(props.feedbackEndpoint);
// setFeedbackEndpoint(props.feedbackEndpoint.endsWith("/") ? props.feedbackEndpoint : props.feedbackEndpoint + "/");
});

const highlightAll = () => {
Expand Down
3 changes: 2 additions & 1 deletion chat-with-context/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class ChatState {
abortController: AbortController;

constructor({apiUrl, apiKey, model}: {apiUrl: string; apiKey: string; model: string}) {
this.apiUrl = apiUrl.endsWith("/") ? apiUrl : apiUrl + "/";
// this.apiUrl = apiUrl.endsWith("/") ? apiUrl : apiUrl + "/";
this.apiUrl = apiUrl;
this.apiKey = apiKey;
this.model = model;

Expand Down
4 changes: 2 additions & 2 deletions packages/expasy-agent/src/expasy_agent/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ def chat_ui(request: Request) -> Any:
{
"request": request,
"api_key": settings.expasy_api_key,
"chat_endpoint": "https://chat.expasy.org/chat/",
"feedback_endpoint": "https://chat.expasy.org/feedback/",
"chat_endpoint": "https://chat.expasy.org/chat",
"feedback_endpoint": "https://chat.expasy.org/feedback",
"examples": ",".join([
"Which resources are available at the SIB?",
"How can I get the HGNC symbol for the protein P68871?",
Expand Down

0 comments on commit f7f509e

Please sign in to comment.