From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#75023: 31.0.50; Warning: Unused lexical variable =?UTF-8?Q?=E2=80=98max-tokens=E2=80=99?= -- while used in function Date: Sun, 22 Dec 2024 17:01:32 +0000 Message-ID: References: <87a5cn2a0h.fsf@lco2.mail-host-address-is-not-set> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29876"; mail-complaints-to="usenet@ciao.gmane.io" To: Jean Louis , 75023@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 22 18:03:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tPPML-0007bf-53 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Dec 2024 18:03:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPPM9-00086F-8h; Sun, 22 Dec 2024 12:03:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPPM7-00085o-4A for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 12:03:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPPM6-0007Bd-QR for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 12:03:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=3CoON/QhMPaYf4NcmiMkXcVqFbhCerrzwYKRALAuwuk=; b=S1kwCbmtyPXvBGdMrg68zgZ7kvNDmhZOCnt0sJcb15MDQ3Y42Izqn89EgcTLCPmpOnLJyB5UrtPWZBNrHPlnb9t8KN95C+2QwbfrwR8tTG6Y+MIwd8+ceKl+ncn8H7km/9HZVMvaUC8SRZ60W9FDJepmQ/I5utNR8+Q0d4h+IfqIEwFf4yYzOGIo6jv37PK1TrZcgJdek8iUjuUbYjIpuYygsW6HhT8UU6ex0Gjr4vbnOo4evOW76GDDkJqXMlFt/izzksBWnoe4younsRXRIvxTRPZq88sLsRjLGVaQnBvG4hmVzbFK/ndkaFVvggUnDgb0Axemb0hQXpOChJ/lAQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tPPM6-0006Zp-Ax for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2024 12:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Dec 2024 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75023 X-GNU-PR-Package: emacs Original-Received: via spool by 75023-submit@debbugs.gnu.org id=B75023.173488695825239 (code B ref 75023); Sun, 22 Dec 2024 17:03:02 +0000 Original-Received: (at 75023) by debbugs.gnu.org; 22 Dec 2024 17:02:38 +0000 Original-Received: from localhost ([127.0.0.1]:51670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPPLh-0006Z0-H2 for submit@debbugs.gnu.org; Sun, 22 Dec 2024 12:02:37 -0500 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:55490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tPPLe-0006Yj-6N for 75023@debbugs.gnu.org; Sun, 22 Dec 2024 12:02:36 -0500 Original-Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5d437235769so5904123a12.2 for <75023@debbugs.gnu.org>; Sun, 22 Dec 2024 09:02:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734886893; x=1735491693; darn=debbugs.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:from:to:cc:subject:date:message-id :reply-to; bh=3CoON/QhMPaYf4NcmiMkXcVqFbhCerrzwYKRALAuwuk=; b=N4L8PPIPJkFhDugY4LzCTnY9q+5DNfDBXmRVNDz+3yTYt5Nh6LDSW6QgppSmLosDR6 I/8CJl5725mYI4MszTu7QU3r+hXnxpgii+JX8d6r7yf+IH0mC55SqluvKrAnI9RwtHhp sP+6BAg5zF6GHjLXKmro+WxYrNmb8WTSCP/CUSFgIilyLCnlzbYGgJjoFS/+YYwTncV7 +POivX/fR+hgnKjTc6oOPcNsDGCbif33augJ4fnRaNm7n6Ka3gmSMbi26WeQzlvKNEzL vhwsQwIF0H+eV+0KD7hl61mULuBwla57lrWtQihJ9gfb1MCoTUFDikqg7BJ3+DBX1bqF FSHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734886893; x=1735491693; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=3CoON/QhMPaYf4NcmiMkXcVqFbhCerrzwYKRALAuwuk=; b=Y14nB/lib+8w7mdVC2ih9oUphrZvYS7THYS55Ihcl4vJshrYVRzQ+GDnSTZU24N23G KV7wmRo9faJRNL05gtIjs8BANM4UwL4PcxbeyCgNbST6n7328oR5Nf5uZZpvxjx8XQ66 NCYDgqECdtrRDHTYJlZ9fBml4UTMPdTcFVIeoPdPjNFys8LEAmjrH0hWcz3wQaHezCN2 aL4JI2txY4Nmv2/l5A7EtBLEBknk7fzE15U0M0mkO/gUYkwfUP6p2ugt5zkuhij2wXbR np5fQaEEy76WzI3n0ruApuB7LxZIqP/UVpsf1VUF+wDK/8gBXMdLwdgv7rcSXHHKP4nz 8gTA== X-Forwarded-Encrypted: i=1; AJvYcCVXirMP92FKNxt6j+Ca19844Bg+R2VUfiTYIdA6R96t0TTiK1NBjI86dgcPwmhV4w1yqrzA7A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yy8GBBE9DNjeYIw3fPjR0u3Po/eB80KUIpOebgx8eJPQBFIClby eknRft+v8PrBAZiPzl3dQwVg+FH5XAxP3tWHblJ3tPbdYcn6hTd3YfLoVwOChVUdGZfZ62Vb+Ao t4dkzsj6OkZqcTFPKIHZEPW+E1kc= X-Gm-Gg: ASbGncvaPJ1zx9N3rmPWEPLijR2wpjepVoqocGCn+IB9jp5snuH+ot8H3olLKuIqFzr 2GyF9m/hXCnZ6KspgId0FOQBgshk37CWlU424wWCl X-Google-Smtp-Source: AGHT+IGhzF7M+bnzWD/m9swScYdm5OtqvBL0ByKw6Ns1hVddP5mb732Vsh5jmnJqWLxUIF3ZitZqxTDVpB32qPJuaXo= X-Received: by 2002:a05:6402:5256:b0:5d0:bdc1:75df with SMTP id 4fb4d7f45d1cf-5d81ddf7fa6mr8534973a12.24.1734886892944; Sun, 22 Dec 2024 09:01:32 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 22 Dec 2024 17:01:32 +0000 In-Reply-To: <87a5cn2a0h.fsf@lco2.mail-host-address-is-not-set> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297609 Archived-At: tags 75023 + moreinfo thanks Jean Louis writes: > (defun rcd-llm-db (prompt &optional memory rcd-llm-model temperature max-= tokens top-p stream) > "Send PROMPT to API as decided by the database. > > Optional MEMORY, RCD-LLM-MODEL, TEMPERATURE, MAX-TOKENS, TOP-P, and STREA= M can be used." > (let ((rcd-llm-model-id (rcd-db-users-defaults "llmmodels"))) > (cond ((not rcd-llm-model-id) (rcd-warning-message "Did not find defa= ult user's LLM model. Do `M-x rcd-my-defaults' to set it.")) > (t (let* ((rcd-llm-model (rcd-db-get-entry "llmmodels" "llmmodels_name= " rcd-llm-model-id rcd-db)) > (temperature (or temperature (rcd-db-get-entry "llmmodels" "llmmode= ls_temperature" rcd-llm-model-id rcd-db))) > (max-tokens (or max-tokens (rcd-db-get-entry "llmmodels" "llmmodels= _maxtokens" rcd-llm-model-id rcd-db))) > (top-p (or top-p (rcd-db-get-entry "llmmodels" "llmmodels_topp" rcd= -llm-model-id rcd-db))) > (llm-endpoint-id (rcd-db-get-entry "llmmodels" "llmmodels_llmendpoi= nts" rcd-llm-model-id rcd-db)) > (llm-endpoint (rcd-db-get-entry "llmendpoints" "llmendpoints_name" = llm-endpoint-id rcd-db)) > (llm-provider-id (rcd-db-get-entry "llmendpoints" "llmendpoints_llm= providers" llm-endpoint-id rcd-db)) > (api-key (rcd-db-get-entry "llmproviders" "llmproviders_apikey" llm= -provider-id rcd-db)) > (authorization (concat "Bearer " api-key)) > (stream (if stream t :json-false)) > (url-request-method "POST") > (url-request-extra-headers > `(("Content-Type" . "application/json") > ("Authorization" . ,authorization))) > (url-request-data > (encode-coding-string > (setq rcd-llm-last-json > (json-encode > `((model . ,rcd-llm-model) > (messages . [((role . "user") (content . ,prompt))]) > (temperature . ,temperature) > (max_tokens . ,max-tokens) > (top_p . ,top-p) > (stream . ,stream)))) > 'utf-8)) > (buffer (url-retrieve-synchronously llm-endpoint))) > (rcd-llm-response buffer)))))) > > > in that above function I am using ,max-tokens, but with interpolation. > > Though, byte compiler gives warning: > > Unused lexical variable =E2=80=98max-tokens=E2=80=99 -- while used in fun= ction Could you please send a smaller example that reproduces the bug?