Skip to content

Instantly share code, notes, and snippets.

@brylie
Created November 5, 2023 17:17
Show Gist options
  • Save brylie/e52eeb3f6029e4741a16076914d3148c to your computer and use it in GitHub Desktop.
Save brylie/e52eeb3f6029e4741a16076914d3148c to your computer and use it in GitHub Desktop.
CodeWithBrylie - e35
(...) Hello and welcome to another live code hangout. We will be working on the Western Friend website during today's session.
(...)
And I'm going to take a quick maintenance task to remove some migration scripts and code.
(...)
This way our tests will pass and our test coverage will increase.
(...)
So currently if I look at the test coverage we'll see there's some failures.
(...)
I'm not exactly sure.
(...)
Interesting.
(...)
I'll take a look at this. So first failure is the testing environment doesn't have a recapture private key.
(...)
So let's try to fix this first thing.
(...)
So to get a little bit of forward movement here let's open up our friend Chad Gipiti.
(...)
I'm not logged in. Darn it. Let me log in real quick.
(...)
Okay, good.
(...)
Log in GPT for advanced data analysis.
(...)
So while running Django tests, I'm getting a failure message that the environment variable is missing undefined.
(...)
How can I set the environment variable to a temporary value during the testing? While writing this, I think I have a different solution. I set the default to an empty string. I think this will go away, but let's just see what GPT says.
(...)
So it looks like it's possible and common. In your test case, you can override settings.
(...)
I don't want to do that through the whole test suite. So that's a bit of an overkill because this was a little bit deeper. There we go. So let's bring up the terminal here.
(...)
Not sure if we're going to update it. There it goes.
(...)
Make sure our development database is running.
(...)
And if I go to settings under a core,(...) there are a few settings here for the recapture.
(...)
And what we're doing is OS get, I think this defaults to none, so we'll default to an empty string.
(...)
But before saving, I'm going to run these tests.
(...)
So I get this same error locally.
(...)
I should have said keep DB in any way it's going to create a throwaway database.
(...)
Now this is interesting. It's able to run the tests in this environment.
(...)
Let's see what GPT makes of this error.
(...)
The error indicates that the recapture private key environment variable is either missing or not set it as a string. There we go. So empty string could be the difference here, which is required for the configuration of the capture package within your Django application. To dissolve this, you should set the recapture private key environment variable to the correct value. For testing purposes, you can set it to a dummy string.
(...)
And again, this would be a solution that we need to do across all the tests.
(...)
And this is coming from an environment variable in our settings.py. Could I just default to an empty string there? Would that be a simple solution?
(...)
Now we're getting the failures from earlier. This is relating to some tests. Let's bring out range.
(...)
This could be important tests that are failing.
(...)
But they've only recently started failing. I'm not sure what happened.
(...)
That's issue number 929.
(...)
So the port closes,(...) number 929, so it's linked.
(...)
We'll wait for the CI to run.
(...)
CodeQL pipeline takes too long. I'm thinking about disabling this, or at least it doesn't need to run so often.
(...)
I'll look into that later.
(...)
We do want some automated code quality support.
(...)
I've tried a couple of other code quality solutions.
(...)
In both of those, I had some difficulties,(...) so we ended up disabling them.
(...)
We'll wait for this to run. I won't push any more changes, but essentially the next thing is actually in the settings I need to leave the settings open.
(...)
Right here, content migration.
(...)
We can probably remove this to do. I'm not going to do the PayPal webhook support.(...) We're not synchronizing the PayPal data.
(...)
And essentially, this whole app can now be removed.
(...)
It's quite a large change.
(...)
It looks like we still have failure, but now I think the failure is going to be the tests for the migration.
(...)
Yeah, so that's correct.
(...)
So if I remove that code,(...) make sure the project still runs and push the changes.
(...)
While these tests are running, I'll get some more tea. I'll be right back.
(...)
All right, so we do have a couple of errors.
(...)
I have to figure out the pagination thing.
(...)
Aha.
(...)
So, our cart tests, yeah.
(...)
Okay.
(...)
So, let me grab the settings real quick. To change the settings, I'll stage those.
(...)
And I'll revert these for a moment.
(...)
And then what I need to do is move the...
(...)
Move this Kitter Create Site Root page to a shared or a common place.
(...)
Core.
(...)
Test utils.py.
(...)
All right, so that fixed it there. And let's see if there's one more place.(...) And module name contact migration cart tests, same.
(...)
Okay.
(...)
So, it looks like the last one is here in the content migration module. So, at this point, I can remove the content migration module.
(...)
All right, everything succeeded. I've got a couple of deprecation notices. I'll...
(...)
Or at least a warning and a deprecation notice. I'll need to handle them separately.
(...)
Not exactly sure I'd resolve this warning, but I'll go into more details about that.
(...)
And another stream, perhaps. Maybe this one.
(...)
So, tester is passing. And I'll just commit these changes a little bit in chunks. So,(...) move get a create site page helper.
(...)
Very good.
(...)
Oh,(...) some lint.
(...)
And the rest of it is just remove content migration app.
(...)
86 files,(...) number of lines of code. So, right now our lines of code is delta plus two minus two, so zero delta.
(...)
Let's see what it is when I push.
(...)
Okay, we'll refresh the page.
(...)
Minus 5,000 lines of code. A lot of tests, a lot of migration code.
(...)
Almost 6,000 lines.
(...)
If I were to round, I would round it up.
(...)
So, we'll wait for this CI pipeline to run. It should be successful. The test should pass here locally.
(...)
And less code is more. So, in other words, we're removing code. So, our code quality should be improved overall. Our maintainability score should go up.
(...)
Code coverage should go up. So, prior to this pull request, 84%, largely due to the amount of code that I've left uncovered in the content migration app.
(...)
You see, we're only at 46% coverage there.(...) A lot of manual testing, multiple imports.
(...)
We've imported in staging environment a couple of times, and we've launched the site.
(...)
So, I think it's been done enough that, to my knowledge, we've covered our bases.(...) We still have some safety checks in place if we need to roll back to the Drupal site for a moment and then rerun the migrations. Another strategy was to run a partial content migration. For example, I had overlooked a publishing date field in the library items. So, I just partially migrated those dates, publication dates.
(...)
So, at this point, I think it's okay for our project to lose this code. And, as I've mentioned in the prior session, it's in our git history as well as on GitHub this pull request.(...) So, if we need to, I can revert this change and I can recover these files.
(...)
We just don't need to actively maintain them.
(...)
Okay, so we do have some errors. Let me just refresh real quick.
(...)
Three lines are missing coverage, all right?
(...)
It's code coverage.
(...)
All right.
(...)
Forms model 100%.(...) Delta and negative here in the accounts model is okay.
(...)
Interestingly,(...) true.
(...)
These are so thin and I basically copied them directly from the Django abstract user. I think it was the abstract user class. I'm going to kind of trust these lines of code. They're copy pasta.
(...)
And they're introduced in a different pull request in any case. So, somehow, code coverage is just picking up on them now.(...) I want to use those as a blocker.
(...)
However, we do have codices static analysis in progress and code QL still in progress.
(...)
Hey, Dota, what's up? How are you doing?
(...)
Tests.
(...)
Oh, does it? Oh, no. Okay. I just tweaked the microphone settings. Thanks for always helping me correct my audio.
(...)
Let me see.
(...)
Let me just disable all the filters real quick.
(...)
Here's with no filters on.
(...)
How does this sound?
(...)
I can isolate if it's a particular filter. I've got only three filters.
(...)
Noise suppression.
(...)
Ah, okay. So, here's noise suppression. I've enabled noise suppression.
(...)
Did that get rid of some of the white noise?
(...)
Okay. One second. Let me make sure I've got the right device selected.
(...)
Yes. So, this is the device.
(...)
I hope that wasn't too loud.
(...)
So, I think the upward compressor is the culprit.
(...)
Here's a limiter, minus 3 dB limiter. It shouldn't have any effect. It just keeps your ears from popping if I sneeze or cough.
(...)
So, that should be fine.
(...)
Okay, am I underwater now?
(...)
Upward compressor.
(...)
Underwater.
(...)
Hello SpongeBob. Okay, I'll leave that off. I do want to apply a compressor. This upward compressor is new. I just use the default settings.
(...)
I'll use a more conventional compressor. That way the audio volume stays relatively stable.
(...)
I'll just do a slight dB boost so I'm audible.
(...)
Testing one, two, three. This is how loud I talk normally. I'm in the yellow now. This should be relatively audible. I'm going to bump it up to four.
(...)
Okay, am I still in the... Now, I'm going to read a little bit. Minus 10 dB.
(...)
Water now with the compressor on.
(...)
Okay, turning compressor off.
(...)
Compressor is off at four for sure. Ah.
(...)
Whoa. What about now?
(...)
At two.
(...)
So, I can stand the yellow it looks like.
(...)
20 was accident.(...) Sorry about that.
(...)
Two decibels.
(...)
I don't need a compressor at all. I just wanted the two... All right, let's leave it here.
(...)
Because the compressor makes the dynamic range smaller so it's more conversational, continual level.
(...)
The upper compressor is supposed to bring the quiet parts up a bit and the other compressor is squashing the transients and louder segments.
(...)
You can use both, I guess, but I don't know.
(...)
Try one. Okay, I can do one.
(...)
Compressor 1 dB. This is just to make up... Oops, make up.
(...)
Sorry.
(...)
Yeah, improving the code coverage by removing code.
(...)
Removing a whole bunch of code. So we're at 84% code coverage.
(...)
And I'm removing code about 5,500 lines and this code has only 46% coverage.
(...)
There's a couple lines that are flagged as being uncovered.
(...)
So I suppose if you're curious about writing...
(...)
Just in writing some unit tests, we could write some assertions against these such as maybe assert called would be a good one.
(...)
My user model has two new fields in order for it to adhere to the API. The interface that is required by our registration flow, our new registration flow sends an email verification.
(...)
And so I had to add this email user method.
(...)
Okay, cool.
(...)
Yeah, lurk away.
(...)
And then this clean method. I think I just defer these because actually there's a feature I need to work on.(...) But I'm going to merge this pull request and actually work on the actual feature.
(...)
I just wanted these tests to pass so that if I write this new feature and decide to write the test for it, I'll not get false failures. So here we go.
(...)
So momentarily, our code coverage should change.
(...)
I think after this runs...
(...)
So we'll look at this.(...) Oh, wow. 98% coverage now.(...) Right away.
(...)
Why did I decide on code coverage? Like this particular code cove or just in general code coverage?
(...)
I think the main reason in general...
(...)
Why is that metric that matters? Good point.(...) Well,(...) in general,(...) I want to have confidence, some level of certainty that the code is behaving as I would expect it and within the constraints of expected boundaries or whatever behaviors. So tests I see as a way of taking a piece of code and expressing all the possible or expected behaviors and negative cases where you don't want it to do something as well.
(...)
And then being able to replay those on demand.
(...)
Yeah, and I'm not extreme about how much code under test. I think it should be a significant proportion though, 80, 90%.
(...)
Basically so that I don't accidentally break stuff. You're all getting notice right when I break something, the test will start failing. Even if the test is just almost redundant.
(...)
Sometimes the tests are just really flaky because they're really just written directly to how the code behaves in a specific context. But that's the, I guess, purpose of them. I get a little bit of a warning sign when I'm doing something that's affecting another part of the application.
(...)
Yeah, that's cool. It does encourage me to write tests.
(...)
And I'm doing it as a, there's too much in my project to keep in mind and I can't really see when things are breaking.
(...)
And I want to have some confidence that things are still working when I deploy the changes that I'm adding.
(...)
And I want to also understand the code better and think through the behaviors and the tests help me think through the domain a bit.
(...)
Yeah, that's true. I'm not again using this metric as like a particular dogma or anything like that, but it's just more that I want to have at least the significant critical parts of code under coverage.
(...)
Okay, what kind of code coverage tool did you use for that?
(...)
Yeah, that's kind of what I'm expecting too is I know the behavior is still the same and especially with code that is used in multiple places in the app, there's interactions that are kind of sometimes complicated.
(...)
Okay, so .NET one that was a coverage tool.
(...)
Yeah, CodeCov, I use this at work and then on my open source side projects,(...) which this site just launched by the way, this Western Friend website is now live. If you want to check it out, I'll just send you the link. You can see the fruits of our labor. This was a five-year project.
(...)
We launched it on Wednesday,(...) Wednesday evening, Eastern Europe time, Europe time, Eastern Europe.
(...)
Where's that one?
(...)
Insights.
(...)
So we launched it almost five years to the day.(...) It was a little bit past.
(...)
And a lot of this was just writing that test coverage that we were just talking about like a test sprint,(...) particularly in my migration scripts. But then at the last moment, we decided to switch back to PayPal for our payment processor from Braintree.
(...)
And so I had just a quick refactor of the payment system. So that's what these last spikes were. But most of this was feature development. Not a lot of tests were written up to that point, to be honest. Most of the tests were written here with the help of Copilot.
(...)
I'm curious now if I look, I think at the code frequency, if I can see this big blob of deletions.
(...)
Yeah, boom.
(...)
I think that's one of the least tests that were going on. And then boom, I just kind of removed a bunch of them just now. I think that's up to date.
(...)
I like these. This is kind of cool.
(...)
How big is the blog?
(...)
Well, it's different. It's not just a blog. It's actually an online magazine.
(...)
It has a bookstore,(...) an archive that goes back to 1929,(...) all these issues,
(...)
an online reader for the issues.
(...)
The first edition of Friends Bulletin, 1929.
(...)
This is done by Internet Archive, but you can select a text. You can search within them.(...) We have more recent issues. These top three are subscribers only, so we have a way of subscribing to the magazine.
(...)
And all the older issues, going back to the 90s, when it was transitioned over to Western Friend, they can be read online. And then the Deep Archive goes back to 1929, like I was just pointing out. We also have a multimedia library,(...) so a bunch of different content that didn't quite make it into the magazine and the faceted search.
(...)
We're publishing podcasts and memorial minutes for people in the community who have passed away.
(...)
And there's relationships in all of our data between meetings and people and authors of articles.
(...)
So it's online events and events calendar and regular pages, a contact form. I just added the capture to this contact form. It's a big project. It took quite a while to port it over from Drupal.
(...)
Okay.
(...)
Yeah. So the blog would be a much smaller scope. In particular, you wouldn't have to worry about e-commerce and subscription model and things like that necessarily, unless you're building a sub-stack or something like that, I suppose.
(...)
But for the blog, you can just use this Wagtail CMS out of the box. It'll be pretty much ready to roll.
(...)
This is what we used. Markdown files. Yeah, that's a good design. It keeps it simple and published. I'm thinking about publishing a blog with Markdown as well so I can have my own space.
(...)
Also, like books. There's this one. Let me look this up on my phone real quick.
(...)
If I can get the URL for this.
(...)
Publishing then, Cuarto. Q-U-A-R-T-O. Because I would like to maybe start writing some larger scale books or publications using Markdown. I found this one that's pretty cool using basically Jupyter Notebooks, Python, or Pandoc or other Markdown forms. You can just create websites and books with that as well.
(...)
For example, like a book about programming or something might be kind of fun, or a website about this game development project that we're kind of starting up.
(...)
All right, let's see. No code. Yeah, that's nice.(...) You just have like an action that runs on it to deploy it. Build page.
(...)
How do you do find the action here?
(...)
Jekyll. Oh, yeah, yeah. Yeah, cool.
(...)
Nice.
(...)
Yeah, the GitHub page's default Jekyll integration is pretty convenient.
(...)
Very cool. Project Graveyard, Boomerbot.
(...)
I like the zombie theme.
(...)
Expense Report Kata. I did look into those code katas as well. I found some. I haven't practiced any of them, but it's a good idea. I like the idea.
(...)
Yeah, cool.
(...)
Website, JavaScript, and Python. I've got an idea for a Python project. I'm looking for a collaborator on using large language models. I might start it up in some...(...) Actually, today, I'm going to work a bit on this capture feature, and then I'll take a break. And this evening, I'm going to work with Lang chain on some large language model idea that I have. It'll be open source,(...) and it's like the idea is to have...
(...)
It's not unique to me, but this idea is that, you know, a lot of times when we're prompting these generative AI, it takes multiple steps to get a good output. You can't just get a good output at the first prompt usually. You have to go back and forth and refine it, and you end up building a sequence.
(...)
You can call it a workflow or a process.
(...)
Now, on the other hand, so if I'm writing an article, I'll have a process of how I interact with the... Just in general, if I wrote it, I would have a process, you know, outline it and fill in details and find resources that help me fill in more details. And you have a process for writing blog posts, for example, with large language models the same.
(...)
So the idea is to have an open source platform that allows people to define these processes and then interact with the process via natural language. So you are guided through step by step and have multiple bots that will take the next output from the previous step and prompt you further, prompt the human for the next input. So it's a conversation, but it's done in a way. It's like an interview. The bot is kind of interviewing you to get the prompts and get the details out of you.
(...)
And just expanding this one layer further, then there's this idea of business processes. It's the same idea you have processes like if you're going to do...
(...)
a market report, market analysis, you might need to first find a bunch of related companies and do some research on their products and profitability and things like that. And these AI can help you with those steps, but the thing is, it's not always easy for the person to string together the process. So you have an MBA, you know a lot of these business processes, then probably.
(...)
What we're doing is just trying to codify those processes in large language model chains and support people in their work on these sometimes pretty complicated tasks like preparing an investor report or analyzing financial data(...) and communicating that to the board of directors, those types of things.
(...)
Let me take a quick break, but yeah, type the story and I'll check it in just a moment. I'll be right back. I'm going to get some tea and take a quick break. Just a couple of minutes.
(...)
[Silence]
(...)
All right, let's see.
(...)
So building software that dealt with manufacturing of fine chemicals and they had these recipe ingredients documents that would get passed around.(...) Decided to follow how the document went from the plant to QA to shipping, whatever the flow was.
(...)
And they would have some kind of documentation control.
(...)
There was no flow. The batch record floated around the plant, seemingly at random, just like hand to hand almost.
(...)
Somebody left it on the lunch table.
(...)
It's got a mustard stain on it.
(...)
Yes, so this is like...
(...)
Ah, okay.
(...)
So at least there was some digitization going on, I guess.
(...)
Yeah, so this is like business process automation in a way with LLM support
(...)
and particularly for processes that involve creativity or generativity or summarization.(...) And it's not just like generative AI in the mix here as well. It's any kind of...
(...)
It doesn't have to be artificial intelligence, but for example, machine learning algorithms that can help summarize knowledge or reduce the dimensionality of a research dataset that was scraped off the web by a large language model.
(...)
And then utility nodes, it's kind of a graph in my mind, such as like a Google sheet where the stuff gets dumped. This is not my idea alone. I've been following some YouTube channels and seeing some recipes where you're integrating LLMs to help you do research, summarize that research, structure it, the CSV that goes into GitHub, then it's fed to another chain. So I'm kind of wanting to dig into that.
(...)
Just to learn how to do it. And then with the perspective of how I can use it to benefit people and companies
(...)
and their process, make people's lives easier in a way(...) by giving them a personal assistant that has well-structured business processes embedded in the mix so they don't have to always invent their own business process. That's already complicated enough.
(...)
Yeah, so that's the idea.
(...)
300 people on the plant and you got this sheet floating around.
(...)
Yeah, so if you're interested in these LLMs, I'll try to do a little bit of this tonight. Just digging into LengChain, I'm looking for the building blocks right now for the idea. And I've already got a basic idea.(...) I'll have to start by coding the definitions at first, the pipeline definitions, for example.(...) But I would like to find or create a generic schema that lets you define these pipelines in JSON or something like that, where you specify the model and the purpose of each node, and then the system prompt, and then the user prompt, for example, in a structured format that could be passed into a user interface where people could define these chains graphically and not have to do so much coding. But that's the general aim.
(...)
And then to have a portfolio of these types of things, identify common business processes, identify common personal research needs or whatever,
(...)
and to start sketching out some of these workflows and maybe sharing them or something.
(...)
There could already be something that's doing this exact idea. I haven't seen it. I've been looking for it. Something similar.
(...)
So that's just an idea I was working on last night.
(...)
Meanwhile,(...) protecting the Western Friend website from bots.
(...)
So let's switch over to this task now.
(...)
And I guess it would be written in Python with a lang chain or something equivalent. I haven't done too much more research, but lang chain seems like the sort of de facto solution for changing together these models.
(...)
And then there's-- what's the other thing? For deployment, there's some solutions for deploying the chains and managing that.
(...)
What was it I found? MLflow. I've been keeping an eye on that for a while.
(...)
And I'd probably use a Django backend just because I'm familiar with Django and it has access control and things like that.
(...)
And I don't want to be investing too much in building our own models or running our own models at this point. I would probably just use APIs like the OpenAI API, for example.
(...)
So let me consolidate real quick. We'll use chappi.gpt and I'll need that for docs.
(...)
Context switch.
(...)
So here's my task.
(...)
Protection for the registration form.
(...)
Yeah, yeah, no commitment necessary. It's just open source so everyone can feel free to contribute and steer the project. I don't even know what the name would be or anything like that.
(...)
So it's just an idea at this point. I'd like to see it come to fruition.
(...)
I guess I think it would be very useful for a lot of-- even just personal reasons like writing blog posts or something
(...)
where I've kind of started to craft a process around how I engage the LAM to write the blog post. Although sometimes you can get a good output with one prompt, but generally not, especially for longer or articles, longer posts or articles. And if you want to write a book, like a textbook or even just a report, it's going to be more involved. There's going to be more steps involved. So if you have just this book writing assistant that guides you through the steps, that would be rad.
(...)
It helps you get your best workout by prompting you to get what's in your mind into good form and adds all these other insights that are latent in both your knowledge and the machine learning model. It's just activating all this latent space, both in the human and the LLM, generative AI.
(...)
All right, we need a branch.
(...)
And this would be registration form capture.
(...)
And we have this capture installed. I've signed up. I've got our keys configured already.
(...)
I don't think we need this proxy right now.
(...)
Or that. So I think we're going to find our form and add a capture field.
(...)
So where was that? Accounts,(...) forms,(...) from capture fields. Now, it's not a typical Django form though. It's a registration form, which actually does come from Django forms. So this might just work.
(...)
And it's just a recapture field and maybe it doesn't need any configuration even.
(...)
So,(...) let's see what happens.
(...)
Yeah, a lot of entry promise is an open source and it's easy to get really excited about something. And in the moment, you're like, yes, I can help with that. But then life comes around and yeah, it's busy and you have other priorities.(...) And honestly, sometimes you just want to build your own thing or focus on your own hobby. So that's cool. I understand the tensions.
(...)
All right, localhost. So now, if I'm not logged, okay, I'll log out.
(...)
Yeah, and we've got to make the time. We have to be real intentional about that. That motivation doesn't come cheap. Okay, now if I go to actually register,(...) yeah, we have a capture field.
(...)
Yes. Register.
(...)
Yeah, and then now we get these instructions to activate our account. This was from a different button. I was doing this from Mac. You can do just copy control C, but then Linux, I always forget you have to do control, shift C because there's some old control C from Unix days is kill a process or whatever.
(...)
Anyway, so I get my things mixed up. So our account's been activated, RMIT.
(...)
And logging in should work.
(...)
Wow, that was like a one line of code change due to the previous code adding recapture. So in today's session, basically, more cleanup got our old or the code removed that we don't want to maintain in the long run. It was temporary code. I can revert the PR and restore that code if we need it, but clean that up and then added one line of code to enable capture protection on our registration form.
(...)
Wow, two lines of code,(...) three lines of code.
(...)
That's true.
(...)
Money does give us some freedom and optionality,(...) but time is the truly scarcest resource.
(...)
And I've wasted so much time in my life. So I'm trying to make up for it. It's like,(...) you know, bygones are bygones.
(...)
Okay, so we'll create that.
(...)
Close 817.
(...)
And at this point, our forms are protected. So this actually will close the item number 817.
(...)
Yeah, let's see. What are some sayings about time being scarce or fleeting and wasted on youth?
(...)
Time and tide wait for no man.(...) Youth is wasted on the young.
(...)
Life is short. Time is swift.
(...)
Tempest fuget, fuget.(...) Time flies. Tempest fuget. Interesting.
(...)
The days are long, but the years are short.(...) Gather ye rosebuds while ye may.
(...)
That's pretty.
(...)
Time is the wisest counselor of all. So maybe youth is wasted on the young.
(...)
That's kind of similar to what you're asking. Time is wasted on the youth. That's true, too.
(...)
Nice.
(...)
Yeah.
(...)
George Bernard Shaw.
(...)
Possibly.
(...)
Yeah, true. Those hallucinations are possible, but I've had a pretty good success rate.
(...)
Let's see.
(...)
If I do one new chat, GPT-4,(...) browse with Bing.
(...)
Oops, wrong button.
(...)
GPT-4 browse with Bing.
(...)
And even have GPT-4 fact check itself.
(...)
But that's a really crucial observation you're making, too, especially if I'm going to go into this area, an idea of using these large language model agents to build business processes that every step of the way there's some uncertainty. And it's probably,(...) or hallucination or those types of things, error. And it probably accumulates, right? It's something like that where each step inherits the error from the previous steps and can kind of spiral. So quality control is an interesting dilemma. And these things are almost non-deterministic, so it's kind of also making me question if the idea is even possible or feasible. I want to start experimenting with it.
(...)
Yeah, true. So less is more using those type of heuristics.
(...)
Keep it simple. Less is more.
(...)
And the transparency or opacity of the models is a bit concerning as well because we can't really always determine how it came to the conclusion or where it got the information from. But there are techniques like here where we can get citations. So we can have the model inspect itself. And I've also been watching some this guy does these knowledge graphs and he's showing this interesting way of I have. Let's see if I can have it here. YouTube knowledge graph.
(...)
That was one. That was an interesting one, but that's not the one.
(...)
I see if I can find this.
(...)
Here's this product. It's really good. Interesting here. I think it's.
(...)
I'm not sure if I'll be able to find this as Neo4j.
(...)
Here is a knowledge graph. Gosh darn it. I can't find it, but it's looking at how to make the output of these LMS more here. Here's a guy notice labs.
(...)
This guy's pretty crazy. He's got this product that lets you take the output of LMS and sort of build knowledge graphs out of it. And then you can inspect the knowledge graph for like latent semantics in areas of the semantic space that you might not have explored or might be making false connections.
(...)
And he's one of his ideas is that it improves quality output and makes the model more transparent through multiple iterations.(...) And this tool you use like if you're writing a blog post or doing research or summarizing an article to see the main knowledge space.
(...)
So this I don't know. These are very interesting topics.
(...)
But yeah, I got what you're saying about keeping it simple and transparent. And what other heuristics would be good?
(...)
Well being inclusive. So basically including more people by being open source.
(...)
So in a way of Chudgibg was corrected. It's often attributed to George Bernard Shaw.
(...)
Okay.(...) So yeah, it was a paraphrasal.
(...)
A paraphrase of a hearsay.
(...)
But that's the nature of knowledge and knowledge that's just embedded in these large language models as well.
(...)
As simple as fact. Yeah. Manual fact checking or reading the user manual. RTFM. Although that is I was just having some trouble yesterday with some documentation and came to the realization that they should be following the diet axis framework.
(...)
Because most of the knowledge in that manual was explanation and reference and more so reference. It was like almost completely reference. And what I was needing in that situation where I was dealing with a registration flow for a Django package. I was just needing how to guide some very practical steps. I honestly didn't. We worked through it out. Got the thing done. But a simple tutorial how to would have just pushed me forward. No fact checking needed there. The code in this case is the fact. If it runs it is the fact checker I guess. But yeah.
(...)
This is an interesting framework and writing documentation is hard and it's even hard to know what to write. And oftentimes we just like lean into reference because it's like well the class has these members and this one does that now and that.
(...)
And maybe we'll add a little bit of why. Why it does that.
(...)
But in my daily practice at work we don't have like almost any of this. We have almost none of that and there's a lot of pushback even to add comments in the code offering explanation. Although we're getting better about that linking things to your tickets and stuff and be like why does this function exist.
(...)
And why are we checking out here. And we don't have much of this either. Actually our documentation is kind of poor at work.
(...)
But for public projects we should be seeking balance somewhere. Or be here balanced between these. But I think starting here the practical steps and then working to the theoretical knowledge.
(...)
If you've got limited time and even just starting with the tutorial.
(...)
And then the next thing or you know you could choose your own adventure there.
(...)
Yeah that's true. Like the reference docs can come out of the doc strings for example in Python or Dart does that very well.
(...)
So yeah then the humans are able to do this. And for example GPT or CoPilot can actually help me write my docs. So what else here. CoPilot see if we need some help. Custom user registration form with a CAPTCHA. You know it's pretty obvious but if I'm just inheriting this form in some place I might not be looking at all its members. So there we go. Small improvement.
(...)
Interesting.
(...)
And my linter helps me out too.
(...)
I will take it.
(...)
Yeah and tutorials are pretty tricky to make aren't they. And especially when libraries change and the way you do things is always shifting around a bit. I can see you know why it's so uncommon to write quality documents. It takes an investment in an intentional process. We push where I push that change and I'm going to merge this and spend one hour. I'll take a break. Gather my thoughts and probably come back in about one more hour and work on this lang chain idea just to see what's out there how it works. Watch some tutorials maybe and take some first steps with a lang chain.
(...)
This is a bit slow isn't it. The CI pipeline.
(...)
Oops.(...) Refresh the page real quick.
(...)
Yeah when we started this project was Django 2.
(...)
Funnily enough when we launched on Wednesday it just didn't feel like anything. It was weird. I was thinking it would be like a celebratory moment. We're like yeah we did it.
(...)
But anyway it was like it was more like a launched now.
(...)
I don't even know how it really felt.(...) We're kind of tired.
(...)
A little bit tired.
(...)
And of course it's not done. There's still stuff work to do but nonetheless.
(...)
We got MVP out.
(...)
Minimum usable probably. Minimal usable.
(...)
All right.
(...)
So I think I'm just going to merge this so it can start the deployment step.
(...)
I could probably run these tests faster here. I hear I don't have a test covering the templates so I don't check for the presence of a new field.
(...)
But OK we'll merge this.
(...)
This is an intermediate intermediate intermittent failure is integrity error.
(...)
Something about my user factory.
(...)
My patchinator tests.(...) Somehow generating duplicate emails but that's just an intermediate error. Intermittent issue flaky test basically.
(...)
So I will merge that and when it runs on main it will be fixed. I'll have to fix that flaky test later.
(...)
Brace in disregard of a failing test.(...) But hopefully it's turned to a green checkbox.
(...)
Well I'll do a quick outro. This has been another live code hangout.
(...)
I've been working on the Western friend website on a small pull request to add capture to our user registration form. That pull request has now been merged. There's only a few lines of code and did a larger code removal of around 5500 lines by removing the content migration app and all its accompanying tests.
(...)
It does that our maintainability stayed about the same but our code coverage increased due to having overall high code coverage in most of the other areas of the project except we had 46 percent code coverage in the content migration app.(...) It was fairly complicated code not intended for long term maintenance and we did a lot of manual testing on that and multiple migrations.
(...)
So full content migrations using those tools which gave us enough confidence that the code was behaving correctly such as by auditing the resulting content in Wagtail.
(...)
If you'd like to get involved with this project and manual regression testing is an interesting idea as well. And you keep like a script of common tests so that you remember the steps to take. That's a good idea for quality assurance.
(...)
I could introduce that here in our documentation.
(...)
So if you're watching this video summary and you'd like to get involved with this project you can stop by github.com.
(...)
And we're in the WF website project.(...) We do appreciate contributions of all kinds not just code and we try to acknowledge different kinds of as well as code contributions because those are usually the most obvious. But we appreciate bug reports improvements to our documentation such as contributing a manual regression test document and project management design work security improvements all of that we try to we try to mention who's helped us bring this project along in these last five years.
(...)
So thanks for checking out the livestream. DOTA thanks for stopping by and hanging out. It's always nice to have somebody chat with while doing these work.
(...)
All right. We'll have a great day and hopefully see you around a little bit later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment