devika icon indicating copy to clipboard operation
devika copied to clipboard

[feature request] LM-Studio, Google Web Search on Selenium Library

Open Ahmet0691 opened this issue 1 year ago • 1 comments

The LM-Studio application allows to use many language models and also gives a local ip to be used by other applications, it will be more useful if it is added to the code sample python code,

# Example: reuse your existing OpenAI setup
from openai import OpenAI

# Point to the local server
client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")

completion = client.chat.completions.create(
  model="local-model", # this field is currently unused
  messages=[
    { "role": "system", "content": "Always answer in rhymes."},
    { "role": "user", "content": "Introduce yourself."}
  ],
  temperature=0.7,
)

print(completion.choices[0].message)

Instead of using the BING Web Search API, it will be very useful to search through google via the selenium library and go to the desired sites.

Ahmet0691 avatar Mar 25 '24 20:03 Ahmet0691

I didn't test it so I cannot confirm this. But in PowerShell you can simply do this and it should work: $env:OPENAI_API_BASE="http://localhost:1234/v1" python devika.py And have LM Studio working.

For the search, I agree that Bing API is limiting. But this was already requested by myself not long ago. You should avoid double posting, and use the GitHub search feature before making new posts for issues or feature requests. https://github.com/stitionai/devika/issues/38 And as you can see there, duckduckgo and google search API are coming.

Mayorc1978 avatar Mar 26 '24 19:03 Mayorc1978

integrated custom API endpoint for openai.

ARajgor avatar Apr 19 '24 10:04 ARajgor