Mysterious Langchain Azure OpenAI Problems

I was banging my head on this problem for hours. Using langchain and our Azure OpenAI model, I kept getting a Value error: As of openai>=1.0.0, Azure endpoints should be specified via the `azure_endpoint` param not `openai_api_base` (or alias `base_url`). I was not defining openai_api_base anywhere in my code. LLMs were no use but I did find the suggestion on Reddit to check if openai_api_base was an environment variable. Sure enough, I had defined that months ago, never used it, and forgot it. Deleted the variable and problem solved. ...

November 8, 2024

.bat File on Windows Taskbar

When building my Active Directory search tool, I wanted to launch it from the Windows taskbar. I created a .bat file to activate the python virtual environment and run the program. However, you can’t directly add a .bat file to the taskbar. To get around this you can rename the .bat file extension to .exe, add it to the taskbar, rename the .exe back to .bat, finally edit the properties of the taskbar icon to point back to the renamed .bat file. Why Microsoft? ...

September 28, 2024

LLM-assisted Active Directory Search

I needed to check Active Directory (AD) to see who was part of a group. I use AD infrequently and keep a list of queries in a text file on my desktop, as I can’t ever remember the syntax. As I opened my list I thought…wait, I don’t ever have to do this again. Let’s write a program to take a natural language prompt and have our LLM figure out the PowerShell commands. Within 30 minutes I had a functional program. It took several small iterations and these are the prompts I used. Unfortunately, I can’t share the program. ...

September 27, 2024

Windows Task Scheduler Woes

My favorite cartoonist has a website where he displays daily selections from his archive. I want this in my life but I can’t be bothered to go to a website everyday. So several years ago, I wrote a python script to take screenshots of the cartoons and email them to me (scraping didn’t work). The script was scheduled through Windows Task Scheduler. Then I changed computers, brought over the code, and have been struggling for days to get the task scheduler to work. The task wouldn’t run the python script directly. I wrote .bat and .ps1 files to try and activate the virtual environment, then run the scripts. I fixed that, then the images were downloaded as black images. Over and over, problem after problem, including changing my password and getting locked out of my computer (… cool hack to restore to come). ...

September 20, 2024